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_Menu_Type.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Menu item code for the Fast Light Tool Kit (FLTK).
5 //
6 // Menu items are kludged by making a phony Fl_Box widget so the normal
7 // widget panel can be used to control them.
8 //
9 // This file also contains code to make Fl_Menu_Button, Fl_Menu_Bar,
10 // etc widgets.
11 //
12 // Copyright 1998-2010 by Bill Spitzak and others.
13 //
14 // This library is free software. Distribution and use rights are outlined in
15 // the file "COPYING" which should have been included with this file. If this
16 // file is missing or damaged, see the license at:
17 //
18 // http://www.fltk.org/COPYING.php
19 //
20 // Please report all bugs and problems on the following page:
21 //
22 // http://www.fltk.org/str.php
23 //
24 
25 #include <FL/Fl.H>
26 #include "Fl_Widget_Type.h"
27 #include "alignment_panel.h"
28 #include <FL/fl_message.H>
29 #include <FL/Fl_Menu_.H>
30 #include <FL/Fl_Button.H>
31 #include <FL/Fl_Value_Input.H>
32 #include <FL/Fl_Text_Display.H>
33 #include "../src/flstring.h"
34 #include <stdio.h>
35 #include <stdlib.h>
36 
38  {"Normal",0,0,(void*)0},
39  {"Toggle",0,0,(void*)FL_MENU_BOX},
40  {"Radio",0,0,(void*)FL_MENU_RADIO},
41  {0}};
42 
43 extern int reading_file;
44 extern int force_parent;
45 extern int i18n_type;
46 extern const char* i18n_include;
47 extern const char* i18n_function;
48 extern const char* i18n_file;
49 extern const char* i18n_set;
50 
51 static char submenuflag;
52 
55  // count how many Fl_Menu_Item structures needed:
56  int n = 0;
57  Fl_Type* q;
58  for (q = next; q && q->level > level; q = q->next) {
59  if (q->is_parent()) n++; // space for null at end of submenu
60  n++;
61  }
62  if (!n) {
63  if (menusize) delete[] (Fl_Menu_Item*)(w->menu());
64  w->menu(0);
65  menusize = 0;
66  } else {
67  n++; // space for null at end of menu
68  if (menusize<n) {
69  if (menusize) delete[] (Fl_Menu_Item*)(w->menu());
70  menusize = n+10;
71  w->menu(new Fl_Menu_Item[menusize]);
72  }
73  // fill them all in:
74  Fl_Menu_Item* m = (Fl_Menu_Item*)(w->menu());
75  int lvl = level+1;
76  for (q = next; q && q->level > level; q = q->next) {
78  if (i->o->image()) i->o->image()->label(m);
79  else {
80  m->label(i->o->label() ? i->o->label() : "(nolabel)");
81  m->labeltype(i->o->labeltype());
82  }
83  m->shortcut(((Fl_Button*)(i->o))->shortcut());
84  m->callback(0,(void*)i);
85  m->flags = i->flags();
86  m->labelfont(i->o->labelfont());
87  m->labelsize(i->o->labelsize());
88  m->labelcolor(i->o->labelcolor());
89  if (q->is_parent()) {lvl++; m->flags |= FL_SUBMENU;}
90  m++;
91  int l1 =
92  (q->next && q->next->is_menu_item()) ? q->next->level : level;
93  while (lvl > l1) {m->label(0); m++; lvl--;}
94  lvl = l1;
95  }
96  }
97  o->redraw();
98 }
99 
100 
102  // Find the current menu item:
104  Fl_Type* p = q;
105  if (p) {
106  if ( (force_parent && q->is_menu_item()) || !q->is_parent()) p = p->parent;
107  }
108  force_parent = 0;
109  if (!p || !(p->is_menu_button() || (p->is_menu_item() && p->is_parent()))) {
110  fl_message("Please select a menu to add to");
111  return 0;
112  }
113  if (!o) {
114  o = new Fl_Button(0,0,100,20); // create template widget
116  }
117 
119  t->o = new Fl_Button(0,0,100,20);
120  t->factory = this;
121  t->add(p);
122  if (!reading_file) t->label(submenuflag ? "submenu" : "item");
123  return t;
124 }
125 
127  submenuflag = 1;
129  submenuflag = 0;
130  return t;
131 }
132 
135 
137 // Writing the C code:
138 
139 // test functions in Fl_Widget_Type.C:
140 int is_name(const char *c);
141 const char *array_name(Fl_Widget_Type *o);
142 int isdeclare(const char *c);
143 
144 // Search backwards to find the parent menu button and return it's name.
145 // Also put in i the index into the button's menu item array belonging
146 // to this menu item.
147 const char* Fl_Menu_Item_Type::menu_name(int& i) {
148  i = 0;
149  Fl_Type* t = prev;
150  while (t && t->is_menu_item()) {
151  // be sure to count the {0} that ends a submenu:
152  if (t->level > t->next->level) i += (t->level - t->next->level);
153  // detect empty submenu:
154  else if (t->level == t->next->level && t->is_parent()) i++;
155  t = t->prev;
156  i++;
157  }
158  return unique_id(t, "menu", t->name(), t->label());
159 }
160 
161 #include "Fluid_Image.h"
162 
164  if (callback() && is_name(callback()) && !user_defined(callback()))
165  write_declare("extern void %s(Fl_Menu_*, %s);", callback(),
166  user_data_type() ? user_data_type() : "void*");
167  for (int n=0; n < NUM_EXTRA_CODE; n++) {
168  if (extra_code(n) && isdeclare(extra_code(n)))
169  write_declare("%s", extra_code(n));
170  }
171  if (callback() && !is_name(callback())) {
172  // see if 'o' or 'v' used, to prevent unused argument warnings:
173  int use_o = 0;
174  int use_v = 0;
175  const char *d;
176  for (d = callback(); *d;) {
177  if (*d == 'o' && !is_id(d[1])) use_o = 1;
178  if (*d == 'v' && !is_id(d[1])) use_v = 1;
179  do d++; while (is_id(*d));
180  while (*d && !is_id(*d)) d++;
181  }
182  const char* cn = callback_name();
183  const char* k = class_name(1);
184  if (k) {
185  write_c("\nvoid %s::%s_i(Fl_Menu_*", k, cn);
186  } else {
187  write_c("\nstatic void %s(Fl_Menu_*", cn);
188  }
189  if (use_o) write_c(" o");
190  const char* ut = user_data_type() ? user_data_type() : "void*";
191  write_c(", %s", ut);
192  if (use_v) write_c(" v");
193  write_c(") {\n %s", callback());
194  if (*(d-1) != ';') {
195  const char *p = strrchr(callback(), '\n');
196  if (p) p ++;
197  else p = callback();
198  // Only add trailing semicolon if the last line is not a preprocessor
199  // statement...
200  if (*p != '#' && *p) write_c(";");
201  }
202  write_c("\n}\n");
203  if (k) {
204  write_c("void %s::%s(Fl_Menu_* o, %s v) {\n", k, cn, ut);
205  write_c(" ((%s*)(o", k);
206  Fl_Type* t = parent; while (t->is_menu_item()) t = t->parent;
207  Fl_Type *q = 0;
208  // Go up one more level for Fl_Input_Choice, as these are groups themselves
209  if (t && !strcmp(t->type_name(), "Fl_Input_Choice"))
210  write_c("->parent()");
211  for (t = t->parent; t && t->is_widget() && !is_class(); q = t, t = t->parent)
212  write_c("->parent()");
213  if (!q || strcmp(q->type_name(), "widget_class"))
214  write_c("->user_data()");
215  write_c("))->%s_i(o,v);\n}\n", cn);
216  }
217  }
218  if (image) {
219  if (image->written != write_number) {
220  image->write_static();
222  }
223  }
224  if (next && next->is_menu_item()) return;
225  // okay, when we hit last item in the menu we have to write the
226  // entire array out:
227  const char* k = class_name(1);
228  if (k) {
229  int i;
230  if (i18n_type) write_c("\nunsigned char %s::%s_i18n_done = 0;", k, menu_name(i));
231  write_c("\nFl_Menu_Item %s::%s[] = {\n", k, menu_name(i));
232  } else {
233  int i;
234  if (i18n_type) write_c("\nunsigned char %s_i18n_done = 0;", menu_name(i));
235  write_c("\nFl_Menu_Item %s[] = {\n", menu_name(i));
236  }
237  Fl_Type* t = prev; while (t && t->is_menu_item()) t = t->prev;
238  for (Fl_Type* q = t->next; q && q->is_menu_item(); q = q->next) {
239  ((Fl_Menu_Item_Type*)q)->write_item();
240  int thislevel = q->level; if (q->is_parent()) thislevel++;
241  int nextlevel =
242  (q->next && q->next->is_menu_item()) ? q->next->level : t->level+1;
243  while (thislevel > nextlevel) {write_c(" {0,0,0,0,0,0,0,0,0},\n"); thislevel--;}
244  }
245  write_c(" {0,0,0,0,0,0,0,0,0}\n};\n");
246 
247  if (k) {
248  // Write menu item variables...
249  t = prev; while (t && t->is_menu_item()) t = t->prev;
250  for (Fl_Type* q = t->next; q && q->is_menu_item(); q = q->next) {
252  const char *c = array_name(m);
253  if (c) {
254  if (c==m->name()) {
255  // assign a menu item address directly to a variable
256  int i;
257  const char* n = ((Fl_Menu_Item_Type *)q)->menu_name(i);
258  write_c("Fl_Menu_Item* %s::%s = %s::%s + %d;\n", k, c, k, n, i);
259  } else {
260  // if the name is an array, only define the array.
261  // The actual assignment is in write_code1()
262  write_c("Fl_Menu_Item* %s::%s;\n", k, c);
263  }
264  }
265  }
266  }
267 }
268 
270  int i = o->type();
271  if (((Fl_Button*)o)->value()) i |= FL_MENU_VALUE;
272  if (!o->active()) i |= FL_MENU_INACTIVE;
273  if (!o->visible()) i |= FL_MENU_INVISIBLE;
274  if (is_parent()) {
275  if (user_data() == NULL) i |= FL_SUBMENU;
276  else i |= FL_SUBMENU_POINTER;
277  }
278  if (hotspot()) i |= FL_MENU_DIVIDER;
279  return i;
280 }
281 
283  static const char * const labeltypes[] = {
284  "FL_NORMAL_LABEL",
285  "FL_NO_LABEL",
286  "FL_SHADOW_LABEL",
287  "FL_ENGRAVED_LABEL",
288  "FL_EMBOSSED_LABEL",
289  "FL_MULTI_LABEL",
290  "FL_ICON_LABEL",
291  "FL_IMAGE_LABEL"
292  };
293 
295  write_c(" {");
296  if (image) write_c("0");
297  else if (label()) write_cstring(label()); // we will call i18n when the widget is instantiated for the first time
298  else write_c("\"\"");
299  if (((Fl_Button*)o)->shortcut()) {
300  int s = ((Fl_Button*)o)->shortcut();
301  if (use_FL_COMMAND && (s & (FL_CTRL|FL_META))) {
302  write_c(", FL_COMMAND|0x%x, ", s & ~(FL_CTRL|FL_META));
303  } else {
304  write_c(", 0x%x, ", s);
305  }
306  } else
307  write_c(", 0, ");
308  if (callback()) {
309  const char* k = is_name(callback()) ? 0 : class_name(1);
310  if (k) {
311  write_c(" (Fl_Callback*)%s::%s,", k, callback_name());
312  } else {
313  write_c(" (Fl_Callback*)%s,", callback_name());
314  }
315  } else
316  write_c(" 0,");
317  if (user_data())
318  write_c(" (void*)(%s),", user_data());
319  else
320  write_c(" 0,");
321  write_c(" %d, (uchar)%s, %d, %d, %d", flags(),
322  labeltypes[o->labeltype()], o->labelfont(), o->labelsize(), o->labelcolor());
323  write_c("},\n");
324 }
325 
327  int i; const char* mname = menu_name(i);
328 
329  if (!prev->is_menu_item()) {
330  // for first menu item, declare the array
331  if (class_name(1)) {
332  if (i18n_type) write_h(" static unsigned char %s_i18n_done;\n", mname);
333  write_h(" static Fl_Menu_Item %s[];\n", mname);
334  } else {
335  if (i18n_type) write_h("extern unsigned char %s_i18n_done;\n", mname);
336  write_h("extern Fl_Menu_Item %s[];\n", mname);
337  }
338  }
339 
340  const char *c = array_name(this);
341  if (c) {
342  if (class_name(1)) {
344  write_h(" static Fl_Menu_Item *%s;\n", c);
345  } else {
346  if (c==name())
347  write_h("#define %s (%s+%d)\n", c, mname, i);
348  else
349  write_h("extern Fl_Menu_Item *%s;\n", c);
350  }
351  }
352 
353  if (callback()) {
354  if (!is_name(callback()) && class_name(1)) {
355  const char* cn = callback_name();
356  const char* ut = user_data_type() ? user_data_type() : "void*";
357  write_public(0);
358  write_h(" inline void %s_i(Fl_Menu_*, %s);\n", cn, ut);
359  write_h(" static void %s(Fl_Menu_*, %s);\n", cn, ut);
360  }
361  }
362 
363  int init = 0;
364  // if the name is an array variable, assign the value here
365  if (name() && strchr(name(), '[')) {
366  write_c("%s%s = &%s[%d];\n", indent(), name(), mname, i);
367  }
368  if (image) {
369  if (!init) {
370  init = 1;
371  write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", indent(), mname, i);
372  }
373  image->write_code("o");
374  }
375  for (int n=0; n < NUM_EXTRA_CODE; n++)
376  if (extra_code(n) && !isdeclare(extra_code(n))) {
377  if (!init) {
378  init = 1;
379  write_c("%s{ Fl_Menu_Item* o = &%s[%d];\n", indent(), mname, i);
380  }
381  write_c("%s %s\n", indent(), extra_code(n));
382  }
383  if (init) write_c("%s}\n",indent());
384 }
385 
387 
389 // This is the base class for widgets that contain a menu (ie
390 // subclasses of Fl_Menu_.
391 // This is a parent widget and menu items can be added as
392 // children. An actual array of Fl_Menu_Items is kept parallel
393 // with the child objects and updated as they change.
394 
396  Fl_Menu_* w = (Fl_Menu_*)o;
397  // count how many Fl_Menu_Item structures needed:
398  int n = 0;
399  Fl_Type* q;
400  for (q = next; q && q->level > level; q = q->next) {
401  if (q->is_parent()) n++; // space for null at end of submenu
402  n++;
403  }
404  if (!n) {
405  if (menusize) delete[] (Fl_Menu_Item*)(w->menu());
406  w->menu(0);
407  menusize = 0;
408  } else {
409  n++; // space for null at end of menu
410  if (menusize<n) {
411  if (menusize) delete[] (Fl_Menu_Item*)(w->menu());
412  menusize = n+10;
413  w->menu(new Fl_Menu_Item[menusize]);
414  }
415  // fill them all in:
416  Fl_Menu_Item* m = (Fl_Menu_Item*)(w->menu());
417  int lvl = level+1;
418  for (q = next; q && q->level > level; q = q->next) {
420  if (i->o->image()) i->o->image()->label(m);
421  else {
422  m->label(i->o->label() ? i->o->label() : "(nolabel)");
423  m->labeltype(i->o->labeltype());
424  }
425  m->shortcut(((Fl_Button*)(i->o))->shortcut());
426  m->callback(0,(void*)i);
427  m->flags = i->flags();
428  m->labelfont(i->o->labelfont());
429  m->labelsize(i->o->labelsize());
430  m->labelcolor(i->o->labelcolor());
431  if (q->is_parent()) {lvl++; m->flags |= FL_SUBMENU;}
432  m++;
433  int l1 =
434  (q->next && q->next->is_menu_item()) ? q->next->level : level;
435  while (lvl > l1) {m->label(0); m++; lvl--;}
436  lvl = l1;
437  }
438  }
439  o->redraw();
440 }
441 
443  if (selected) return 0; // let user move the widget
444  Fl_Menu_* w = (Fl_Menu_*)o;
445  if (!menusize) return 0;
446  const Fl_Menu_Item* save = w->mvalue();
447  w->value((Fl_Menu_Item*)0);
448  Fl::pushed(w);
449  w->handle(FL_PUSH);
450  const Fl_Menu_Item* m = w->mvalue();
451  if (m) {
452  // restore the settings of toggles & radio items:
454  return (Fl_Type*)(m->user_data());
455  }
456  w->value(save);
457  return this;
458 }
459 
461  if (next && next->is_menu_item()) {
462  if (i18n_type) {
463  // take care of i18n now!
465  int i, nItem = 0, nLabel = 0;
466  const char *mName = mi->menu_name(i);
467  for (Fl_Type* q = next; q && q->is_menu_item(); q = q->next) {
468  if (((Fl_Menu_Item_Type*)q)->label()) nLabel++;
469  int thislevel = q->level; if (q->is_parent()) thislevel++;
470  int nextlevel =
471  (q->next && q->next->is_menu_item()) ? q->next->level : next->level+1;
472  nItem += 1 + ((thislevel > nextlevel) ? (thislevel-nextlevel) : 0);
473  }
474  if (nLabel) {
475  write_c("%sif (!%s_i18n_done) {\n", indent(), mName);
476  write_c("%s int i=0;\n", indent());
477  write_c("%s for ( ; i<%d; i++)\n", indent(), nItem);
478  write_c("%s if (%s[i].label())\n", indent(), mName);
479  switch (i18n_type) {
480  case 1:
481  write_c("%s %s[i].label(%s(%s[i].label()));\n",
482  indent(), mName, i18n_function, mName);
483  break;
484  case 2:
485  write_c("%s %s[i].label(catgets(%s,%s,i+%d,%s[i].label()));\n",
486  indent(), mName, i18n_file[0] ? i18n_file : "_catalog",
487  i18n_set, mi->msgnum(), mName);
488  break;
489  }
490  write_c("%s %s_i18n_done = 1;\n", indent(), mName);
491  write_c("%s}\n", indent());
492  }
493  }
494  write_c("%s%s->menu(%s);\n", indent(), name() ? name() : "o",
495  unique_id(this, "menu", name(), label()));
496  }
498 }
499 
502  Fl_Menu_ *s = (Fl_Menu_*)o, *d = (Fl_Menu_*)live_widget;
503  d->menu(s->menu());
504  d->down_box(s->down_box());
505  d->textcolor(s->textcolor());
506  d->textfont(s->textfont());
507  d->textsize(s->textsize());
508 }
509 
511 
512 #include <FL/Fl_Menu_Button.H>
514  {"normal",0,0,(void*)0},
515  {"popup1",0,0,(void*)Fl_Menu_Button::POPUP1},
516  {"popup2",0,0,(void*)Fl_Menu_Button::POPUP2},
517  {"popup3",0,0,(void*)Fl_Menu_Button::POPUP3},
518  {"popup12",0,0,(void*)Fl_Menu_Button::POPUP12},
519  {"popup23",0,0,(void*)Fl_Menu_Button::POPUP23},
520  {"popup13",0,0,(void*)Fl_Menu_Button::POPUP13},
521  {"popup123",0,0,(void*)Fl_Menu_Button::POPUP123},
522  {0}};
523 
525 
527 
528 Fl_Menu_Item dummymenu[] = {{"CHOICE"},{0}};
529 
531 
533 
537  d->menu(s->menu());
538  d->down_box(s->down_box());
539  d->textcolor(s->textcolor());
540  d->textfont(s->textfont());
541  d->textsize(s->textsize());
542 }
543 
545  if (selected) return 0; // let user move the widget
546  Fl_Menu_* w = ((Fl_Input_Choice*)o)->menubutton();
547  if (!menusize) return 0;
548  const Fl_Menu_Item* save = w->mvalue();
549  w->value((Fl_Menu_Item*)0);
550  Fl::pushed(w);
551  w->handle(FL_PUSH);
552  const Fl_Menu_Item* m = w->mvalue();
553  if (m) {
554  // restore the settings of toggles & radio items:
556  return (Fl_Type*)(m->user_data());
557  }
558  w->value(save);
559  return this;
560 }
561 
563 
565 
567 // Shortcut entry item in panel:
568 
569 #include <FL/Fl_Output.H>
570 #include "Shortcut_Button.h"
571 #include <FL/fl_draw.H>
572 
574  if (value()) draw_box(FL_DOWN_BOX, (Fl_Color)9);
575  else draw_box(FL_UP_BOX, FL_WHITE);
577  if (use_FL_COMMAND && (svalue & (FL_CTRL|FL_META))) {
578  char buf[1024];
579  fl_snprintf(buf, 1023, "Command+%s", fl_shortcut_label(svalue&~(FL_CTRL|FL_META)));
580  fl_draw(buf,x()+6,y(),w(),h(),FL_ALIGN_LEFT);
581  } else {
583  }
584 }
585 
588  if (e == FL_KEYBOARD) {
589  if (!value()) return 0;
590  int v = Fl::event_text()[0];
591  if ( (v > 32 && v < 0x7f) || (v > 0xa0 && v <= 0xff) ) {
592  if (isupper(v)) {
593  v = tolower(v);
594  v |= FL_SHIFT;
595  }
596  v = v | (Fl::event_state()&(FL_META|FL_ALT|FL_CTRL));
597  } else {
599  if (v == FL_BackSpace && svalue) v = 0;
600  }
601  if (v != svalue) {svalue = v; set_changed(); redraw(); do_callback(); }
602  return 1;
603  } else if (e == FL_UNFOCUS) {
604  int c = changed(); value(0); if (c) set_changed();
605  return 1;
606  } else if (e == FL_FOCUS) {
607  return value();
608  } else {
609  int r = Fl_Button::handle(e);
610  if (e == FL_RELEASE && value() && Fl::focus() != this) take_focus();
611  return r;
612  }
613 }
614 
615 void shortcut_in_cb(Shortcut_Button* i, void* v) {
616  if (v == LOAD) {
617  if (current_widget->is_button())
618  i->svalue = ((Fl_Button*)(current_widget->o))->shortcut();
619  else if (current_widget->is_input())
620  i->svalue = ((Fl_Input_*)(current_widget->o))->shortcut();
621  else if (current_widget->is_value_input())
622  i->svalue = ((Fl_Value_Input*)(current_widget->o))->shortcut();
623  else if (current_widget->is_text_display())
624  i->svalue = ((Fl_Text_Display*)(current_widget->o))->shortcut();
625  else {
626  i->hide();
627  return;
628  }
629  i->show();
630  i->redraw();
631  } else {
632  int mod = 0;
633  for (Fl_Type *o = Fl_Type::first; o; o = o->next)
634  if (o->selected && o->is_button()) {
635  Fl_Button* b = (Fl_Button*)(((Fl_Widget_Type*)o)->o);
636  if (b->shortcut()!=i->svalue) mod = 1;
637  b->shortcut(i->svalue);
638  if (o->is_menu_item()) ((Fl_Widget_Type*)o)->redraw();
639  } else if (o->selected && o->is_input()) {
640  Fl_Input_* b = (Fl_Input_*)(((Fl_Widget_Type*)o)->o);
641  if (b->shortcut()!=i->svalue) mod = 1;
642  b->shortcut(i->svalue);
643  } else if (o->selected && o->is_value_input()) {
645  if (b->shortcut()!=i->svalue) mod = 1;
646  b->shortcut(i->svalue);
647  } else if (o->selected && o->is_text_display()) {
649  if (b->shortcut()!=i->svalue) mod = 1;
650  b->shortcut(i->svalue);
651  }
652  if (mod) set_modflag(1);
653  }
654 }
655 
656 //
657 // End of "$Id$".
658 //
Fl_Type::callback
const char * callback() const
Definition: Fl_Type.h:100
Fl_Input_Choice::down_box
Fl_Boxtype down_box() const
Definition: Fl_Input_Choice.H:210
fl_font
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Definition: fl_draw.H:509
dummymenu
Fl_Menu_Item dummymenu[]
Definition: Fl_Menu_Type.cxx:528
FL_MENU_RADIO
Item is a radio button (one checkbox of many can be on)
Definition: Fl_Menu_Item.H:36
FL_ALIGN_LEFT
const Fl_Align FL_ALIGN_LEFT
Definition: Enumerations.H:839
Fl_Widget::y
int y() const
Definition: Fl_Widget.H:289
i18n_file
const char * i18n_file
Definition: fluid.cxx:705
Fl.H
Fluid_Image.h
use_FL_COMMAND
int use_FL_COMMAND
Definition: Fl_Window_Type.cxx:43
Fl_Input_Choice::textfont
Fl_Font textfont() const
Gets the Fl_Input text field's font style.
Definition: Fl_Input_Choice.H:227
buf
static char * buf
Definition: fl_encoding_mac_roman.cxx:76
Fl_Widget_Type
Definition: Fl_Type.h:374
Fl_Submenu_Type::make
Fl_Type * make()
Definition: Fl_Menu_Type.cxx:126
Fl_Menu_Type::build_menu
virtual void build_menu()
Definition: Fl_Menu_Type.cxx:395
Fl_Menu_Item::flags
int flags
menu item flags like FL_MENU_TOGGLE, FL_MENU_RADIO
Definition: Fl_Menu_Item.H:117
FL_BackSpace
#define FL_BackSpace
The backspace key.
Definition: Enumerations.H:468
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_Type::current
static Fl_Type * current
Definition: Fl_Type.h:114
Fl_Menu_Type::copy_properties
void copy_properties()
Definition: Fl_Menu_Type.cxx:500
Fl_Type::next
Fl_Type * next
Definition: Fl_Type.h:71
Fl_Color
unsigned int Fl_Color
Definition: Enumerations.H:934
fl_shortcut_label
const FL_EXPORT char * fl_shortcut_label(unsigned int shortcut)
Definition: fl_shortcut.cxx:199
Fl_Input_Choice_Type::copy_properties
void copy_properties()
Definition: Fl_Menu_Type.cxx:534
FL_TOGGLE_BUTTON
#define FL_TOGGLE_BUTTON
value() toggles between 0 and 1 at every click of the button
Definition: Fl_Button.H:33
Fl_Menu_::menu
const Fl_Menu_Item * menu() const
Definition: Fl_Menu_.H:110
Fluid_Image::write_static
void write_static()
Definition: Fluid_Image.cxx:46
fl_message
void fl_message(const char *,...)
Definition: fl_ask.cxx:338
FL_UNFOCUS
Definition: Enumerations.H:288
i18n_set
const char * i18n_set
Definition: fluid.cxx:706
i18n_include
const char * i18n_include
Definition: fluid.cxx:703
Fl_Type::is_text_display
virtual int is_text_display() const
Definition: Fl_Type.cxx:755
FL_SUBMENU_POINTER
Indicates user_data() is a pointer to another menu array.
Definition: Fl_Menu_Item.H:38
Fl_Type::user_defined
int user_defined(const char *cbname) const
Definition: Fl_Type.cxx:1127
Fl_Widget::show
virtual void show()
Definition: Fl_Widget.cxx:271
LOAD
#define LOAD()
Definition: infback.c:128
Fl_Widget::labelcolor
Fl_Color labelcolor() const
Definition: Fl_Widget.H:472
Fl_Type::user_data_type
const char * user_data_type() const
Definition: Fl_Type.h:104
Fluid_Image::write_code
void write_code(const char *var, int inactive=0)
Definition: Fluid_Image.cxx:147
fl_snprintf
FL_EXPORT int fl_snprintf(char *, size_t, const char *,...)
Definition: vsnprintf.c:260
FL_WHITE
const Fl_Color FL_WHITE
Definition: Enumerations.H:971
Fl_Type::is_parent
virtual int is_parent() const
Definition: Fl_Type.cxx:748
Fl_Type::parent
Fl_Type * parent
Definition: Fl_Type.h:63
Fl::event_state
static int event_state()
Definition: Fl.H:704
Shortcut_Button.h
FL_MENU_INACTIVE
Deactivate menu item (gray out)
Definition: Fl_Menu_Item.H:33
fl_color
void fl_color(Fl_Color c)
Definition: fl_draw.H:52
Fl_Menu_Type::menusize
int menusize
Definition: Fl_Type.h:723
Fl_Type::add
void add(Fl_Type *parent)
Definition: Fl_Type.cxx:574
Fl_Input_Choice_Type::click_test
virtual Fl_Type * click_test(int, int)
Definition: Fl_Menu_Type.cxx:544
Fl_Button
Buttons generate callbacks when they are clicked by the user.
Definition: Fl_Button.H:79
FL_SHIFT
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:557
Fl_Menu_Item::label
const char * label() const
Definition: Fl_Menu_Item.H:148
Fl_Widget::labelfont
Fl_Font labelfont() const
Definition: Fl_Widget.H:487
Fl::event_text
static const char * event_text()
Definition: Fl.H:792
Fl_Menu_Item_type
Fl_Menu_Item_Type Fl_Menu_Item_type
Definition: Fl_Menu_Type.cxx:133
Fl_Button::handle
virtual int handle(int)
Definition: Fl_Button.cxx:83
Fl_Type::level
int level
Definition: Fl_Type.h:69
Fl_Widget::changed
unsigned int changed() const
Definition: Fl_Widget.H:781
FL_SUBMENU
This item is a submenu to other items.
Definition: Fl_Menu_Item.H:39
is_name
int is_name(const char *c)
Definition: Fl_Widget_Type.cxx:1958
Fl_Type::is_widget
virtual int is_widget() const
Definition: Fl_Type.cxx:749
Fl_Widget::x
int x() const
Definition: Fl_Widget.H:284
NULL
#define NULL
Definition: forms.H:34
Fl_Type::is_menu_item
virtual int is_menu_item() const
Definition: Fl_Type.cxx:756
FL_MENU_BOX
Definition: Fl_Menu_Item.H:430
Fl_Menu_Item::labelfont
Fl_Font labelfont() const
Definition: Fl_Menu_Item.H:194
fl_draw
FL_EXPORT void fl_draw(const char *str, int x, int y)
Definition: fl_font.cxx:70
write_declare
int write_declare(const char *format,...)
Definition: code.cxx:127
current_widget
Fl_Widget_Type * current_widget
Definition: Fl_Widget_Type.cxx:303
Fl_Widget::when
Fl_When when() const
Definition: Fl_Widget.H:621
Fl_Widget::do_callback
void do_callback()
Definition: Fl_Widget.H:861
Fluid_Image::written
int written
Definition: Fluid_Image.h:38
Fl::event_key
static int event_key()
Definition: Fl.H:723
Fl_Widget::labeltype
Fl_Labeltype labeltype() const
Definition: Fl_Widget.H:456
write_c
void write_c(const char *format,...)
Definition: code.cxx:265
Fl_Button::value
char value() const
Definition: Fl_Button.H:105
b
long b
Definition: jpegint.h:397
Fl_Menu_Item_Type::flags
int flags()
Definition: Fl_Menu_Type.cxx:269
Fl_Menu_Type::click_test
Fl_Type * click_test(int x, int y)
Definition: Fl_Menu_Type.cxx:442
Fl_Input_Choice::menu
const Fl_Menu_Item * menu()
Definition: Fl_Input_Choice.H:214
Fl_Menu_Type::write_code2
void write_code2()
Definition: Fl_Menu_Type.cxx:460
FL_MENU_TOGGLE
Item is a checkbox toggle (shows checkbox for on/off state)
Definition: Fl_Menu_Item.H:34
Fl_Type::first
static Fl_Type * first
Definition: Fl_Type.h:70
Fl_Menu_Button::POPUP3
Definition: Fl_Menu_Button.H:71
Fl_Type::is_button
virtual int is_button() const
Definition: Fl_Type.cxx:752
write_cstring
void write_cstring(const char *s, int length)
Definition: code.cxx:154
Fl_Widget::w
int w() const
Definition: Fl_Widget.H:294
FL_FOREGROUND_COLOR
const Fl_Color FL_FOREGROUND_COLOR
the default foreground color (0) used for labels and text
Definition: Enumerations.H:937
Fl_Value_Input
Definition: Fl_Value_Input.H:56
isdeclare
int isdeclare(const char *c)
Definition: Fl_Widget_Type.cxx:1996
i18n_function
const char * i18n_function
Definition: fluid.cxx:704
submenuflag
static char submenuflag
Definition: Fl_Menu_Type.cxx:51
Fl_Widget_Type::extra_code
const char * extra_code(int n) const
Definition: Fl_Type.h:413
Fl_Choice_Type
Definition: Fl_Type.h:761
Fl_Menu_Item::labeltype
Fl_Labeltype labeltype() const
Definition: Fl_Menu_Item.H:163
p
static menustate * p
Definition: Fl_Menu.cxx:606
Fl_Widget_Type::default_size
static int default_size
Definition: Fl_Type.h:398
Fl_Menu_Item::user_data
void * user_data() const
Definition: Fl_Menu_Item.H:251
Fl_Menu_Item::callback
Fl_Callback_p callback() const
Definition: Fl_Menu_Item.H:217
Fl_Menu_::textfont
Fl_Font textfont() const
Definition: Fl_Menu_.H:155
Fl_Menu_Button_Type
Definition: Fl_Type.h:740
Fl_Menu_Button_type
Fl_Menu_Button_Type Fl_Menu_Button_type
Definition: Fl_Menu_Type.cxx:524
FL_ALT
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:560
Fl_Type::is_class
virtual int is_class() const
Definition: Fl_Type.cxx:764
Fl_Submenu_Type
Definition: Fl_Type.h:690
Fl_Type::user_data
const char * user_data() const
Definition: Fl_Type.h:102
FL_UP_BOX
see figure 1
Definition: Enumerations.H:607
fl_draw.H
utility header to pull drawing functions together
FL_HELVETICA
const Fl_Font FL_HELVETICA
Helvetica (or Arial) normal (0)
Definition: Enumerations.H:879
Fl_Text_Display.H
FL_DOWN_BOX
see figure 1
Definition: Enumerations.H:608
Fl_Menu_Button::POPUP123
Definition: Fl_Menu_Button.H:74
Fl_Type::type_name
virtual const char * type_name()=0
Fl_Widget_Type::hotspot
uchar hotspot() const
Definition: Fl_Type.h:423
Fl_Menu_Item::labelsize
Fl_Fontsize labelsize() const
Definition: Fl_Menu_Item.H:205
Shortcut_Button::handle
int handle(int)
Definition: Fl_Menu_Type.cxx:586
Fl_Widget_Type::o
Fl_Widget * o
Definition: Fl_Type.h:401
Fl_Widget_Type::public_
int public_
Definition: Fl_Type.h:402
FL_FOCUS
Definition: Enumerations.H:283
FL_MENU_VALUE
The on/off state for checkbox/radio buttons (if set, state is 'on')
Definition: Fl_Menu_Item.H:35
Fl_Widget::visible
unsigned int visible() const
Definition: Fl_Widget.H:660
Fl_Widget::hide
virtual void hide()
Definition: Fl_Widget.cxx:283
Fl_Menu_::down_box
Fl_Boxtype down_box() const
Definition: Fl_Menu_.H:173
Fl_Type
Definition: Fl_Type.h:43
reading_file
int reading_file
Definition: factory.cxx:1087
FL_MENU_INVISIBLE
Item will not show up (shortcut will work)
Definition: Fl_Menu_Item.H:37
Fl_Menu_Item_Type
Definition: Fl_Type.h:671
indent
const char * indent()
Definition: code.cxx:99
Fl_Menu_Item::shortcut
int shortcut() const
Definition: Fl_Menu_Item.H:273
Fl_Menu_::textcolor
Fl_Color textcolor() const
Definition: Fl_Menu_.H:163
Fl_Menu_Bar_Type
Definition: Fl_Type.h:826
FL_PUSH
Definition: Enumerations.H:236
Fl_Menu_Item_Type::write_code1
void write_code1()
Definition: Fl_Menu_Type.cxx:326
Fl_Type::callback_name
const char * callback_name()
Definition: Fl_Widget_Type.cxx:2094
Fl_Type::class_name
const char * class_name(const int need_nest) const
Definition: Fl_Function_Type.cxx:1293
Fl_Menu_::textsize
Fl_Fontsize textsize() const
Definition: Fl_Menu_.H:159
Fl_Menu_.H
Fl_Widget::redraw
void redraw()
Definition: Fl.cxx:1782
Fl_Menu_
Definition: Fl_Menu_.H:51
alignment_panel.h
Fl::focus
static Fl_Widget * focus()
Definition: Fl.H:840
Fl_Widget::h
int h() const
Definition: Fl_Widget.H:299
Shortcut_Button::svalue
int svalue
Definition: Shortcut_Button.h:23
Fl_Widget_Type.h
FL_KEYBOARD
Definition: Enumerations.H:315
Fl::pushed
static Fl_Widget * pushed()
Definition: Fl.H:837
i18n_type
int i18n_type
Definition: fluid.cxx:702
Fl_Widget::label
const char * label() const
Definition: Fl_Widget.H:421
Fl_Menu_::value
int value() const
Definition: Fl_Menu_.H:140
Fl_Type::msgnum
int msgnum()
Definition: Fl_Type.cxx:633
Fl_Menu_::mvalue
const Fl_Menu_Item * mvalue() const
Definition: Fl_Menu_.H:138
Fl_Input_Choice_Type
Definition: Fl_Type.h:786
Fl_Input_Choice::textsize
Fl_Fontsize textsize() const
Gets the Fl_Input text field's font size.
Definition: Fl_Input_Choice.H:231
Fl_Widget_Type::copy_properties
virtual void copy_properties()
Definition: Fl_Widget_Type.cxx:2814
Fl_Input_Choice_Type::build_menu
virtual void build_menu()
Definition: Fl_Menu_Type.cxx:53
write_h
void write_h(const char *format,...)
Definition: code.cxx:272
array_name
const char * array_name(Fl_Widget_Type *o)
Definition: Fl_Widget_Type.cxx:1966
FL_MENU_DIVIDER
Creates divider line below this item. Also ends a group of radio buttons.
Definition: Fl_Menu_Item.H:40
Fl_Widget::set_changed
void set_changed()
Definition: Fl_Widget.H:786
Fl_Menu_Button::POPUP1
Definition: Fl_Menu_Button.H:68
set_modflag
void set_modflag(int mf)
Definition: fluid.cxx:1687
Fl_Widget::handle
virtual int handle(int event)
Definition: Fl_Widget.cxx:112
Fl_Widget::active
unsigned int active() const
Definition: Fl_Widget.H:708
Fl_Text_Display
Rich text display widget.
Definition: Fl_Text_Display.H:82
Fl_Menu_Button::POPUP12
Definition: Fl_Menu_Button.H:70
Fl_Input_Choice_type
Fl_Input_Choice_Type Fl_Input_Choice_type
Definition: Fl_Menu_Type.cxx:532
Fl_Output.H
Fl_Widget_Type::image
Fluid_Image * image
Definition: Fl_Type.h:404
Fl_Menu_Item
Definition: Fl_Menu_Item.H:112
unique_id
const char * unique_id(void *o, const char *type, const char *name, const char *label)
Definition: code.cxx:63
Fl_Widget_Type::live_widget
Fl_Widget * live_widget
Definition: Fl_Type.h:395
Fl_Type::label
const char * label() const
Definition: Fl_Type.h:98
Fl_Type::name
const char * name() const
Definition: Fl_Type.h:96
write_number
int write_number
Definition: code.cxx:281
Fl_Type::write_comment_inline_c
void write_comment_inline_c(const char *ind=0L)
Definition: Fl_Type.cxx:1050
Fl_Input_Choice::textcolor
Fl_Color textcolor() const
Gets the Fl_Input text field's text color.
Definition: Fl_Input_Choice.H:223
menu_item_type_menu
Fl_Menu_Item menu_item_type_menu[]
Definition: Fl_Menu_Type.cxx:37
Fl_Menu_Button::POPUP13
Definition: Fl_Menu_Button.H:72
Fl_Value_Input.H
Fl_Type::is_value_input
virtual int is_value_input() const
Definition: Fl_Type.cxx:754
Fl_Widget::type
uchar type() const
Definition: Fl_Widget.H:274
is_id
int is_id(char c)
Definition: code.cxx:40
Fl_Menu_Item_Type::menu_name
const char * menu_name(int &i)
Definition: Fl_Menu_Type.cxx:147
Fl_Button.H
Shortcut_Button::draw
void draw()
Definition: Fl_Menu_Type.cxx:573
Fl_Menu_Item::labelcolor
Fl_Color labelcolor() const
Definition: Fl_Menu_Item.H:181
Fl_Submenu_type
Fl_Submenu_Type Fl_Submenu_type
Definition: Fl_Menu_Type.cxx:134
Fl_Image::label
virtual void label(Fl_Widget *w)
Definition: Fl_Image.cxx:127
Fl_Type::prev
Fl_Type * prev
Definition: Fl_Type.h:71
force_parent
int force_parent
Definition: Fl_Widget_Type.cxx:41
Fl_Menu_Bar_type
Fl_Menu_Bar_Type Fl_Menu_Bar_type
Definition: Fl_Menu_Type.cxx:564
Fl_Type::selected
char selected
Definition: Fl_Type.h:65
Fl_Menu_Button.H
Fl_Menu_Item_Type::write_code2
void write_code2()
Definition: Fl_Menu_Type.cxx:386
Fl_Menu_Button::POPUP2
Definition: Fl_Menu_Button.H:69
Fl_Input_
Definition: Fl_Input_.H:94
shortcut_in_cb
void shortcut_in_cb(Shortcut_Button *i, void *v)
Definition: Fl_Menu_Type.cxx:615
Fl_Type::factory
Fl_Type * factory
Definition: Fl_Type.h:73
Fl_Menu_Item_Type::write_static
void write_static()
Definition: Fl_Menu_Type.cxx:163
FL_RELEASE
Definition: Enumerations.H:244
Fl_Widget::take_focus
int take_focus()
Definition: Fl_Widget.cxx:162
Shortcut_Button
Definition: Shortcut_Button.h:21
Fl_Widget::labelsize
Fl_Fontsize labelsize() const
Definition: Fl_Widget.H:502
fl_message.H
Fl_Widget_Type::write_code2
void write_code2()
Definition: Fl_Widget_Type.cxx:2411
FL_CTRL
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:559
NUM_EXTRA_CODE
#define NUM_EXTRA_CODE
Definition: Fl_Type.h:372
Fl_Menu_Item_Type::make
Fl_Type * make()
Definition: Fl_Menu_Type.cxx:101
Fl_Type::is_input
virtual int is_input() const
Definition: Fl_Type.cxx:753
Fl_Input_Choice
Definition: Fl_Input_Choice.H:95
button_type_menu
Fl_Menu_Item button_type_menu[]
Definition: Fl_Menu_Type.cxx:513
Fl_Choice_type
Fl_Choice_Type Fl_Choice_type
Definition: Fl_Menu_Type.cxx:530
Fl_Menu_Button::POPUP23
Definition: Fl_Menu_Button.H:73
Fl_Widget::image
Fl_Image * image()
Definition: Fl_Widget.H:514
Fl_Menu_Item_Type::write_item
void write_item()
Definition: Fl_Menu_Type.cxx:282
write_public
void write_public(int state)
Definition: Fl_Function_Type.cxx:1447