fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Browser.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Browser widget for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2016 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18 
19 #include <FL/Fl.H>
20 #include <FL/Fl_Browser.H>
21 #include <FL/fl_draw.H>
22 #include "flstring.h"
23 #include <stdlib.h>
24 #include <math.h>
25 
26 #include <FL/Fl_Hold_Browser.H>
27 #include <FL/Fl_Multi_Browser.H>
28 #include <FL/Fl_Select_Browser.H>
29 
30 
31 // I modified this from the original Forms data to use a linked list
32 // so that the number of items in the browser and size of those items
33 // is unlimited. The only problem is that the old browser used an
34 // index number to identify a line, and it is slow to convert from/to
35 // a pointer. I use a cache of the last match to try to speed this up.
36 
37 // Also added the ability to "hide" a line. This sets its height to
38 // zero, so the Fl_Browser_ cannot pick it.
39 
40 #define SELECTED 1
41 #define NOTDISPLAYED 2
42 
43 // WARNING:
44 // Fl_File_Chooser.cxx also has a definition of this structure (FL_BLINE).
45 // Changes to FL_BLINE *must* be reflected in Fl_File_Chooser.cxx as well.
46 // This hack in Fl_File_Chooser should be solved.
47 //
48 struct FL_BLINE { // data is in a linked list of these
51  void* data;
53  short length; // sizeof(txt)-1, may be longer than string
54  char flags; // selected, displayed
55  char txt[1]; // start of allocated array
56 };
57 
70 void* Fl_Browser::item_first() const {return first;}
71 
78 void* Fl_Browser::item_next(void* item) const {return ((FL_BLINE*)item)->next;}
79 
86 void* Fl_Browser::item_prev(void* item) const {return ((FL_BLINE*)item)->prev;}
87 
100 void* Fl_Browser::item_last() const {return last;}
101 
108 int Fl_Browser::item_selected(void* item) const {
109  return ((FL_BLINE*)item)->flags&SELECTED;
110 }
117 void Fl_Browser::item_select(void *item, int val) {
118  if (val) ((FL_BLINE*)item)->flags |= SELECTED;
119  else ((FL_BLINE*)item)->flags &= ~SELECTED;
120 }
121 
127 const char *Fl_Browser::item_text(void *item) const {
128  return ((FL_BLINE*)item)->txt;
129 }
130 
147 FL_BLINE* Fl_Browser::find_line(int line) const {
148  int n; FL_BLINE* l;
149  if (line == cacheline) return cache;
150  if (cacheline && line > (cacheline/2) && line < ((cacheline+lines)/2)) {
151  n = cacheline; l = cache;
152  } else if (line <= (lines/2)) {
153  n = 1; l = first;
154  } else {
155  n = lines; l = last;
156  }
157  for (; n < line && l; n++) l = l->next;
158  for (; n > line && l; n--) l = l->prev;
159  ((Fl_Browser*)this)->cacheline = line;
160  ((Fl_Browser*)this)->cache = l;
161  return l;
162 }
163 
171 int Fl_Browser::lineno(void *item) const {
172  FL_BLINE* l = (FL_BLINE*)item;
173  if (!l) return 0;
174  if (l == cache) return cacheline;
175  if (l == first) return 1;
176  if (l == last) return lines;
177  if (!cache) {
178  ((Fl_Browser*)this)->cache = first;
179  ((Fl_Browser*)this)->cacheline = 1;
180  }
181  // assume it is near cache, search both directions:
182  FL_BLINE* b = cache->prev;
183  int bnum = cacheline-1;
184  FL_BLINE* f = cache->next;
185  int fnum = cacheline+1;
186  int n = 0;
187  for (;;) {
188  if (b == l) {n = bnum; break;}
189  if (f == l) {n = fnum; break;}
190  if (b) {b = b->prev; bnum--;}
191  if (f) {f = f->next; fnum++;}
192  }
193  ((Fl_Browser*)this)->cache = l;
194  ((Fl_Browser*)this)->cacheline = n;
195  return n;
196 }
197 
207  FL_BLINE* ttt = find_line(line);
208  deleting(ttt);
209 
210  cacheline = line-1;
211  cache = ttt->prev;
212  lines--;
213  full_height_ -= item_height(ttt);
214  if (ttt->prev) ttt->prev->next = ttt->next;
215  else first = ttt->next;
216  if (ttt->next) ttt->next->prev = ttt->prev;
217  else last = ttt->prev;
218 
219  return(ttt);
220 }
221 
229 void Fl_Browser::remove(int line) {
230  if (line < 1 || line > lines) return;
231  free(_remove(line));
232 }
233 
243 void Fl_Browser::insert(int line, FL_BLINE* item) {
244  if (!first) {
245  item->prev = item->next = 0;
246  first = last = item;
247  } else if (line <= 1) {
248  inserting(first, item);
249  item->prev = 0;
250  item->next = first;
251  item->next->prev = item;
252  first = item;
253  } else if (line > lines) {
254  item->prev = last;
255  item->prev->next = item;
256  item->next = 0;
257  last = item;
258  } else {
259  FL_BLINE* n = find_line(line);
260  inserting(n, item);
261  item->next = n;
262  item->prev = n->prev;
263  item->prev->next = item;
264  n->prev = item;
265  }
266  cacheline = line;
267  cache = item;
268  lines++;
269  full_height_ += item_height(item);
270  redraw_line(item);
271 }
272 
286 void Fl_Browser::insert(int line, const char* newtext, void* d) {
287  if (!newtext) newtext = ""; // STR #3269
288  int l = (int) strlen(newtext);
289  FL_BLINE* t = (FL_BLINE*)malloc(sizeof(FL_BLINE)+l);
290  t->length = (short)l;
291  t->flags = 0;
292  strcpy(t->txt, newtext);
293  t->data = d;
294  t->icon = 0;
295  insert(line, t);
296 }
297 
304 void Fl_Browser::move(int to, int from) {
305  if (from < 1 || from > lines) return;
306  insert(to, _remove(from));
307 }
308 
320 void Fl_Browser::text(int line, const char* newtext) {
321  if (line < 1 || line > lines) return;
322  FL_BLINE* t = find_line(line);
323  if (!newtext) newtext = ""; // STR #3269
324  int l = (int) strlen(newtext);
325  if (l > t->length) {
326  FL_BLINE* n = (FL_BLINE*)malloc(sizeof(FL_BLINE)+l);
327  replacing(t, n);
328  cache = n;
329  n->data = t->data;
330  n->icon = t->icon;
331  n->length = (short)l;
332  n->flags = t->flags;
333  n->prev = t->prev;
334  if (n->prev) n->prev->next = n; else first = n;
335  n->next = t->next;
336  if (n->next) n->next->prev = n; else last = n;
337  free(t);
338  t = n;
339  }
340  strcpy(t->txt, newtext);
341  redraw_line(t);
342 }
343 
350 void Fl_Browser::data(int line, void* d) {
351  if (line < 1 || line > lines) return;
352  find_line(line)->data = d;
353 }
354 
363 int Fl_Browser::item_height(void *item) const {
364  FL_BLINE* l = (FL_BLINE*)item;
365  if (l->flags & NOTDISPLAYED) return 0;
366 
367  int hmax = 2; // use 2 to insure we don't return a zero!
368 
369  if (!l->txt[0]) {
370  // For blank lines set the height to exactly 1 line!
371  fl_font(textfont(), textsize());
372  int hh = fl_height();
373  if (hh > hmax) hmax = hh;
374  } else {
375  const int* i = column_widths();
376  // do each column separately as they may all set different fonts:
377  for (char* str = l->txt; str && *str; str++) {
378  Fl_Font font = textfont(); // default font
379  int tsize = textsize(); // default size
380  while (*str==format_char()) {
381  str++;
382  switch (*str++) {
383  case 'l': case 'L': tsize = 24; break;
384  case 'm': case 'M': tsize = 18; break;
385  case 's': tsize = 11; break;
386  case 'b': font = (Fl_Font)(font|FL_BOLD); break;
387  case 'i': font = (Fl_Font)(font|FL_ITALIC); break;
388  case 'f': case 't': font = FL_COURIER; break;
389  case 'B':
390  case 'C': while (isdigit(*str & 255)) str++; break; // skip a color number
391  case 'F': font = (Fl_Font)strtol(str,&str,10); break;
392  case 'S': tsize = strtol(str,&str,10); break;
393  case 0: case '@': str--;
394  case '.': goto END_FORMAT;
395  }
396  }
397  END_FORMAT:
398  char* ptr = str;
399  if (ptr && *i++) str = strchr(str, column_char());
400  else str = NULL;
401  if((!str && *ptr) || (str && ptr < str)) {
402  fl_font(font, tsize); int hh = fl_height();
403  if (hh > hmax) hmax = hh;
404  }
405  if (!str || !*str) break;
406  }
407  }
408 
409  if (l->icon && (l->icon->h()+2)>hmax) {
410  hmax = l->icon->h() + 2; // leave 2px above/below
411  }
412  return hmax; // previous version returned hmax+2!
413 }
414 
423 int Fl_Browser::item_width(void *item) const {
424  FL_BLINE* l=(FL_BLINE*)item;
425  char* str = l->txt;
426  const int* i = column_widths();
427  int ww = 0;
428 
429  while (*i) { // add up all tab-separated fields
430  char* e;
431  e = strchr(str, column_char());
432  if (!e) break; // last one occupied by text
433  str = e+1;
434  ww += *i++;
435  }
436 
437  // OK, we gotta parse the string and find the string width...
438  int tsize = textsize();
439  Fl_Font font = textfont();
440  int done = 0;
441 
442  while (*str == format_char_ && str[1] && str[1] != format_char_) {
443  str ++;
444  switch (*str++) {
445  case 'l': case 'L': tsize = 24; break;
446  case 'm': case 'M': tsize = 18; break;
447  case 's': tsize = 11; break;
448  case 'b': font = (Fl_Font)(font|FL_BOLD); break;
449  case 'i': font = (Fl_Font)(font|FL_ITALIC); break;
450  case 'f': case 't': font = FL_COURIER; break;
451  case 'B':
452  case 'C': while (isdigit(*str & 255)) str++; break; // skip a color number
453  case 'F': font = (Fl_Font)strtol(str, &str, 10); break;
454  case 'S': tsize = strtol(str, &str, 10); break;
455  case '.':
456  done = 1;
457  break;
458  case '@':
459  str--;
460  done = 1;
461  }
462 
463  if (done)
464  break;
465  }
466 
467  if (*str == format_char_ && str[1])
468  str ++;
469 
470  if (ww==0 && l->icon) ww = l->icon->w();
471 
472  fl_font(font, tsize);
473  return ww + int(fl_width(str)) + 6;
474 }
475 
485  return full_height_;
486 }
487 
496  return textsize()+2;
497 }
498 
506 void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const {
507  FL_BLINE* l = (FL_BLINE*)item;
508  char* str = l->txt;
509  const int* i = column_widths();
510 
511  bool first = true; // for icon
512  while (W > 6) { // do each tab-separated field
513  int w1 = W; // width for this field
514  char* e = 0; // pointer to end of field or null if none
515  if (*i) { // find end of field and temporarily replace with 0
516  e = strchr(str, column_char());
517  if (e) {*e = 0; w1 = *i++;}
518  }
519  // Icon drawing code
520  if (first) {
521  first = false;
522  if (l->icon) {
523  l->icon->draw(X+2,Y+1); // leave 2px left, 1px above
524  int iconw = l->icon->w()+2;
525  X += iconw; W -= iconw; w1 -= iconw;
526  }
527  }
528  int tsize = textsize();
529  Fl_Font font = textfont();
530  Fl_Color lcol = textcolor();
531  Fl_Align talign = FL_ALIGN_LEFT;
532  // check for all the @-lines recognized by XForms:
533  //#if defined(__GNUC__)
534  //#warning FIXME This maybe needs to be more UTF8 aware now...?
535  //#endif /*__GNUC__*/
536  while (*str == format_char() && *++str && *str != format_char()) {
537  switch (*str++) {
538  case 'l': case 'L': tsize = 24; break;
539  case 'm': case 'M': tsize = 18; break;
540  case 's': tsize = 11; break;
541  case 'b': font = (Fl_Font)(font|FL_BOLD); break;
542  case 'i': font = (Fl_Font)(font|FL_ITALIC); break;
543  case 'f': case 't': font = FL_COURIER; break;
544  case 'c': talign = FL_ALIGN_CENTER; break;
545  case 'r': talign = FL_ALIGN_RIGHT; break;
546  case 'B':
547  if (!(l->flags & SELECTED)) {
548  fl_color((Fl_Color)strtoul(str, &str, 10));
549  fl_rectf(X, Y, w1, H);
550  } else while (isdigit(*str & 255)) str++; // skip digits
551  break;
552  case 'C':
553  lcol = (Fl_Color)strtoul(str, &str, 10);
554  break;
555  case 'F':
556  font = (Fl_Font)strtol(str, &str, 10);
557  break;
558  case 'N':
559  lcol = FL_INACTIVE_COLOR;
560  break;
561  case 'S':
562  tsize = strtol(str, &str, 10);
563  break;
564  case '-':
566  fl_line(X+3, Y+H/2, X+w1-3, Y+H/2);
568  fl_line(X+3, Y+H/2+1, X+w1-3, Y+H/2+1);
569  break;
570  case 'u':
571  case '_':
572  fl_color(lcol);
573  fl_line(X+3, Y+H-1, X+w1-3, Y+H-1);
574  break;
575  case '.':
576  goto BREAK;
577  case '@':
578  str--; goto BREAK;
579  }
580  }
581  BREAK:
582  fl_font(font, tsize);
583  if (l->flags & SELECTED)
584  lcol = fl_contrast(lcol, selection_color());
585  if (!active_r()) lcol = fl_inactive(lcol);
586  fl_color(lcol);
587  fl_draw(str, X+3, Y, w1-6, H, e ? Fl_Align(talign|FL_ALIGN_CLIP) : talign, 0, 0);
588  if (!e) break; // no more fields...
589  *e = column_char(); // put the separator back
590  X += w1;
591  W -= w1;
592  str = e+1;
593  }
594 }
595 
596 static const int no_columns[1] = {0};
597 
603 Fl_Browser::Fl_Browser(int X, int Y, int W, int H, const char *L)
604 : Fl_Browser_(X, Y, W, H, L) {
606  lines = 0;
607  full_height_ = 0;
608  cacheline = 0;
609  format_char_ = '@';
610  column_char_ = '\t';
611  first = last = cache = 0;
612 }
613 
621  if (line<1) line = 1;
622  if (line>lines) line = lines;
623  int p = 0;
624 
625  FL_BLINE* l;
626  for (l=first; l && line>1; l = l->next) {
627  line--; p += item_height(l);
628  }
629  if (l && (pos == BOTTOM)) p += item_height (l);
630 
631  int final = p, X, Y, W, H;
632  bbox(X, Y, W, H);
633 
634  switch(pos) {
635  case TOP: break;
636  case BOTTOM: final -= H; break;
637  case MIDDLE: final -= H/2; break;
638  }
639 
640  if (final > (full_height() - H)) final = full_height() -H;
641  position(final);
642 }
643 
649 int Fl_Browser::topline() const {
650  return lineno(top());
651 }
652 
670  if (newSize == textsize())
671  return; // avoid recalculation
672  Fl_Browser_::textsize(newSize);
673  new_list();
674  full_height_ = 0;
675  if (lines == 0) return;
676  for (FL_BLINE* itm=(FL_BLINE *)item_first(); itm; itm=(FL_BLINE *)item_next(itm)) {
677  full_height_ += item_height(itm);
678  }
679 }
680 
686  for (FL_BLINE* l = first; l;) {
687  FL_BLINE* n = l->next;
688  free(l);
689  l = n;
690  }
691  full_height_ = 0;
692  first = 0;
693  last = 0;
694  lines = 0;
695  new_list();
696 }
697 
710 void Fl_Browser::add(const char* newtext, void* d) {
711  insert(lines+1, newtext, d);
712  //Fl_Browser_::display(last);
713 }
714 
722 const char* Fl_Browser::text(int line) const {
723  if (line < 1 || line > lines) return 0;
724  return find_line(line)->txt;
725 }
726 
735 void* Fl_Browser::data(int line) const {
736  if (line < 1 || line > lines) return 0;
737  return find_line(line)->data;
738 }
739 
748 int Fl_Browser::select(int line, int val) {
749  if (line < 1 || line > lines) return 0;
750  return Fl_Browser_::select(find_line(line), val);
751 }
752 
759 int Fl_Browser::selected(int line) const {
760  if (line < 1 || line > lines) return 0;
761  return find_line(line)->flags & SELECTED;
762 }
763 
772 void Fl_Browser::show(int line) {
773  FL_BLINE* t = find_line(line);
774  if (t->flags & NOTDISPLAYED) {
775  t->flags &= ~NOTDISPLAYED;
777  if (Fl_Browser_::displayed(t)) redraw();
778  }
779 }
780 
790 void Fl_Browser::hide(int line) {
791  FL_BLINE* t = find_line(line);
792  if (!(t->flags & NOTDISPLAYED)) {
794  t->flags |= NOTDISPLAYED;
795  if (Fl_Browser_::displayed(t)) redraw();
796  }
797 }
798 
805 void Fl_Browser::display(int line, int val) {
806  if (line < 1 || line > lines) return;
807  if (val) show(line); else hide(line);
808 }
809 
816 int Fl_Browser::visible(int line) const {
817  if (line < 1 || line > lines) return 0;
818  return !(find_line(line)->flags&NOTDISPLAYED);
819 }
820 
826 int Fl_Browser::value() const {
827  return lineno(selection());
828 }
829 
837 
838  if ( a == b || !a || !b) return; // nothing to do
839  swapping(a, b);
840  FL_BLINE *aprev = a->prev;
841  FL_BLINE *anext = a->next;
842  FL_BLINE *bprev = b->prev;
843  FL_BLINE *bnext = b->next;
844  if ( b->prev == a ) { // A ADJACENT TO B
845  if ( aprev ) aprev->next = b; else first = b;
846  b->next = a;
847  a->next = bnext;
848  b->prev = aprev;
849  a->prev = b;
850  if ( bnext ) bnext->prev = a; else last = a;
851  } else if ( a->prev == b ) { // B ADJACENT TO A
852  if ( bprev ) bprev->next = a; else first = a;
853  a->next = b;
854  b->next = anext;
855  a->prev = bprev;
856  b->prev = a;
857  if ( anext ) anext->prev = b; else last = b;
858  } else { // A AND B NOT ADJACENT
859  // handle prev's
860  b->prev = aprev;
861  if ( anext ) anext->prev = b; else last = b;
862  a->prev = bprev;
863  if ( bnext ) bnext->prev = a; else last = a;
864  // handle next's
865  if ( aprev ) aprev->next = b; else first = b;
866  b->next = anext;
867  if ( bprev ) bprev->next = a; else first = a;
868  a->next = bnext;
869  }
870  // Disable cache -- we played around with positions
871  cacheline = 0;
872  cache = 0;
873 }
874 
881 void Fl_Browser::swap(int a, int b) {
882  if (a < 1 || a > lines || b < 1 || b > lines) return;
883  FL_BLINE* ai = find_line(a);
884  FL_BLINE* bi = find_line(b);
885  swap(ai,bi);
886 }
887 
896 void Fl_Browser::icon(int line, Fl_Image* icon) {
897 
898  if (line<1 || line > lines) return;
899 
900  FL_BLINE* bl = find_line(line);
901 
902  int old_h = bl->icon ? bl->icon->h()+2 : 0; // init with *old* icon height
903  bl->icon = 0; // remove icon, if any
904  int th = item_height(bl); // height of text only
905  int new_h = icon ? icon->h()+2 : 0; // init with *new* icon height
906  if (th > old_h) old_h = th;
907  if (th > new_h) new_h = th;
908  int dh = new_h - old_h;
909  full_height_ += dh; // do this *always*
910 
911  bl->icon = icon; // set new icon
912  if (dh>0) {
913  redraw(); // icon larger than item? must redraw widget
914  } else {
915  redraw_line(bl); // icon same or smaller? can redraw just this line
916  }
917  replacing(bl,bl); // recalc Fl_Browser_::max_width et al
918 }
919 
926 Fl_Image* Fl_Browser::icon(int line) const {
927  FL_BLINE* l = find_line(line);
928  return(l ? l->icon : NULL);
929 }
930 
936 void Fl_Browser::remove_icon(int line) {
937  icon(line,0);
938 }
939 
940 
941 Fl_Hold_Browser::Fl_Hold_Browser(int X,int Y,int W,int H,const char *L)
942 : Fl_Browser(X,Y,W,H,L)
943 {
945 }
946 
947 
948 Fl_Multi_Browser::Fl_Multi_Browser(int X,int Y,int W,int H,const char *L)
949 : Fl_Browser(X,Y,W,H,L)
950 {
952 }
953 
954 
955 Fl_Select_Browser::Fl_Select_Browser(int X,int Y,int W,int H,const char *L)
956 : Fl_Browser(X,Y,W,H,L)
957 {
959 }
960 
961 
962 //
963 // End of "$Id$".
964 //
Fl_Multi_Browser::Fl_Multi_Browser
Fl_Multi_Browser(int X, int Y, int W, int H, const char *L=0)
Definition: Fl_Browser.cxx:948
fl_font
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Definition: fl_draw.H:509
FL_HOLD_BROWSER
#define FL_HOLD_BROWSER
Definition: Fl_Browser_.H:35
fl_width
FL_EXPORT double fl_width(const char *txt)
Definition: fl_font.cxx:65
FL_ALIGN_LEFT
const Fl_Align FL_ALIGN_LEFT
Definition: Enumerations.H:839
Fl_Browser_::select
int select(void *item, int val=1, int docallbacks=0)
Definition: Fl_Browser_.cxx:608
Fl_Browser::item_select
void item_select(void *item, int val)
Definition: Fl_Browser.cxx:117
Fl.H
Fl_Browser::MIDDLE
Definition: Fl_Browser.H:157
fl_line
void fl_line(int x, int y, int x1, int y1)
Definition: fl_draw.H:223
fl_rectf
void fl_rectf(int x, int y, int w, int h)
Definition: fl_draw.H:206
Fl_Color
unsigned int Fl_Color
Definition: Enumerations.H:934
Fl_Browser::hide
void hide()
Definition: Fl_Browser.H:188
Fl_Select_Browser.H
Fl_Browser_::bbox
void bbox(int &X, int &Y, int &W, int &H) const
Definition: Fl_Browser_.cxx:68
Fl_Browser::textsize
Fl_Fontsize textsize() const
Definition: Fl_Browser.H:147
Fl_Browser_::swapping
void swapping(void *a, void *b)
Definition: Fl_Browser_.cxx:553
FL_ITALIC
const Fl_Font FL_ITALIC
add this to helvetica, courier, or times
Definition: Enumerations.H:898
Fl_Image::h
void h(int H)
Definition: Fl_Image.H:80
Fl_Browser_::deleting
void deleting(void *item)
Definition: Fl_Browser_.cxx:510
FL_INACTIVE_COLOR
const Fl_Color FL_INACTIVE_COLOR
the inactive foreground color
Definition: Enumerations.H:939
Fl_Image
Base class for image caching and drawing.
Definition: Fl_Image.H:55
Fl_Browser::column_widths_
const int * column_widths_
Definition: Fl_Browser.H:88
Fl_Browser::item_width
int item_width(void *item) const
Definition: Fl_Browser.cxx:423
fl_color
void fl_color(Fl_Color c)
Definition: fl_draw.H:52
Fl_Browser::column_char
char column_char() const
Definition: Fl_Browser.H:250
FL_BLINE::next
FL_BLINE * next
Definition: Fl_Browser.cxx:50
Fl_Browser::insert
void insert(int line, FL_BLINE *item)
Definition: Fl_Browser.cxx:243
free
void free()
Fl_Browser::show
void show()
Definition: Fl_Browser.H:185
H
static int H
Definition: Fl_Tooltip.cxx:76
Fl_Browser::remove_icon
void remove_icon(int line)
Definition: Fl_Browser.cxx:936
Fl_Browser::Fl_Browser
Fl_Browser(int X, int Y, int W, int H, const char *L=0)
Definition: Fl_Browser.cxx:603
fl_height
int fl_height()
Definition: fl_draw.H:527
Fl_Browser::value
int value() const
Definition: Fl_Browser.cxx:826
NULL
#define NULL
Definition: forms.H:34
FL_COURIER
const Fl_Font FL_COURIER
Courier normal.
Definition: Enumerations.H:883
fl_draw
FL_EXPORT void fl_draw(const char *str, int x, int y)
Definition: fl_font.cxx:70
Fl_Browser::full_height
int full_height() const
Definition: Fl_Browser.cxx:484
Fl_Browser::remove
void remove(int line)
Definition: Fl_Browser.cxx:229
no_columns
static const int no_columns[1]
Definition: Fl_Browser.cxx:596
Fl_Browser_::displayed
int displayed(void *item) const
Definition: Fl_Browser_.cxx:228
fl_contrast
Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg)
Definition: fl_color.cxx:435
Fl_Browser::swap
void swap(FL_BLINE *a, FL_BLINE *b)
Definition: Fl_Browser.cxx:836
NOTDISPLAYED
#define NOTDISPLAYED
Definition: Fl_Browser.cxx:41
Fl_Browser
Definition: Fl_Browser.H:80
Fl_Image::w
void w(int W)
Definition: Fl_Image.H:76
Fl_Hold_Browser.H
b
long b
Definition: jpegint.h:397
Fl_Browser::icon
void icon(int line, Fl_Image *icon)
Definition: Fl_Browser.cxx:896
Fl_Browser::item_height
int item_height(void *item) const
Definition: Fl_Browser.cxx:363
bi
static int bi
Definition: fl_draw_image.cxx:68
icon
static Fl_Box * icon
Definition: fl_ask.cxx:48
Fl_Browser::format_char_
char format_char_
Definition: Fl_Browser.H:89
Fl_Browser_::textsize
Fl_Fontsize textsize() const
Definition: Fl_Browser_.H:301
Fl_Browser::topline
int topline() const
Definition: Fl_Browser.cxx:649
math.h
Fl_Browser::text
const char * text(int line) const
Definition: Fl_Browser.cxx:722
FL_BLINE::length
short length
Definition: Fl_Browser.cxx:53
p
static menustate * p
Definition: Fl_Menu.cxx:606
Fl_Widget::selection_color
Fl_Color selection_color() const
Definition: Fl_Widget.H:396
Fl_Browser::TOP
Definition: Fl_Browser.H:157
FL_BLINE::txt
char txt[1]
Definition: Fl_Browser.cxx:55
FL_MULTI_BROWSER
#define FL_MULTI_BROWSER
Definition: Fl_Browser_.H:36
FL_BLINE::icon
Fl_Image * icon
Definition: Fl_Browser.cxx:52
Fl_Browser::format_char
char format_char() const
Definition: Fl_Browser.H:238
fl_draw.H
utility header to pull drawing functions together
Fl_Widget::flags
unsigned int flags() const
Definition: Fl_Widget.H:147
Fl_Browser.H
Fl_Browser::selected
int selected(int line) const
Definition: Fl_Browser.cxx:759
fl_inactive
Fl_Color fl_inactive(Fl_Color c)
Definition: fl_color.cxx:423
Fl_Widget::active_r
int active_r() const
Definition: Fl_Widget.cxx:265
Fl_Browser::lineno
int lineno(void *item) const
Definition: Fl_Browser.cxx:171
Fl_Browser::item_next
void * item_next(void *item) const
Definition: Fl_Browser.cxx:78
Fl_Browser::item_last
void * item_last() const
Definition: Fl_Browser.cxx:100
Fl_Select_Browser::Fl_Select_Browser
Fl_Select_Browser(int X, int Y, int W, int H, const char *L=0)
Definition: Fl_Browser.cxx:955
Fl_Widget::visible
unsigned int visible() const
Definition: Fl_Widget.H:660
Fl_Browser::first
FL_BLINE * first
Definition: Fl_Browser.H:82
Fl_Browser::full_height_
int full_height_
Definition: Fl_Browser.H:87
FL_BLINE::flags
char flags
Definition: Fl_Browser.cxx:54
Fl_Browser::item_prev
void * item_prev(void *item) const
Definition: Fl_Browser.cxx:86
Fl_Fontsize
int Fl_Fontsize
Definition: Enumerations.H:906
Fl_Browser::Fl_Line_Position
Fl_Line_Position
Definition: Fl_Browser.H:157
Fl_Browser::incr_height
int incr_height() const
Definition: Fl_Browser.cxx:495
Fl_Browser_::new_list
void new_list()
Definition: Fl_Browser_.cxx:490
Fl_Widget::redraw
void redraw()
Definition: Fl.cxx:1782
FL_LIGHT3
const Fl_Color FL_LIGHT3
Definition: Enumerations.H:952
Fl_Browser_
Definition: Fl_Browser_.H:77
FL_BLINE::data
void * data
Definition: Fl_Browser.cxx:51
Fl_Browser::item_first
void * item_first() const
Definition: Fl_Browser.cxx:70
Fl_Browser::lines
int lines
Definition: Fl_Browser.H:86
Fl_Browser::item_text
const char * item_text(void *item) const
Definition: Fl_Browser.cxx:127
Fl_Browser_::position
int position() const
Definition: Fl_Browser_.H:229
Fl_Browser::last
FL_BLINE * last
Definition: Fl_Browser.H:83
Fl_Browser_::inserting
void inserting(void *a, void *b)
Definition: Fl_Browser_.cxx:572
FL_BOLD
const Fl_Font FL_BOLD
add this to helvetica, courier, or times
Definition: Enumerations.H:897
Fl_Browser::item_selected
int item_selected(void *item) const
Definition: Fl_Browser.cxx:108
Fl_Browser_::top
void * top() const
Definition: Fl_Browser_.H:177
Fl_Image::draw
virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0)
Definition: Fl_Image.cxx:66
Fl_Font
int Fl_Font
Definition: Enumerations.H:877
Fl_Browser_::redraw_line
void redraw_line(void *item)
Definition: Fl_Browser_.cxx:126
Fl_Browser_::selection
void * selection() const
Definition: Fl_Browser_.H:185
Fl_Browser::display
void display(int line, int val=1)
Definition: Fl_Browser.cxx:805
Fl_Browser::add
void add(const char *newtext, void *d=0)
Definition: Fl_Browser.cxx:710
FL_ALIGN_CENTER
const Fl_Align FL_ALIGN_CENTER
Definition: Enumerations.H:830
Fl_Browser::find_line
FL_BLINE * find_line(int line) const
Definition: Fl_Browser.cxx:147
Fl_Browser::_remove
FL_BLINE * _remove(int line)
Definition: Fl_Browser.cxx:206
Fl_Browser::column_widths
const int * column_widths() const
Definition: Fl_Browser.H:281
Fl_Browser::lineposition
void lineposition(int line, Fl_Line_Position pos)
Definition: Fl_Browser.cxx:620
Fl_Browser::BOTTOM
Definition: Fl_Browser.H:157
Fl_Widget::type
uchar type() const
Definition: Fl_Widget.H:274
f
Fl_Box_Draw_F * f
Definition: fl_boxtype.cxx:285
malloc
voidp malloc()
FL_BLINE::prev
FL_BLINE * prev
Definition: Fl_Browser.cxx:49
FL_SELECT_BROWSER
#define FL_SELECT_BROWSER
Definition: Fl_Browser_.H:34
Y
static int Y
Definition: Fl_Tooltip.cxx:76
flstring.h
Fl_Browser_::textfont
Fl_Font textfont() const
Definition: Fl_Browser_.H:292
Fl_Browser_::replacing
void replacing(void *a, void *b)
Definition: Fl_Browser_.cxx:538
Fl_Multi_Browser.H
Fl_Browser::clear
void clear()
Definition: Fl_Browser.cxx:685
Fl_Browser::move
void move(int to, int from)
Definition: Fl_Browser.cxx:304
Fl_Browser::data
void * data(int line) const
Definition: Fl_Browser.cxx:735
FL_ALIGN_RIGHT
const Fl_Align FL_ALIGN_RIGHT
Definition: Enumerations.H:841
Fl_Browser::cache
FL_BLINE * cache
Definition: Fl_Browser.H:84
Fl_Browser::select
int select(int line, int val=1)
Definition: Fl_Browser.cxx:748
Fl_Align
unsigned Fl_Align
Definition: Enumerations.H:828
Fl_Hold_Browser::Fl_Hold_Browser
Fl_Hold_Browser(int X, int Y, int W, int H, const char *L=0)
Definition: Fl_Browser.cxx:941
Fl_Browser_::textcolor
Fl_Color textcolor() const
Definition: Fl_Browser_.H:310
dh
uchar dh
Definition: fl_boxtype.cxx:286
FL_BLINE
Definition: Fl_Browser.cxx:48
Fl_Browser::item_draw
void item_draw(void *item, int X, int Y, int W, int H) const
Definition: Fl_Browser.cxx:506
Fl_Browser::column_char_
char column_char_
Definition: Fl_Browser.H:90
SELECTED
#define SELECTED
Definition: Fl_Browser.cxx:40
FL_ALIGN_CLIP
const Fl_Align FL_ALIGN_CLIP
Definition: Enumerations.H:849
Fl_Browser::cacheline
int cacheline
Definition: Fl_Browser.H:85
FL_DARK3
const Fl_Color FL_DARK3
Definition: Enumerations.H:946