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_Group.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Group widget for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2010 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 // The Fl_Group is the only defined container type in FLTK.
20 
21 // Fl_Window itself is a subclass of this, and most of the event
22 // handling is designed so windows themselves work correctly.
23 
24 #include <stdio.h>
25 #include <FL/Fl.H>
26 #include <FL/Fl_Group.H>
27 #include <FL/Fl_Window.H>
28 #include <FL/fl_draw.H>
29 #include <stdlib.h>
30 
31 #include <FL/Fl_Input_Choice.H>
32 #include <FL/Fl_Spinner.H>
33 
34 
36 
37 // Hack: A single child is stored in the pointer to the array, while
38 // multiple children are stored in an allocated array:
39 
44 Fl_Widget*const* Fl_Group::array() const {
45  return children_ <= 1 ? (Fl_Widget**)(&array_) : array_;
46 }
47 
52 int Fl_Group::find(const Fl_Widget* o) const {
53  Fl_Widget*const* a = array();
54  int i; for (i=0; i < children_; i++) if (*a++ == o) break;
55  return i;
56 }
57 
58 // Metrowerks CodeWarrior and others can't export the static
59 // class member: current_, so these methods can't be inlined...
60 
69 void Fl_Group::begin() {current_ = this;}
70 
76 
85 
91 
92 extern Fl_Widget* fl_oldfocus; // set by Fl::focus
93 
94 // For back-compatibility, we must adjust all events sent to child
95 // windows so they are relative to that window.
96 
97 static int send(Fl_Widget* o, int event) {
98  if (o->type() < FL_WINDOW) return o->handle(event);
99  switch ( event )
100  {
101  case FL_DND_ENTER: /* FALLTHROUGH */
102  case FL_DND_DRAG:
103  // figure out correct type of event:
104  event = (o->contains(Fl::belowmouse())) ? FL_DND_DRAG : FL_DND_ENTER;
105  }
106  int save_x = Fl::e_x; Fl::e_x -= o->x();
107  int save_y = Fl::e_y; Fl::e_y -= o->y();
108  int ret = o->handle(event);
109  Fl::e_y = save_y;
110  Fl::e_x = save_x;
111  switch ( event )
112  {
113  case FL_ENTER: /* FALLTHROUGH */
114  case FL_DND_ENTER:
115  // Successful completion of FL_ENTER means the widget is now the
116  // belowmouse widget, but only call Fl::belowmouse if the child
117  // widget did not do so:
118  if (!o->contains(Fl::belowmouse())) Fl::belowmouse(o);
119  break;
120  }
121  return ret;
122 }
123 
124 // translate the current keystroke into up/down/left/right for navigation:
125 static int navkey() {
126  // The app may want these for hotkeys, check key state
127  if (Fl::event_state(FL_CTRL | FL_ALT | FL_META)) return 0;
128 
129  switch (Fl::event_key()) {
130  case 0: // not an FL_KEYBOARD/FL_SHORTCUT event
131  break;
132  case FL_Tab:
133  if (!Fl::event_state(FL_SHIFT)) return FL_Right;
134  return FL_Left;
135  case FL_Right:
136  return FL_Right;
137  case FL_Left:
138  return FL_Left;
139  case FL_Up:
140  return FL_Up;
141  case FL_Down:
142  return FL_Down;
143  }
144  return 0;
145 }
146 
147 int Fl_Group::handle(int event) {
148 
149  Fl_Widget*const* a = array();
150  int i;
151  Fl_Widget* o;
152 
153  switch (event) {
154 
155  case FL_FOCUS:
156  switch (navkey()) {
157  default:
158  if (savedfocus_ && savedfocus_->take_focus()) return 1;
159  case FL_Right:
160  case FL_Down:
161  for (i = children(); i--;) if ((*a++)->take_focus()) return 1;
162  break;
163  case FL_Left:
164  case FL_Up:
165  for (i = children(); i--;) if (a[i]->take_focus()) return 1;
166  break;
167  }
168  return 0;
169 
170  case FL_UNFOCUS:
172  return 0;
173 
174  case FL_KEYBOARD:
175  return navigation(navkey());
176 
177  case FL_SHORTCUT:
178  for (i = children(); i--;) {
179  o = a[i];
180  if (o->takesevents() && Fl::event_inside(o) && send(o,FL_SHORTCUT))
181  return 1;
182  }
183  for (i = children(); i--;) {
184  o = a[i];
185  if (o->takesevents() && !Fl::event_inside(o) && send(o,FL_SHORTCUT))
186  return 1;
187  }
189  return 0;
190 
191  case FL_ENTER:
192  case FL_MOVE:
193  for (i = children(); i--;) {
194  o = a[i];
195  if (o->visible() && Fl::event_inside(o)) {
196  if (o->contains(Fl::belowmouse())) {
197  return send(o,FL_MOVE);
198  } else {
199  Fl::belowmouse(o);
200  if (send(o,FL_ENTER)) return 1;
201  }
202  }
203  }
204  Fl::belowmouse(this);
205  return 1;
206 
207  case FL_DND_ENTER:
208  case FL_DND_DRAG:
209  for (i = children(); i--;) {
210  o = a[i];
211  if (o->takesevents() && Fl::event_inside(o)) {
212  if (o->contains(Fl::belowmouse())) {
213  return send(o,FL_DND_DRAG);
214  } else if (send(o,FL_DND_ENTER)) {
215  if (!o->contains(Fl::belowmouse())) Fl::belowmouse(o);
216  return 1;
217  }
218  }
219  }
220  Fl::belowmouse(this);
221  return 0;
222 
223  case FL_PUSH:
224  for (i = children(); i--;) {
225  o = a[i];
226  if (o->takesevents() && Fl::event_inside(o)) {
227  Fl_Widget_Tracker wp(o);
228  if (send(o,FL_PUSH)) {
229  if (Fl::pushed() && wp.exists() && !o->contains(Fl::pushed())) Fl::pushed(o);
230  return 1;
231  }
232  }
233  }
234  return 0;
235 
236  case FL_RELEASE:
237  case FL_DRAG:
238  o = Fl::pushed();
239  if (o == this) return 0;
240  else if (o) send(o,event);
241  else {
242  for (i = children(); i--;) {
243  o = a[i];
244  if (o->takesevents() && Fl::event_inside(o)) {
245  if (send(o,event)) return 1;
246  }
247  }
248  }
249  return 0;
250 
251  case FL_MOUSEWHEEL:
252  for (i = children(); i--;) {
253  o = a[i];
254  if (o->takesevents() && Fl::event_inside(o) && send(o,FL_MOUSEWHEEL))
255  return 1;
256  }
257  for (i = children(); i--;) {
258  o = a[i];
259  if (o->takesevents() && !Fl::event_inside(o) && send(o,FL_MOUSEWHEEL))
260  return 1;
261  }
262  return 0;
263 
264  case FL_DEACTIVATE:
265  case FL_ACTIVATE:
266  for (i = children(); i--;) {
267  o = *a++;
268  if (o->active()) o->handle(event);
269  }
270  return 1;
271 
272  case FL_SHOW:
273  case FL_HIDE:
274  for (i = children(); i--;) {
275  o = *a++;
276  if (event == FL_HIDE && o == Fl::focus()) {
277  // Give up input focus...
278  int old_event = Fl::e_number;
280  Fl::e_number = old_event;
281  Fl::focus(0);
282  }
283  if (o->visible()) o->handle(event);
284  }
285  return 1;
286 
287  default:
288  // For all other events, try to give to each child, starting at focus:
289  for (i = 0; i < children(); i ++)
290  if (Fl::focus_ == a[i]) break;
291 
292  if (i >= children()) i = 0;
293 
294  if (children()) {
295  for (int j = i;;) {
296  if (a[j]->takesevents()) if (send(a[j], event)) return 1;
297  j++;
298  if (j >= children()) j = 0;
299  if (j == i) break;
300  }
301  }
302 
303  return 0;
304  }
305 }
306 
307 //void Fl_Group::focus(Fl_Widget *o) {Fl::focus(o); o->handle(FL_FOCUS);}
308 
309 #if 0
310 const char *nameof(Fl_Widget *o) {
311  if (!o) return "NULL";
312  if (!o->label()) return "<no label>";
313  return o->label();
314 }
315 #endif
316 
317 // try to move the focus in response to a keystroke:
319  if (children() <= 1) return 0;
320  int i;
321  for (i = 0; ; i++) {
322  if (i >= children_) return 0;
323  if (array_[i]->contains(Fl::focus())) break;
324  }
325  Fl_Widget *previous = array_[i];
326 
327  for (;;) {
328  switch (key) {
329  case FL_Right:
330  case FL_Down:
331  i++;
332  if (i >= children_) {
333  if (parent()) return 0;
334  i = 0;
335  }
336  break;
337  case FL_Left:
338  case FL_Up:
339  if (i) i--;
340  else {
341  if (parent()) return 0;
342  i = children_-1;
343  }
344  break;
345  default:
346  return 0;
347  }
348  Fl_Widget* o = array_[i];
349  if (o == previous) return 0;
350  switch (key) {
351  case FL_Down:
352  case FL_Up:
353  // for up/down, the widgets have to overlap horizontally:
354  if (o->x() >= previous->x()+previous->w() ||
355  o->x()+o->w() <= previous->x()) continue;
356  }
357  if (o->take_focus()) return 1;
358  }
359 }
360 
362 
363 Fl_Group::Fl_Group(int X,int Y,int W,int H,const char *l)
364 : Fl_Widget(X,Y,W,H,l) {
366  children_ = 0;
367  array_ = 0;
368  savedfocus_ = 0;
369  resizable_ = this;
370  sizes_ = 0; // this is allocated when first resize() is done
371  // Subclasses may want to construct child objects as part of their
372  // constructor, so make sure they are add()'d to this object.
373  // But you must end() the object!
374  begin();
375 }
376 
384  savedfocus_ = 0;
385  resizable_ = this;
386  init_sizes();
387 
388  // we must change the Fl::pushed() widget, if it is one of
389  // the group's children. Otherwise fl_fix_focus() would send
390  // lots of events to children that are about to be deleted
391  // anyway.
392 
393  Fl_Widget *pushed = Fl::pushed(); // save pushed() widget
394  if (contains(pushed)) pushed = this; // set it to be the group, if it's a child
395  Fl::pushed(this); // for fl_fix_focus etc.
396 
397  // okay, now it is safe to destroy the children:
398 
399 #define REVERSE_CHILDREN
400 #ifdef REVERSE_CHILDREN
401  // Reverse the order of the children. Doing this and deleting
402  // always the last child is much faster than the other way around.
403  if (children_ > 1) {
404  Fl_Widget *temp;
405  Fl_Widget **a = (Fl_Widget**)array();
406  for (int i=0,j=children_-1; i<children_/2; i++,j--) {
407  temp = a[i];
408  a[i] = a[j];
409  a[j] = temp;
410  }
411  }
412 #endif // REVERSE_CHILDREN
413 
414  while (children_) { // delete all children
415  int idx = children_-1; // last child's index
416  Fl_Widget* w = child(idx); // last child widget
417  if (w->parent()==this) { // should always be true
418  if (children_>2) { // optimized removal
419  w->parent_ = 0; // reset child's parent
420  children_--; // update counter
421  } else { // slow removal
422  remove(idx);
423  }
424  delete w; // delete the child
425  } else { // should never happen
426  remove(idx); // remove it anyway
427  }
428  }
429 
430  if (pushed != this) Fl::pushed(pushed); // reset pushed() widget
431 
432 }
433 
449  clear();
450 }
451 
458 void Fl_Group::insert(Fl_Widget &o, int index) {
459  if (o.parent()) {
460  Fl_Group* g = o.parent();
461  int n = g->find(o);
462  if (g == this) {
463  if (index > n) index--;
464  if (index == n) return;
465  }
466  g->remove(n);
467  }
468  o.parent_ = this;
469  if (children_ == 0) { // use array pointer to point at single child
470  array_ = (Fl_Widget**)&o;
471  } else if (children_ == 1) { // go from 1 to 2 children
472  Fl_Widget* t = (Fl_Widget*)array_;
473  array_ = (Fl_Widget**)malloc(2*sizeof(Fl_Widget*));
474  if (index) {array_[0] = t; array_[1] = &o;}
475  else {array_[0] = &o; array_[1] = t;}
476  } else {
477  if (!(children_ & (children_-1))) // double number of children
478  array_ = (Fl_Widget**)realloc((void*)array_,
479  2*children_*sizeof(Fl_Widget*));
480  int j; for (j = children_; j > index; j--) array_[j] = array_[j-1];
481  array_[j] = &o;
482  }
483  children_++;
484  init_sizes();
485 }
486 
492 
503 void Fl_Group::remove(int index) {
504  if (index < 0 || index >= children_) return;
505  Fl_Widget &o = *child(index);
506  if (&o == savedfocus_) savedfocus_ = 0;
507  if (o.parent_ == this) { // this should always be true
508  o.parent_ = 0;
509  }
510 
511  // remove the widget from the group
512 
513  children_--;
514  if (children_ == 1) { // go from 2 to 1 child
515  Fl_Widget *t = array_[!index];
516  free((void*)array_);
517  array_ = (Fl_Widget**)t;
518  } else if (children_ > 1) { // delete from array
519  for (; index < children_; index++) array_[index] = array_[index+1];
520  }
521  init_sizes();
522 }
523 
538  if (!children_) return;
539  int i = find(o);
540  if (i < children_) remove(i);
541 }
542 
544 
545 // Rather lame kludge here, I need to detect windows and ignore the
546 // changes to X,Y, since all children are relative to X,Y. That
547 // is why I check type():
548 
549 // sizes array stores the initial positions of widgets as
550 // left,right,top,bottom quads. The first quad is the group, the
551 // second is the resizable (clipped to the group), and the
552 // rest are the children. This is a convenient order for the
553 // algorithm. If you change this be sure to fix Fl_Tile which
554 // also uses this array!
555 
573  delete[] sizes_; sizes_ = 0;
574 }
575 
591  if (!sizes_) {
592  int* p = sizes_ = new int[4*(children_+2)];
593  // first thing in sizes array is the group's size:
594  if (type() < FL_WINDOW) {p[0] = x(); p[2] = y();} else {p[0] = p[2] = 0;}
595  p[1] = p[0]+w(); p[3] = p[2]+h();
596  // next is the resizable's size:
597  p[4] = p[0]; // init to the group's size
598  p[5] = p[1];
599  p[6] = p[2];
600  p[7] = p[3];
601  Fl_Widget* r = resizable();
602  if (r && r != this) { // then clip the resizable to it
603  int t;
604  t = r->x(); if (t > p[0]) p[4] = t;
605  t +=r->w(); if (t < p[1]) p[5] = t;
606  t = r->y(); if (t > p[2]) p[6] = t;
607  t +=r->h(); if (t < p[3]) p[7] = t;
608  }
609  // next is all the children's sizes:
610  p += 8;
611  Fl_Widget*const* a = array();
612  for (int i=children_; i--;) {
613  Fl_Widget* o = *a++;
614  *p++ = o->x();
615  *p++ = o->x()+o->w();
616  *p++ = o->y();
617  *p++ = o->y()+o->h();
618  }
619  }
620  return sizes_;
621 }
622 
634 void Fl_Group::resize(int X, int Y, int W, int H) {
635 
636  int dx = X-x();
637  int dy = Y-y();
638  int dw = W-w();
639  int dh = H-h();
640 
641  int *p = sizes(); // save initial sizes and positions
642 
643  Fl_Widget::resize(X,Y,W,H); // make new xywh values visible for children
644 
645  if (!resizable() || (dw==0 && dh==0) ) {
646 
647  if (type() < FL_WINDOW) {
648  Fl_Widget*const* a = array();
649  for (int i=children_; i--;) {
650  Fl_Widget* o = *a++;
651  o->resize(o->x()+dx, o->y()+dy, o->w(), o->h());
652  }
653  }
654 
655  } else if (children_) {
656 
657  // get changes in size/position from the initial size:
658  dx = X - p[0];
659  dw = W - (p[1]-p[0]);
660  dy = Y - p[2];
661  dh = H - (p[3]-p[2]);
662  if (type() >= FL_WINDOW) dx = dy = 0;
663  p += 4;
664 
665  // get initial size of resizable():
666  int IX = *p++;
667  int IR = *p++;
668  int IY = *p++;
669  int IB = *p++;
670 
671  Fl_Widget*const* a = array();
672  for (int i=children_; i--;) {
673  Fl_Widget* o = *a++;
674 #if 1
675  int XX = *p++;
676  if (XX >= IR) XX += dw;
677  else if (XX > IX) XX = IX+((XX-IX)*(IR+dw-IX)+(IR-IX)/2)/(IR-IX);
678  int R = *p++;
679  if (R >= IR) R += dw;
680  else if (R > IX) R = IX+((R-IX)*(IR+dw-IX)+(IR-IX)/2)/(IR-IX);
681 
682  int YY = *p++;
683  if (YY >= IB) YY += dh;
684  else if (YY > IY) YY = IY+((YY-IY)*(IB+dh-IY)+(IB-IY)/2)/(IB-IY);
685  int B = *p++;
686  if (B >= IB) B += dh;
687  else if (B > IY) B = IY+((B-IY)*(IB+dh-IY)+(IB-IY)/2)/(IB-IY);
688 #else // much simpler code from Francois Ostiguy:
689  int XX = *p++;
690  if (XX >= IR) XX += dw;
691  else if (XX > IX) XX += dw * (XX-IX)/(IR-IX);
692  int R = *p++;
693  if (R >= IR) R += dw;
694  else if (R > IX) R = R + dw * (R-IX)/(IR-IX);
695 
696  int YY = *p++;
697  if (YY >= IB) YY += dh;
698  else if (YY > IY) YY = YY + dh*(YY-IY)/(IB-IY);
699  int B = *p++;
700  if (B >= IB) B += dh;
701  else if (B > IY) B = B + dh*(B-IY)/(IB-IY);
702 #endif
703  o->resize(XX+dx, YY+dy, R-XX, B-YY);
704  }
705  }
706 }
707 
716  Fl_Widget*const* a = array();
717 
718  if (clip_children()) {
719  fl_push_clip(x() + Fl::box_dx(box()),
720  y() + Fl::box_dy(box()),
721  w() - Fl::box_dw(box()),
722  h() - Fl::box_dh(box()));
723  }
724 
725  if (damage() & ~FL_DAMAGE_CHILD) { // redraw the entire thing:
726  for (int i=children_; i--;) {
727  Fl_Widget& o = **a++;
728  draw_child(o);
730  }
731  } else { // only redraw the children that need it:
732  for (int i=children_; i--;) update_child(**a++);
733  }
734 
735  if (clip_children()) fl_pop_clip();
736 }
737 
739  if (damage() & ~FL_DAMAGE_CHILD) { // redraw the entire thing:
740  draw_box();
741  draw_label();
742  }
743  draw_children();
744 }
745 
754 void Fl_Group::update_child(Fl_Widget& widget) const {
755  if (widget.damage() && widget.visible() && widget.type() < FL_WINDOW &&
756  fl_not_clipped(widget.x(), widget.y(), widget.w(), widget.h())) {
757  widget.draw();
758  widget.clear_damage();
759  }
760 }
761 
768 void Fl_Group::draw_child(Fl_Widget& widget) const {
769  if (widget.visible() && widget.type() < FL_WINDOW &&
770  fl_not_clipped(widget.x(), widget.y(), widget.w(), widget.h())) {
771  widget.clear_damage(FL_DAMAGE_ALL);
772  widget.draw();
773  widget.clear_damage();
774  }
775 }
776 
777 extern char fl_draw_shortcut;
778 
780 void Fl_Group::draw_outside_label(const Fl_Widget& widget) const {
781  if (!widget.visible()) return;
782  // skip any labels that are inside the widget:
783  if (!(widget.align()&15) || (widget.align() & FL_ALIGN_INSIDE)) return;
784  // invent a box that is outside the widget:
785  Fl_Align a = widget.align();
786  int X = widget.x();
787  int Y = widget.y();
788  int W = widget.w();
789  int H = widget.h();
790  int wx, wy;
791  if (const_cast<Fl_Group*>(this)->as_window()) {
792  wx = wy = 0;
793  } else {
794  wx = x(); wy = y();
795  }
796  if ( (a & 0x0f) == FL_ALIGN_LEFT_TOP ) {
797  a = (a &~0x0f ) | FL_ALIGN_TOP_RIGHT;
798  X = wx;
799  W = widget.x()-X-3;
800  } else if ( (a & 0x0f) == FL_ALIGN_LEFT_BOTTOM ) {
801  a = (a &~0x0f ) | FL_ALIGN_BOTTOM_RIGHT;
802  X = wx;
803  W = widget.x()-X-3;
804  } else if ( (a & 0x0f) == FL_ALIGN_RIGHT_TOP ) {
805  a = (a &~0x0f ) | FL_ALIGN_TOP_LEFT;
806  X = X+W+3;
807  W = wx+this->w()-X;
808  } else if ( (a & 0x0f) == FL_ALIGN_RIGHT_BOTTOM ) {
809  a = (a &~0x0f ) | FL_ALIGN_BOTTOM_LEFT;
810  X = X+W+3;
811  W = wx+this->w()-X;
812  } else if (a & FL_ALIGN_TOP) {
814  Y = wy;
815  H = widget.y()-Y;
816  } else if (a & FL_ALIGN_BOTTOM) {
818  Y = Y+H;
819  H = wy+h()-Y;
820  } else if (a & FL_ALIGN_LEFT) {
822  X = wx;
823  W = widget.x()-X-3;
824  } else if (a & FL_ALIGN_RIGHT) {
826  X = X+W+3;
827  W = wx+this->w()-X;
828  }
829  widget.draw_label(X,Y,W,H,(Fl_Align)a);
830 }
831 
832 
833 Fl_Input_Choice::Fl_Input_Choice (int X,int Y,int W,int H,const char*L)
834 : Fl_Group(X,Y,W,H,L)
835 {
837  align(FL_ALIGN_LEFT); // default like Fl_Input
838  inp_ = new Fl_Input(inp_x(), inp_y(),
839  inp_w(), inp_h());
840  inp_->callback(inp_cb, (void*)this);
841  inp_->box(FL_FLAT_BOX); // cosmetic
843  menu_ = new InputMenuButton(menu_x(), menu_y(),
844  menu_w(), menu_h());
845  menu_->callback(menu_cb, (void*)this);
846  menu_->box(FL_FLAT_BOX); // cosmetic
847  end();
848 }
849 
850 
851 Fl_Spinner::Fl_Spinner(int X, int Y, int W, int H, const char *L)
852 : Fl_Group(X, Y, W, H, L),
853  input_(X, Y, W - H / 2 - 2, H),
854  up_button_(X + W - H / 2 - 2, Y, H / 2 + 2, H / 2, "@-42<"),
855  down_button_(X + W - H / 2 - 2, Y + H - H / 2,
856  H / 2 + 2, H / 2, "@-42>")
857 {
858  end();
859 
860  value_ = 1.0;
861  minimum_ = 1.0;
862  maximum_ = 100.0;
863  step_ = 1.0;
864  format_ = "%g";
865 
867 
868  input_.value("1");
871  input_.callback((Fl_Callback *)sb_cb, this);
872 
874 
876 }
877 
878 
879 //
880 // End of "$Id$".
881 //
Fl_Widget::draw_label
void draw_label() const
Definition: fl_labeltype.cxx:99
Fl_Input_Choice::inp_h
int inp_h()
Definition: Fl_Input_Choice.H:167
fl_not_clipped
int fl_not_clipped(int x, int y, int w, int h)
Definition: fl_draw.H:114
Fl_Spinner::minimum_
double minimum_
Definition: Fl_Spinner.H:48
FL_Up
#define FL_Up
The up arrow key.
Definition: Enumerations.H:481
FL_ALIGN_LEFT
const Fl_Align FL_ALIGN_LEFT
Definition: Enumerations.H:839
Fl_Widget::y
int y() const
Definition: Fl_Widget.H:289
Fl_Group::resizable
Fl_Widget * resizable() const
Definition: Fl_Group.H:152
FL_Enter
#define FL_Enter
The enter key.
Definition: Enumerations.H:471
FL_DAMAGE_ALL
Definition: Enumerations.H:1112
Fl.H
Fl::e_y
static int e_y
Definition: Fl.H:145
Fl_Group::resizable_
Fl_Widget * resizable_
Definition: Fl_Group.H:45
Fl_Widget::align
Fl_Align align() const
Definition: Fl_Widget.H:348
FL_HIDE
Definition: Enumerations.H:369
FL_DND_ENTER
Definition: Enumerations.H:401
Fl_Group::insert
void insert(Fl_Widget &, int i)
Definition: Fl_Group.cxx:458
FL_META
#define FL_META
One of the meta/Windows keys is down.
Definition: Enumerations.H:563
Fl_Widget::draw_box
void draw_box() const
Definition: fl_boxtype.cxx:442
Fl_Input_Choice::menu_cb
static void menu_cb(Fl_Widget *, void *data)
Definition: Fl_Input_Choice.H:114
Fl_Group::find
int find(const Fl_Widget *) const
Definition: Fl_Group.cxx:52
Fl_Group::end
void end()
Definition: Fl_Group.cxx:75
Fl_Spinner.H
Fl_Group::sizes
int * sizes()
Definition: Fl_Group.cxx:590
FL_UNFOCUS
Definition: Enumerations.H:288
Fl_Group::array_
Fl_Widget ** array_
Definition: Fl_Group.H:43
Fl_Group::children_
int children_
Definition: Fl_Group.H:46
Fl_Group::Fl_Group
Fl_Group(const Fl_Group &)
Fl_Widget::takesevents
unsigned int takesevents() const
Definition: Fl_Widget.H:764
Fl::box_dx
static int box_dx(Fl_Boxtype)
Definition: fl_boxtype.cxx:360
Fl::event_state
static int event_state()
Definition: Fl.H:704
Fl_Spinner::sb_cb
static void sb_cb(Fl_Widget *w, Fl_Spinner *sb)
Definition: Fl_Spinner.H:63
Fl_Input_::value
int value(const char *)
Definition: Fl_Input_.cxx:1284
FL_WHEN_NOT_CHANGED
Do the callback whenever the user interacts with the widget.
Definition: Enumerations.H:442
Fl_Group::clear
void clear()
Definition: Fl_Group.cxx:383
FL_WHEN_RELEASE
Do the callback when the button or key is released and the value changes.
Definition: Enumerations.H:443
FL_DRAG
Definition: Enumerations.H:268
FL_SHIFT
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:557
Fl_Group::draw
void draw()
Definition: Fl_Group.cxx:738
free
void free()
Fl_Group::navigation
int navigation(int)
Definition: Fl_Group.cxx:318
H
static int H
Definition: Fl_Tooltip.cxx:76
FL_KP_Enter
#define FL_KP_Enter
The enter key on the keypad, same as Fl_KP+'\r'.
Definition: Enumerations.H:493
Fl_Widget::x
int x() const
Definition: Fl_Widget.H:284
Fl::e_number
static int e_number
Definition: Fl.H:143
Fl_Widget::when
Fl_When when() const
Definition: Fl_Widget.H:621
FL_WINDOW
#define FL_WINDOW
window type id all subclasses have type() >= this
Definition: Fl_Window.H:33
Fl::event_key
static int event_key()
Definition: Fl.H:723
Fl_Callback
void() Fl_Callback(Fl_Widget *, void *)
Definition: Fl_Widget.H:49
key
int key
Definition: Fl_Text_Editor.cxx:91
FL_ALIGN_BOTTOM_LEFT
const Fl_Align FL_ALIGN_BOTTOM_LEFT
Definition: Enumerations.H:860
Fl_Input_Choice::InputMenuButton
Definition: Fl_Input_Choice.H:97
Fl::box_dh
static int box_dh(Fl_Boxtype)
Definition: fl_boxtype.cxx:397
Fl_Widget::as_window
virtual Fl_Window * as_window()
Definition: Fl_Widget.H:1000
Fl_Widget::w
int w() const
Definition: Fl_Widget.H:294
FL_Down
#define FL_Down
The down arrow key.
Definition: Enumerations.H:483
FL_ALIGN_INSIDE
const Fl_Align FL_ALIGN_INSIDE
Definition: Enumerations.H:843
Fl::box_dw
static int box_dw(Fl_Boxtype)
Definition: fl_boxtype.cxx:391
Fl::belowmouse
static Fl_Widget * belowmouse()
Definition: Fl.H:833
FL_ALIGN_LEFT_BOTTOM
const Fl_Align FL_ALIGN_LEFT_BOTTOM
Definition: Enumerations.H:864
Fl_Window.H
Fl_Group::sizes_
int * sizes_
Definition: Fl_Group.H:47
Fl_Input_Choice::menu_w
int menu_w()
Definition: Fl_Input_Choice.H:171
Fl_Input_Choice.H
dw
uchar dw
Definition: fl_boxtype.cxx:286
FL_DND_DRAG
Definition: Enumerations.H:407
p
static menustate * p
Definition: Fl_Menu.cxx:606
FL_WHEN_CHANGED
Do the callback only when the widget value changes.
Definition: Enumerations.H:441
FL_Left
#define FL_Left
The left arrow key.
Definition: Enumerations.H:480
Fl_Group::~Fl_Group
virtual ~Fl_Group()
Definition: Fl_Group.cxx:448
Fl_Widget::w
void w(int v)
Definition: Fl_Widget.H:143
FL_Right
#define FL_Right
The right arrow key.
Definition: Enumerations.H:482
Fl::box_dy
static int box_dy(Fl_Boxtype)
Definition: fl_boxtype.cxx:385
Fl_Widget::x
void x(int v)
Definition: Fl_Widget.H:139
FL_FLAT_BOX
a flat box
Definition: Enumerations.H:606
FL_Tab
#define FL_Tab
The tab key.
Definition: Enumerations.H:469
FL_DEACTIVATE
Definition: Enumerations.H:356
FL_ALT
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:560
FL_MOVE
Definition: Enumerations.H:335
FL_MOUSEWHEEL
Definition: Enumerations.H:395
FL_ALIGN_TOP_LEFT
const Fl_Align FL_ALIGN_TOP_LEFT
Definition: Enumerations.H:858
Fl_Widget::parent_
Fl_Group * parent_
Definition: Fl_Widget.H:104
fl_draw.H
utility header to pull drawing functions together
Fl_Input_Choice::inp_y
int inp_y()
Definition: Fl_Input_Choice.H:165
Fl_Group::clip_children
unsigned int clip_children()
Definition: Fl_Group.H:176
FL_DOWN_BOX
see figure 1
Definition: Enumerations.H:608
Fl_Input_Choice::menu_h
int menu_h()
Definition: Fl_Input_Choice.H:172
Fl_Group::array
Fl_Widget *const * array() const
Definition: Fl_Group.cxx:44
Fl_Group::savedfocus_
Fl_Widget * savedfocus_
Definition: Fl_Group.H:44
Fl_Spinner::maximum_
double maximum_
Definition: Fl_Spinner.H:49
FL_FOCUS
Definition: Enumerations.H:283
Fl_Widget::visible
unsigned int visible() const
Definition: Fl_Widget.H:660
Fl_Input
Definition: Fl_Input.H:222
Fl_Spinner::up_button_
Fl_Repeat_Button up_button_
Definition: Fl_Spinner.H:59
Fl_Widget_Tracker::exists
int exists()
Definition: Fl.H:1407
FL_PUSH
Definition: Enumerations.H:236
Fl_Widget::damage
uchar damage() const
Definition: Fl_Widget.H:917
fl_push_clip
void fl_push_clip(int x, int y, int w, int h)
Definition: fl_draw.H:82
Fl_Widget
Definition: Fl_Widget.H:101
Fl_Group
Definition: Fl_Group.H:41
Fl_Group::current
static Fl_Group * current()
Definition: Fl_Group.cxx:84
Fl::focus
static Fl_Widget * focus()
Definition: Fl.H:840
FL_ALIGN_BOTTOM
const Fl_Align FL_ALIGN_BOTTOM
Definition: Enumerations.H:835
Fl_Group::add
void add(Fl_Widget &)
Definition: Fl_Group.cxx:491
Fl_Widget::box
Fl_Boxtype box() const
Definition: Fl_Widget.H:363
send
static int send(Fl_Widget *o, int event)
Definition: Fl_Group.cxx:97
Fl_Widget::h
int h() const
Definition: Fl_Widget.H:299
Fl_Widget_Tracker
Definition: Fl.H:1371
Fl_Group::children
int children() const
Definition: Fl_Group.H:75
FL_KEYBOARD
Definition: Enumerations.H:315
Fl_Group::resize
void resize(int, int, int, int)
Definition: Fl_Group.cxx:634
Fl::pushed
static Fl_Widget * pushed()
Definition: Fl.H:837
Fl_Group::init_sizes
void init_sizes()
Definition: Fl_Group.cxx:572
Fl_Widget::h
void h(int v)
Definition: Fl_Widget.H:145
Fl_Widget::label
const char * label() const
Definition: Fl_Widget.H:421
Fl_Group::current_
static Fl_Group * current_
Definition: Fl_Group.H:50
FL_ALIGN_RIGHT_TOP
const Fl_Align FL_ALIGN_RIGHT_TOP
Definition: Enumerations.H:863
Fl_Spinner::value_
double value_
Definition: Fl_Spinner.H:47
Fl_Widget::y
void y(int v)
Definition: Fl_Widget.H:141
FL_SHOW
Definition: Enumerations.H:377
Fl_Input_Choice::inp_cb
static void inp_cb(Fl_Widget *, void *data)
Definition: Fl_Input_Choice.H:144
Fl_Spinner::down_button_
Fl_Repeat_Button down_button_
Definition: Fl_Spinner.H:59
Fl_Input_Choice::Fl_Input_Choice
Fl_Input_Choice(int X, int Y, int W, int H, const char *L=0)
Definition: Fl_Group.cxx:833
Fl_Widget::handle
virtual int handle(int event)
Definition: Fl_Widget.cxx:112
fl_pop_clip
void fl_pop_clip()
Definition: fl_draw.H:103
Fl_Group::handle
int handle(int)
Definition: Fl_Group.cxx:147
Fl_Widget::active
unsigned int active() const
Definition: Fl_Widget.H:708
FL_ALIGN_RIGHT_BOTTOM
const Fl_Align FL_ALIGN_RIGHT_BOTTOM
Definition: Enumerations.H:865
Fl_Widget::callback
Fl_Callback_p callback() const
Definition: Fl_Widget.H:561
Fl_Input_Choice::inp_w
int inp_w()
Definition: Fl_Input_Choice.H:166
Fl_Widget::clear_damage
void clear_damage(uchar c=0)
Definition: Fl_Widget.H:931
fl_oldfocus
Fl_Widget * fl_oldfocus
Definition: Fl.cxx:973
FL_ALIGN_TOP
const Fl_Align FL_ALIGN_TOP
Definition: Enumerations.H:833
fl_draw_shortcut
char fl_draw_shortcut
Definition: fl_draw.cxx:36
Fl_Input_Choice::menu_y
int menu_y()
Definition: Fl_Input_Choice.H:170
Fl_Group.H
Fl_Input_Choice::inp_x
int inp_x()
Definition: Fl_Input_Choice.H:164
FL_SHORTCUT
Definition: Enumerations.H:349
dy
uchar dy
Definition: fl_boxtype.cxx:286
Fl_Group::update_child
void update_child(Fl_Widget &widget) const
Definition: Fl_Group.cxx:754
Fl_Widget::draw
virtual void draw()=0
Fl_Widget::contains
int contains(const Fl_Widget *w) const
Definition: Fl_Widget.cxx:303
Fl::focus_
static Fl_Widget * focus_
Definition: Fl.H:161
Fl::e_x
static int e_x
Definition: Fl.H:144
Fl_Widget::type
uchar type() const
Definition: Fl_Widget.H:274
FL_ALIGN_TOP_RIGHT
const Fl_Align FL_ALIGN_TOP_RIGHT
Definition: Enumerations.H:859
Fl_Spinner::format_
const char * format_
Definition: Fl_Spinner.H:51
Fl_Widget::parent
Fl_Group * parent() const
Definition: Fl_Widget.H:254
malloc
voidp malloc()
Fl_Group::child
Fl_Widget * child(int n) const
Definition: Fl_Group.H:79
FL_ACTIVATE
Definition: Enumerations.H:361
Y
static int Y
Definition: Fl_Tooltip.cxx:76
Fl_Group::remove
void remove(int index)
Definition: Fl_Group.cxx:503
Fl_Widget::resize
virtual void resize(int x, int y, int w, int h)
Definition: Fl_Widget.cxx:150
Fl_Input_Choice::menu_
InputMenuButton * menu_
Definition: Fl_Input_Choice.H:111
FL_ALIGN_RIGHT
const Fl_Align FL_ALIGN_RIGHT
Definition: Enumerations.H:841
FL_RELEASE
Definition: Enumerations.H:244
Fl_Widget::take_focus
int take_focus()
Definition: Fl_Widget.cxx:162
Fl_Align
unsigned Fl_Align
Definition: Enumerations.H:828
navkey
static int navkey()
Definition: Fl_Group.cxx:125
Fl_Group::draw_outside_label
void draw_outside_label(const Fl_Widget &widget) const
Definition: Fl_Group.cxx:780
FL_CTRL
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:559
dh
uchar dh
Definition: fl_boxtype.cxx:286
Fl_Group::begin
void begin()
Definition: Fl_Group.cxx:69
Fl_Spinner::Fl_Spinner
Fl_Spinner(int X, int Y, int W, int H, const char *L=0)
Definition: Fl_Group.cxx:851
FL_ALIGN_LEFT_TOP
const Fl_Align FL_ALIGN_LEFT_TOP
Definition: Enumerations.H:862
FL_DAMAGE_CHILD
Definition: Enumerations.H:1106
Fl_Group::draw_child
void draw_child(Fl_Widget &widget) const
Definition: Fl_Group.cxx:768
FL_ENTER
Definition: Enumerations.H:253
dx
uchar dx
Definition: fl_boxtype.cxx:286
Fl_Input_Choice::menu_x
int menu_x()
Definition: Fl_Input_Choice.H:169
Fl_Spinner::input_
Fl_Input input_
Definition: Fl_Spinner.H:57
Fl_Input_Choice::inp_
Fl_Input * inp_
Definition: Fl_Input_Choice.H:110
Fl::event_inside
static int event_inside(int, int, int, int)
Definition: Fl.cxx:227
Fl_Group::draw_children
void draw_children()
Definition: Fl_Group.cxx:715
FL_INT_INPUT
#define FL_INT_INPUT
Definition: Fl_Input_.H:31
FL_WHEN_ENTER_KEY
Do the callback when the user presses the ENTER key and the value changes.
Definition: Enumerations.H:445
FL_ALIGN_BOTTOM_RIGHT
const Fl_Align FL_ALIGN_BOTTOM_RIGHT
Definition: Enumerations.H:861
Fl_Spinner::step_
double step_
Definition: Fl_Spinner.H:50