> Thanks for the replay. If I shorten the string the customer is treating
> it as Data lost. So I think that shouldn't a good solution.
Then you got a lot of other problems coming your way, on a small screen... Have
fun!
> Yes it is a
> touch screen only. And u suggested to use Roller....Can u post a pseudo
> code that how to use Roller.
Well, OK, here you go... Pretty crude, but I think it shows what I was
suggesting, anyway...
---------------
//
// Test a demo of a rolling list type-of-a-thing...
//
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Button.H>
#include <FL/Fl_Roller.H>
#include <FL/Fl_Hold_Browser.H>
#include <stdio.h>
static Fl_Double_Window *main_win = NULL;
static Fl_Roller *roller = NULL;
static Fl_Hold_Browser *brws = NULL;
static Fl_Hold_Browser *brws2 = NULL;
static void cb_Exit(Fl_Button*, void*) {
main_win->hide();
}
static void cb_roller(Fl_Roller *rl, void *v) {
int val = (int)rl->value();
Fl_Hold_Browser *br = (Fl_Hold_Browser *)v;
if(br)
{
printf("roll-to %d\n", val); fflush(stdout);
br->topline(val);
}
}
static void cb_brws(Fl_Hold_Browser *br, void *v) {
int val = br->value();
printf("%s (%d)\n", br->text(val), val); fflush(stdout);
}
int main(int argc, char **argv)
{
main_win = new Fl_Double_Window(551, 366, "List Roller Demo");
main_win->begin();
Fl_Button* exit_bt = new Fl_Button(476, 326, 64, 28, "Exit");
exit_bt->callback((Fl_Callback*)cb_Exit);
brws = new Fl_Hold_Browser(75, 100, 165, 170);
brws->callback((Fl_Callback*)cb_brws);
brws->scrollbar_size(1);
brws->clear_visible_focus ();
roller = new Fl_Roller(35, 100, 40, 170);
roller->step(0.25);
roller->callback((Fl_Callback*)cb_roller, brws);
roller->clear_visible_focus ();
brws2 = new Fl_Hold_Browser(270, 100, 165, 170);
brws2->callback((Fl_Callback*)cb_brws);
main_win->end();
// now add a few lines to the browsers //
int iter;
for(iter = 1; iter <= 50; iter++)
{
char line[64];
snprintf(line, 64, "(%3d) This is line %3d", iter, iter);
brws->add(line);
brws2->add(line);
}
roller->maximum(brws->size());
main_win->show(argc, argv);
return Fl::run();
}
/* end of file */
---------------
SELEX Galileo Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk