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_Widget_Type.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Widget type code 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_Group.H>
21 #include <FL/Fl_Table.H>
22 #include <FL/Fl_Input.H>
23 #include "Fl_Widget_Type.h"
24 #include "alignment_panel.h"
25 #include <FL/fl_message.H>
26 #include <FL/Fl_Slider.H>
27 #include <FL/Fl_Spinner.H>
28 #include <FL/Fl_Window.H>
29 #include "../src/flstring.h"
30 #include <stdio.h>
31 #include <stdlib.h>
32 
33 // Make an Fl_Widget_Type subclass instance.
34 // It figures out the automatic size and parent of the new widget,
35 // creates the Fl_Widget (by calling the virtual function _make),
36 // adds it to the Fl_Widget hierarchy, creates a new Fl_Type
37 // instance, sets the widget pointers, and makes all the display
38 // update correctly...
39 
40 extern int reading_file;
42 extern int gridx;
43 extern int gridy;
44 extern int i18n_type;
45 extern const char* i18n_include;
46 extern const char* i18n_function;
47 extern const char* i18n_file;
48 extern const char* i18n_set;
49 
51 
52 int Fl_Widget_Type::is_widget() const {return 1;}
53 int Fl_Widget_Type::is_public() const {return public_;}
54 
55 const char* subclassname(Fl_Type* l) {
56  if (l->is_widget()) {
58  const char* c = p->subclass();
59  if (c) return c;
60  if (l->is_class()) return "Fl_Group";
61  if (p->o->type() == FL_WINDOW+1) return "Fl_Double_Window";
62  if (strcmp(p->type_name(), "Fl_Input") == 0) {
63  if (p->o->type() == FL_FLOAT_INPUT) return "Fl_Float_Input";
64  if (p->o->type() == FL_INT_INPUT) return "Fl_Int_Input";
65  }
66  }
67  return l->type_name();
68 }
69 
70 // Return the ideal widget size...
71 void
72 Fl_Widget_Type::ideal_size(int &w, int &h) {
73  h = o->labelsize();
74  o->measure_label(w, h);
75 
76  w += Fl::box_dw(o->box());
77  h += Fl::box_dh(o->box());
78 
79  if (w < 15) w = 15;
80  if (h < 15) h = 15;
81 }
82 
83 // Return the ideal widget spacing...
84 void
86  if (o->labelsize() < 10)
87  x = y = 0;
88  else if (o->labelsize() < 14)
89  x = y = 5;
90  else
91  x = y = 10;
92 }
93 
95  // Find the current widget, or widget to copy:
97  while (qq && (!qq->is_widget() || qq->is_menu_item())) qq = qq->parent;
98  if (!qq) {
99  fl_message("Please select a widget");
100  return 0;
101  }
102  Fl_Widget_Type* q = (Fl_Widget_Type*)qq;
103  // find the parent widget:
104  Fl_Widget_Type* p = q;
105  if ((force_parent || !p->is_group()) && p->parent->is_widget())
106  p = (Fl_Widget_Type*)(p->parent);
107  force_parent = 0;
108 
109  // Figure out a border between widget and window:
110  int B = p->o->w()/2; if (p->o->h()/2 < B) B = p->o->h()/2; if (B>25) B = 25;
111 
112  int ULX,ULY; // parent's origin in window
113  if (!p->is_window()) { // if it is a group, add corner
114  ULX = p->o->x(); ULY = p->o->y();
115  } else {
116  ULX = ULY = 0;
117  }
118 
119  // Figure out a position and size for the widget
120  int X,Y,W,H;
121  if (is_group()) { // fill the parent with the widget
122  X = ULX+B;
123  W = p->o->w()-B;
124  Y = ULY+B;
125  H = p->o->h()-B;
126  } else if (q != p) { // copy position and size of current widget
127  W = q->o->w();
128  H = q->o->h();
129  X = q->o->x()+W;
130  Y = q->o->y();
131  if (X+W > ULX+p->o->w()) {
132  X = q->o->x();
133  Y = q->o->y()+H;
134  if (Y+H > ULY+p->o->h()) Y = ULY+B;
135  }
136  } else { // just make it small and square...
137  X = ULX+B;
138  Y = ULY+B;
139  W = H = B;
140  }
141 
142  // satisfy the grid requirements (otherwise it edits really strangely):
143  if (gridx>1) {
144  X = (X/gridx)*gridx;
145  W = ((W-1)/gridx+1)*gridx;
146  }
147  if (gridy>1) {
148  Y = (Y/gridy)*gridy;
149  H = ((H-1)/gridy+1)*gridy;
150  }
151 
152  // Construct the Fl_Type:
153  Fl_Widget_Type *t = _make();
154  if (!o) o = widget(0,0,100,100); // create template widget
155  t->factory = this;
156  // Construct the Fl_Widget:
157  t->o = widget(X,Y,W,H);
158  if (reading_file) t->o->label(0);
159  else if (t->o->label()) t->label(t->o->label()); // allow editing
160  t->o->user_data((void*)t);
161  // Put it in the parent:
162  // ((Fl_Group *)(p->o))->add(t->o); (done by Fl_Type::add())
163  // add to browser:
164  t->add(p);
165  t->redraw();
166  return t;
167 }
168 
169 #include "Fluid_Image.h"
170 
172  if (i == image || is_window()) return;
173  if (image) image->decrement();
174  if (i) i->increment();
175  image = i;
176  if (i) i->image(o);
177  else o->image(0);
178  redraw();
179 }
180 
182  if (i == inactive || is_window()) return;
183  if (inactive) inactive->decrement();
184  if (i) i->increment();
185  inactive = i;
186  if (i) i->deimage(o);
187  else o->deimage(0);
188  redraw();
189 }
190 
191 void Fl_Widget_Type::setlabel(const char *n) {
192  o->label(n);
193  redraw();
194 }
195 
197  for (int n=0; n<NUM_EXTRA_CODE; n++) {extra_code_[n] = 0; }
198  subclass_ = 0;
199  hotspot_ = 0;
200  tooltip_ = 0;
201  image_name_ = 0;
202  inactive_name_ = 0;
203  image = 0;
204  inactive = 0;
205  xclass = 0;
206  o = 0;
207  public_ = 1;
208 }
209 
211  if (o) {
212  o->hide();
213  if (o->parent()) ((Fl_Group*)o->parent())->remove(*o);
214  delete o;
215  }
216  if (subclass_) free((void*)subclass_);
217  if (tooltip_) free((void*)tooltip_);
218  if (image_name_) {
219  free((void*)image_name_);
220  if (image) image->decrement();
221  }
222  if (inactive_name_) {
223  free((void*)inactive_name_);
224  if (inactive) inactive->decrement();
225  }
226  for (int n=0; n<NUM_EXTRA_CODE; n++) {
227  if (extra_code_[n]) free((void*) extra_code_[n]);
228  }
229 }
230 
231 void Fl_Widget_Type::extra_code(int m,const char *n) {
232  storestring(n,extra_code_[m]);
233 }
234 
235 extern void redraw_browser();
236 void Fl_Widget_Type::subclass(const char *n) {
237  if (storestring(n,subclass_) && visible)
238  redraw_browser();
239 }
240 
241 void Fl_Widget_Type::tooltip(const char *n) {
243  o->tooltip(n);
244 }
245 
246 void Fl_Widget_Type::image_name(const char *n) {
249 }
250 
251 void Fl_Widget_Type::inactive_name(const char *n) {
254 }
255 
257  Fl_Type *t = this;
258  if (is_menu_item()) {
259  // find the menu button that parents this menu:
260  do t = t->parent; while (t && t->is_menu_item());
261  // kludge to cause build_menu to be called again:
262  t->add_child(0,0);
263  } else {
264  while (t->parent && t->parent->is_widget()) t = t->parent;
265  ((Fl_Widget_Type*)t)->o->redraw();
266  }
267 }
268 
269 // the recursive part sorts all children, returns pointer to next:
270 Fl_Type *sort(Fl_Type *parent) {
271  Fl_Type *f,*n=0;
272  for (f = parent ? parent->next : Fl_Type::first; ; f = n) {
273  if (!f || (parent && f->level <= parent->level)) return f;
274  n = sort(f);
275  if (!f->selected || (!f->is_widget() || f->is_menu_item())) continue;
276  Fl_Widget* fw = ((Fl_Widget_Type*)f)->o;
277  Fl_Type *g; // we will insert before this
278  for (g = parent->next; g != f; g = g->next) {
279  if (!g->selected || g->level > f->level) continue;
280  Fl_Widget* gw = ((Fl_Widget_Type*)g)->o;
281  if (gw->y() > fw->y()) break;
282  if (gw->y() == fw->y() && gw->x() > fw->x()) break;
283  }
284  if (g != f) f->move_before(g);
285  }
286 }
287 
289 // The control panels!
290 
291 #include "widget_panel.h"
292 #include <FL/fl_show_colormap.H>
293 
295 
296 // All the callbacks use the argument to indicate whether to load or store.
297 // This avoids the need for pointers to all the widgets, and keeps the
298 // code localized in the callbacks.
299 // A value of LOAD means to load. The hope is that this will not collide
300 // with any actual useful values for the argument. I also use this to
301 // initialized parts of the widget that are nyi by fluid.
302 
303 Fl_Widget_Type *current_widget; // one of the selected ones
304 void* const LOAD = (void *)"LOAD"; // "magic" pointer to indicate that we need to load values into the dialog
305 static int numselected; // number selected
306 static int haderror;
307 
308 void name_cb(Fl_Input* o, void *v) {
309  if (v == LOAD) {
310  static char buf[1024];
311  if (numselected != 1) {
312  snprintf(buf, sizeof(buf), "Widget Properties (%d widgets)", numselected);
313  o->hide();
314  } else {
316  o->show();
317  snprintf(buf, sizeof(buf), "%s Properties", current_widget->title());
318  }
319 
320  the_panel->label(buf);
321  } else {
322  if (numselected == 1) {
323  current_widget->name(o->value());
324  // I don't update window title, as it probably is being closed
325  // and wm2 (a window manager) barfs if you retitle and then
326  // hide a window:
327  // ((Fl_Window*)(o->parent()->parent()->parent()))->label(current_widget->title());
328  }
329  }
330 }
331 
332 void name_public_member_cb(Fl_Choice* i, void* v) {
333  if (v == LOAD) {
335  if (current_widget->is_in_class()) i->show(); else i->hide();
336  } else {
337  int mod = 0;
338  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
339  if (o->selected && o->is_widget()) {
340  Fl_Widget_Type *w = ((Fl_Widget_Type*)o);
341  if (w->is_in_class()) {
342  w->public_ = i->value();
343  } else {
344  // if this is not in a class, it can be only private or public
345  w->public_ = (i->value()>0);
346  }
347  mod = 1;
348  }
349  }
350  if (mod) {
351  set_modflag(1);
352  redraw_browser();
353  }
354  }
355 }
356 
357 void name_public_cb(Fl_Choice* i, void* v) {
358  if (v == LOAD) {
360  if (current_widget->is_in_class()) i->hide(); else i->show();
361  } else {
362  int mod = 0;
363  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
364  if (o->selected && o->is_widget()) {
365  ((Fl_Widget_Type*)o)->public_ = i->value();
366  mod = 1;
367  }
368  }
369  if (mod) {
370  set_modflag(1);
371  redraw_browser();
372  }
373  }
374 }
375 
376 static char* oldlabel;
377 static unsigned oldlabellen;
378 
379 void label_cb(Fl_Input* i, void *v) {
380  if (v == LOAD) {
382  if (strlen(i->value()) >= oldlabellen) {
383  oldlabellen = strlen(i->value())+128;
384  oldlabel = (char*)realloc(oldlabel,oldlabellen);
385  }
386  strcpy(oldlabel,i->value());
387  } else {
388  int mod = 0;
389  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
390  if (o->selected && o->is_widget()) {
391  o->label(i->value());
392  mod = 1;
393  }
394  }
395  if (mod) set_modflag(1);
396  }
397 }
398 
400 
401 void image_cb(Fl_Input* i, void *v) {
402  if (v == LOAD) {
403  image_input = i;
405  i->activate();
406  i->static_value(((Fl_Widget_Type*)current_widget)->image_name());
407  } else i->deactivate();
408  } else {
409  int mod = 0;
410  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
411  if (o->selected && o->is_widget()) {
412  ((Fl_Widget_Type*)o)->image_name(i->value());
413  mod = 1;
414  }
415  }
416  if (mod) set_modflag(1);
417  }
418 }
419 
420 void image_browse_cb(Fl_Button* b, void *v) {
421  if (v == LOAD) {
423  b->activate();
424  else
425  b->deactivate();
426  } else {
427  int mod = 0;
428  if (ui_find_image(image_input->value())) {
430  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
431  if (o->selected && o->is_widget()) {
432  ((Fl_Widget_Type*)o)->image_name(ui_find_image_name);
433  mod = 1;
434  }
435  }
436  if (mod) set_modflag(1);
437  }
438  }
439 }
440 
442 
443 void inactive_cb(Fl_Input* i, void *v) {
444  if (v == LOAD) {
445  inactive_input = i;
447  i->activate();
448  i->static_value(((Fl_Widget_Type*)current_widget)->inactive_name());
449  } else i->deactivate();
450  } else {
451  int mod = 0;
452  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
453  if (o->selected && o->is_widget()) {
454  ((Fl_Widget_Type*)o)->inactive_name(i->value());
455  mod = 1;
456  }
457  }
458  if (mod) set_modflag(1);
459  }
460 }
461 
462 void inactive_browse_cb(Fl_Button* b, void *v) {
463  if (v == LOAD) {
465  b->activate();
466  else
467  b->deactivate();
468  } else {
469  int mod = 0;
472  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
473  if (o->selected && o->is_widget()) {
474  ((Fl_Widget_Type*)o)->inactive_name(ui_find_image_name);
475  mod = 1;
476  }
477  }
478  if (mod) set_modflag(1);
479  }
480  }
481 }
482 
483 void tooltip_cb(Fl_Input* i, void *v) {
484  if (v == LOAD) {
485  if (current_widget->is_widget()) {
486  i->activate();
487  i->static_value(((Fl_Widget_Type*)current_widget)->tooltip());
488  } else i->deactivate();
489  } else {
490  int mod = 0;
491  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
492  if (o->selected && o->is_widget()) {
493  ((Fl_Widget_Type*)o)->tooltip(i->value());
494  mod = 1;
495  }
496  }
497  if (mod) set_modflag(1);
498  }
499 }
500 
502 
503 void x_cb(Fl_Value_Input *i, void *v) {
504  if (v == LOAD) {
505  x_input = i;
506  if (current_widget->is_widget()) {
507  i->value(((Fl_Widget_Type *)current_widget)->o->x());
508  x_input->activate();
509  } else x_input->deactivate();
510  } else {
511  int mod = 0;
512  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
513  if (o->selected && o->is_widget()) {
514  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
515  w->resize((int)i->value(), w->y(), w->w(), w->h());
516  if (w->window()) w->window()->redraw();
517  if (o->is_window()) {
518  ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(),
519  gridx, gridy, 0);
520  }
521  mod = 1;
522  }
523  }
524  if (mod) set_modflag(1);
525  }
526 }
527 
528 void y_cb(Fl_Value_Input *i, void *v) {
529  if (v == LOAD) {
530  y_input = i;
531  if (current_widget->is_widget()) {
532  i->value(((Fl_Widget_Type *)current_widget)->o->y());
533  y_input->activate();
534  } else y_input->deactivate();
535  } else {
536  int mod = 0;
537  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
538  if (o->selected && o->is_widget()) {
539  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
540  w->resize(w->x(), (int)i->value(), w->w(), w->h());
541  if (w->window()) w->window()->redraw();
542  if (o->is_window()) {
543  ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(),
544  gridx, gridy, 0);
545  }
546  mod = 1;
547  }
548  }
549  if (mod) set_modflag(1);
550  }
551 }
552 
553 void w_cb(Fl_Value_Input *i, void *v) {
554  if (v == LOAD) {
555  w_input = i;
556  if (current_widget->is_widget()) {
557  i->value(((Fl_Widget_Type *)current_widget)->o->w());
558  w_input->activate();
559  } else w_input->deactivate();
560  } else {
561  int mod = 0;
562  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
563  if (o->selected && o->is_widget()) {
564  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
565  w->resize(w->x(), w->y(), (int)i->value(), w->h());
566  if (w->window()) w->window()->redraw();
567  if (o->is_window()) {
568  ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(),
569  gridx, gridy, 0);
570  }
571  mod = 1;
572  }
573  }
574  if (mod) set_modflag(1);
575  }
576 }
577 
578 void h_cb(Fl_Value_Input *i, void *v) {
579  if (v == LOAD) {
580  h_input = i;
581  if (current_widget->is_widget()) {
582  i->value(((Fl_Widget_Type *)current_widget)->o->h());
583  h_input->activate();
584  } else h_input->deactivate();
585  } else {
586  int mod = 0;
587  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
588  if (o->selected && o->is_widget()) {
589  Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
590  w->resize(w->x(), w->y(), w->w(), (int)i->value());
591  if (w->window()) w->window()->redraw();
592  if (o->is_window()) {
593  ((Fl_Window *)w)->size_range(gridx, gridy, Fl::w(), Fl::h(),
594  gridx, gridy, 0);
595  }
596  mod = 1;
597  }
598  }
599  if (mod) set_modflag(1);
600  }
601 }
602 
603 void wc_relative_cb(Fl_Light_Button *i, void *v) {
604  if (v == LOAD) {
605  if (!strcmp(current_widget->type_name(), "widget_class")) {
606  i->show();
607  i->value(((Fl_Widget_Class_Type *)current_widget)->wc_relative);
608  } else {
609  i->hide();
610  }
611  } else {
612  int mod = 0;
613  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
614  if (o->selected && !strcmp(current_widget->type_name(), "widget_class")) {
616  t->wc_relative = i->value();
617  mod = 1;
618  }
619  }
620  if (mod) set_modflag(1);
621  }
622 }
623 
625 
626 // turn number to string or string to number for saving to file:
627 // does not work for hierarchial menus!
628 
629 const char *item_name(Fl_Menu_Item* m, int i) {
630  if (m) {
631  while (m->label()) {
632  if (m->argument() == i) return m->label();
633  m++;
634  }
635  }
636  static char buffer[20];
637  sprintf(buffer, "%d", i);
638  return buffer;
639 }
640 int item_number(Fl_Menu_Item* m, const char* i) {
641  if (m && i) {
642  if (i[0]=='F' && i[1]=='L' && i[2]=='_') i += 3;
643  while (m->label()) {
644  if (!strcmp(m->label(), i)) return int(m->argument());
645  m++;
646  }
647  }
648  return atoi(i);
649 }
650 
651 #define ZERO_ENTRY 1000
652 
654 {"NO_BOX",0,0,(void *)ZERO_ENTRY},
655 {"boxes",0,0,0,FL_SUBMENU},
656 {"UP_BOX",0,0,(void *)FL_UP_BOX},
657 {"DOWN_BOX",0,0,(void *)FL_DOWN_BOX},
658 {"FLAT_BOX",0,0,(void *)FL_FLAT_BOX},
659 {"BORDER_BOX",0,0,(void *)FL_BORDER_BOX},
660 {"THIN_UP_BOX",0,0,(void *)FL_THIN_UP_BOX},
661 {"THIN_DOWN_BOX",0,0,(void *)FL_THIN_DOWN_BOX},
662 {"ENGRAVED_BOX",0,0,(void *)FL_ENGRAVED_BOX},
663 {"EMBOSSED_BOX",0,0,(void *)FL_EMBOSSED_BOX},
664 {"ROUND_UP_BOX",0,0,(void *)FL_ROUND_UP_BOX},
665 {"ROUND_DOWN_BOX",0,0,(void *)FL_ROUND_DOWN_BOX},
666 {"DIAMOND_UP_BOX",0,0,(void *)FL_DIAMOND_UP_BOX},
667 {"DIAMOND_DOWN_BOX",0,0,(void *)FL_DIAMOND_DOWN_BOX},
668 {"SHADOW_BOX",0,0,(void *)FL_SHADOW_BOX},
669 {"ROUNDED_BOX",0,0,(void *)FL_ROUNDED_BOX},
670 {"RSHADOW_BOX",0,0,(void *)FL_RSHADOW_BOX},
671 {"RFLAT_BOX",0,0,(void *)FL_RFLAT_BOX},
672 {"OVAL_BOX",0,0,(void *)FL_OVAL_BOX},
673 {"OSHADOW_BOX",0,0,(void *)FL_OSHADOW_BOX},
674 {"OFLAT_BOX",0,0,(void *)FL_OFLAT_BOX},
675 {"PLASTIC_UP_BOX",0,0,(void *)FL_PLASTIC_UP_BOX},
676 {"PLASTIC_DOWN_BOX",0,0,(void *)FL_PLASTIC_DOWN_BOX},
677 {"PLASTIC_THIN_UP_BOX",0,0,(void *)FL_PLASTIC_THIN_UP_BOX},
678 {"PLASTIC_THIN_DOWN_BOX",0,0,(void *)FL_PLASTIC_THIN_DOWN_BOX},
679 {"PLASTIC_ROUND_UP_BOX",0,0,(void *)FL_PLASTIC_ROUND_UP_BOX},
680 {"PLASTIC_ROUND_DOWN_BOX",0,0,(void *)FL_PLASTIC_ROUND_DOWN_BOX},
681 {"GTK_UP_BOX",0,0,(void *)FL_GTK_UP_BOX},
682 {"GTK_DOWN_BOX",0,0,(void *)FL_GTK_DOWN_BOX},
683 {"GTK_THIN_UP_BOX",0,0,(void *)FL_GTK_THIN_UP_BOX},
684 {"GTK_THIN_DOWN_BOX",0,0,(void *)FL_GTK_THIN_DOWN_BOX},
685 {"GTK_ROUND_UP_BOX",0,0,(void *)FL_GTK_ROUND_UP_BOX},
686 {"GTK_ROUND_DOWN_BOX",0,0,(void *)FL_GTK_ROUND_DOWN_BOX},
687 {"GLEAM_UP_BOX",0,0,(void *)FL_GLEAM_UP_BOX},
688 {"GLEAM_DOWN_BOX",0,0,(void *)FL_GLEAM_DOWN_BOX},
689 {"GLEAM_THIN_UP_BOX",0,0,(void *)FL_GLEAM_THIN_UP_BOX},
690 {"GLEAM_THIN_DOWN_BOX",0,0,(void *)FL_GLEAM_THIN_DOWN_BOX},
691 {"GLEAM_ROUND_UP_BOX",0,0,(void *)FL_GLEAM_ROUND_UP_BOX},
692 {"GLEAM_ROUND_DOWN_BOX",0,0,(void *)FL_GLEAM_ROUND_DOWN_BOX},
693 {0},
694 {"frames",0,0,0,FL_SUBMENU},
695 {"UP_FRAME",0,0,(void *)FL_UP_FRAME},
696 {"DOWN_FRAME",0,0,(void *)FL_DOWN_FRAME},
697 {"THIN_UP_FRAME",0,0,(void *)FL_THIN_UP_FRAME},
698 {"THIN_DOWN_FRAME",0,0,(void *)FL_THIN_DOWN_FRAME},
699 {"ENGRAVED_FRAME",0,0,(void *)FL_ENGRAVED_FRAME},
700 {"EMBOSSED_FRAME",0,0,(void *)FL_EMBOSSED_FRAME},
701 {"BORDER_FRAME",0,0,(void *)FL_BORDER_FRAME},
702 {"SHADOW_FRAME",0,0,(void *)FL_SHADOW_FRAME},
703 {"ROUNDED_FRAME",0,0,(void *)FL_ROUNDED_FRAME},
704 {"OVAL_FRAME",0,0,(void *)FL_OVAL_FRAME},
705 {"PLASTIC_UP_FRAME",0,0,(void *)FL_PLASTIC_UP_FRAME},
706 {"PLASTIC_DOWN_FRAME",0,0,(void *)FL_PLASTIC_DOWN_FRAME},
707 {"GTK_UP_FRAME",0,0,(void *)FL_GTK_UP_FRAME},
708 {"GTK_DOWN_FRAME",0,0,(void *)FL_GTK_DOWN_FRAME},
709 {"GTK_THIN_UP_FRAME",0,0,(void *)FL_GTK_THIN_UP_FRAME},
710 {"GTK_THIN_DOWN_FRAME",0,0,(void *)FL_GTK_THIN_DOWN_FRAME},
711 {"GLEAM_UP_FRAME",0,0,(void *)FL_GLEAM_UP_FRAME},
712 {"GLEAM_DOWN_FRAME",0,0,(void *)FL_GLEAM_DOWN_FRAME},
713 {0},
714 {0}};
715 
716 const char *boxname(int i) {
717  if (!i) i = ZERO_ENTRY;
718  for (int j = 0; j < int(sizeof(boxmenu)/sizeof(*boxmenu)); j++)
719  if (boxmenu[j].argument() == i) return boxmenu[j].label();
720  return 0;
721 }
722 
723 int boxnumber(const char *i) {
724  if (i[0]=='F' && i[1]=='L' && i[2]=='_') i += 3;
725  for (int j = 0; j < int(sizeof(boxmenu)/sizeof(*boxmenu)); j++)
726  if (boxmenu[j].label() && !strcmp(boxmenu[j].label(), i)) {
727  return int(boxmenu[j].argument());
728  }
729  return 0;
730 }
731 
732 void box_cb(Fl_Choice* i, void *v) {
733  if (v == LOAD) {
734  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
735  int n = current_widget->o->box(); if (!n) n = ZERO_ENTRY;
736  for (int j = 0; j < int(sizeof(boxmenu)/sizeof(*boxmenu)); j++)
737  if (boxmenu[j].argument() == n) {i->value(j); break;}
738  } else {
739  int mod = 0;
740  int m = i->value();
741  int n = int(boxmenu[m].argument());
742  if (!n) return; // should not happen
743  if (n == ZERO_ENTRY) n = 0;
744  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
745  if (o->selected && o->is_widget()) {
747  q->o->box((Fl_Boxtype)n);
748  q->redraw();
749  mod = 1;
750  }
751  }
752  if (mod) set_modflag(1);
753  }
754 }
755 
756 void down_box_cb(Fl_Choice* i, void *v) {
757  if (v == LOAD) {
758  int n;
760  n = ((Fl_Button*)(current_widget->o))->down_box();
761  else if (!strcmp(current_widget->type_name(), "Fl_Input_Choice"))
763  else if (current_widget->is_menu_button())
764  n = ((Fl_Menu_*)(current_widget->o))->down_box();
765  else {
766  i->deactivate(); return;
767  }
768  i->activate();
769  if (!n) n = ZERO_ENTRY;
770  for (int j = 0; j < int(sizeof(boxmenu)/sizeof(*boxmenu)); j++)
771  if (boxmenu[j].argument() == n) {i->value(j); break;}
772  } else {
773  int mod = 0;
774  int m = i->value();
775  int n = int(boxmenu[m].argument());
776  if (!n) return; // should not happen
777  if (n == ZERO_ENTRY) n = 0;
778  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
779  if (o->selected) {
780  if (o->is_button() && !o->is_menu_item()) {
782  ((Fl_Button*)(q->o))->down_box((Fl_Boxtype)n);
783  if (((Fl_Button*)(q->o))->value()) q->redraw();
784  } else if (!strcmp(o->type_name(), "Fl_Input_Choice")) {
786  ((Fl_Input_Choice*)(q->o))->down_box((Fl_Boxtype)n);
787  } else if (o->is_menu_button()) {
789  ((Fl_Menu_*)(q->o))->down_box((Fl_Boxtype)n);
790  }
791  mod = 1;
792  }
793  }
794  if (mod) set_modflag(1);
795  }
796 }
797 
799 
801  {"Never",0,0,(void*)ZERO_ENTRY},
802  {"Release",0,0,(void*)FL_WHEN_RELEASE},
803  {"Changed",0,0,(void*)FL_WHEN_CHANGED},
804  {"Enter key",0,0,(void*)FL_WHEN_ENTER_KEY},
805  //{"Release or Enter",0,0,(void*)(FL_WHEN_ENTER_KEY|FL_WHEN_RELEASE)},
806  {0}};
807 
809  {"FL_WHEN_NEVER",0,0,(void*)(FL_WHEN_NEVER)},
810  {"FL_WHEN_CHANGED",0,0,(void*)(FL_WHEN_CHANGED)},
811  {"FL_WHEN_RELEASE",0,0,(void*)(FL_WHEN_RELEASE)},
812  {"FL_WHEN_RELEASE_ALWAYS",0,0,(void*)(FL_WHEN_RELEASE_ALWAYS)},
813  {"FL_WHEN_ENTER_KEY",0,0,(void*)(FL_WHEN_ENTER_KEY)},
814  {"FL_WHEN_ENTER_KEY_ALWAYS",0,0,(void*)(FL_WHEN_ENTER_KEY_ALWAYS)},
815  {0}};
816 
817 void when_cb(Fl_Choice* i, void *v) {
818  if (v == LOAD) {
819  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
820  int n = current_widget->o->when() & (~FL_WHEN_NOT_CHANGED);
821  if (!n) n = ZERO_ENTRY;
822  for (int j = 0; j < int(sizeof(whenmenu)/sizeof(*whenmenu)); j++)
823  if (whenmenu[j].argument() == n) {i->value(j); break;}
824  } else {
825  int mod = 0;
826  int m = i->value();
827  int n = int(whenmenu[m].argument());
828  if (!n) return; // should not happen
829  if (n == ZERO_ENTRY) n = 0;
830  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
831  if (o->selected && o->is_widget()) {
833  q->o->when(n|(q->o->when()&FL_WHEN_NOT_CHANGED));
834  mod = 1;
835  }
836  }
837  if (mod) set_modflag(1);
838  }
839 }
840 
841 void when_button_cb(Fl_Light_Button* i, void *v) {
842  if (v == LOAD) {
843  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
845  } else {
846  int mod = 0;
847  int n = i->value() ? FL_WHEN_NOT_CHANGED : 0;
848  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
849  if (o->selected && o->is_widget()) {
851  q->o->when(n|(q->o->when()&~FL_WHEN_NOT_CHANGED));
852  mod = 1;
853  }
854  }
855  if (mod) set_modflag(1);
856  }
857 }
858 
860  if (is_window()) return ((Fl_Window*)o)->resizable() != 0;
861  Fl_Group* p = (Fl_Group*)o->parent();
862  if (p) return p->resizable() == o;
863  else return 0;
864 }
865 
867  if (v) {
868  if (resizable()) return;
869  if (is_window()) ((Fl_Window*)o)->resizable(o);
870  else {
871  Fl_Group* p = (Fl_Group*)o->parent();
872  if (p) p->resizable(o);
873  }
874  } else {
875  if (!resizable()) return;
876  if (is_window()) {
877  ((Fl_Window*)o)->resizable(0);
878  } else {
879  Fl_Group* p = (Fl_Group*)o->parent();
880  if (p) p->resizable(0);
881  }
882  }
883 }
884 
885 void resizable_cb(Fl_Light_Button* i,void* v) {
886  if (v == LOAD) {
887  if (current_widget->is_menu_item()) {i->deactivate(); return;}
888  if (numselected > 1) {i->deactivate(); return;}
889  i->activate();
891  } else {
893  set_modflag(1);
894  }
895 }
896 
897 void hotspot_cb(Fl_Light_Button* i,void* v) {
898  if (v == LOAD) {
899  if (numselected > 1) {i->deactivate(); return;}
900  if (current_widget->is_menu_item()) i->label("divider");
901  else i->label("hotspot");
902  i->activate();
904  } else {
906  if (current_widget->is_menu_item()) {current_widget->redraw(); return;}
907  if (i->value()) {
909  if (!p || !p->is_widget()) return;
910  while (!p->is_window()) p = p->parent;
911  for (Fl_Type *o = p->next; o && o->level > p->level; o = o->next) {
912  if (o->is_widget() && o != current_widget)
913  ((Fl_Widget_Type*)o)->hotspot(0);
914  }
915  }
916  set_modflag(1);
917  }
918 }
919 
920 void visible_cb(Fl_Light_Button* i, void* v) {
921  if (v == LOAD) {
922  i->value(current_widget->o->visible());
923  if (current_widget->is_window()) i->deactivate();
924  else i->activate();
925  } else {
926  int mod = 0;
927  int n = i->value();
928  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
929  if (o->selected && o->is_widget()) {
931  n ? q->o->show() : q->o->hide();
932  q->redraw();
933  mod = 1;
934  if (n && q->parent && q->parent->type_name()) {
935  if (!strcmp(q->parent->type_name(), "Fl_Tabs")) {
936  ((Fl_Tabs *)q->o->parent())->value(q->o);
937  } else if (!strcmp(q->parent->type_name(), "Fl_Wizard")) {
938  ((Fl_Wizard *)q->o->parent())->value(q->o);
939  }
940  }
941  }
942  }
943  if (mod) set_modflag(1);
944  }
945 }
946 
947 void active_cb(Fl_Light_Button* i, void* v) {
948  if (v == LOAD) {
949  i->value(current_widget->o->active());
950  if (current_widget->is_window()) i->deactivate();
951  else i->activate();
952  } else {
953  int mod = 0;
954  int n = i->value();
955  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
956  if (o->selected && o->is_widget()) {
958  n ? q->o->activate() : q->o->deactivate();
959  q->redraw();
960  mod = 1;
961  }
962  }
963  if (mod) set_modflag(1);
964  }
965 }
966 
968 
970 {"Helvetica"},
971 {"Helvetica bold"},
972 {"Helvetica italic"},
973 {"Helvetica bold italic"},
974 {"Courier"},
975 {"Courier bold"},
976 {"Courier italic"},
977 {"Courier bold italic"},
978 {"Times"},
979 {"Times bold"},
980 {"Times italic"},
981 {"Times bold italic"},
982 {"Symbol"},
983 {"Terminal"},
984 {"Terminal Bold"},
985 {"Zapf Dingbats"},
986 {0}};
987 
988 void labelfont_cb(Fl_Choice* i, void *v) {
989  if (v == LOAD) {
990  int n = current_widget->o->labelfont();
991  if (n > 15) n = 0;
992  i->value(n);
993  } else {
994  int mod = 0;
995  int n = i->value();
996  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
997  if (o->selected && o->is_widget()) {
999  q->o->labelfont(n);
1000  q->redraw();
1001  mod = 1;
1002  }
1003  }
1004  if (mod) set_modflag(1);
1005  }
1006 }
1007 
1008 void labelsize_cb(Fl_Value_Input* i, void *v) {
1009  int n;
1010  if (v == LOAD) {
1011  n = current_widget->o->labelsize();
1012  } else {
1013  int mod = 0;
1014  n = int(i->value());
1015  if (n <= 0) n = Fl_Widget_Type::default_size;
1016  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1017  if (o->selected && o->is_widget()) {
1018  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1019  q->o->labelsize(n);
1020  q->redraw();
1021  mod = 1;
1022  }
1023  }
1024  if (mod) set_modflag(1);
1025  }
1026  i->value(n);
1027 }
1028 
1029 extern const char *ui_find_image_name;
1030 
1032  {"NORMAL_LABEL",0,0,(void*)0},
1033  {"SHADOW_LABEL",0,0,(void*)FL_SHADOW_LABEL},
1034  {"ENGRAVED_LABEL",0,0,(void*)FL_ENGRAVED_LABEL},
1035  {"EMBOSSED_LABEL",0,0,(void*)FL_EMBOSSED_LABEL},
1036  {"NO_LABEL",0,0,(void*)(FL_NO_LABEL)},
1037 {0}};
1038 
1039 void labeltype_cb(Fl_Choice* i, void *v) {
1040  if (v == LOAD) {
1041  int n;
1042  n = current_widget->o->labeltype();
1043  i->when(FL_WHEN_RELEASE);
1044  for (int j = 0; j < int(sizeof(labeltypemenu)/sizeof(*labeltypemenu)); j++)
1045  if (labeltypemenu[j].argument() == n) {i->value(j); break;}
1046  } else {
1047  int mod = 0;
1048  int m = i->value();
1049  int n = int(labeltypemenu[m].argument());
1050  if (n<0) return; // should not happen
1051  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1052  if (o->selected && o->is_widget()) {
1054  p->o->labeltype((Fl_Labeltype)n);
1055  p->redraw();
1056  mod = 1;
1057  }
1058  }
1059  if (mod) set_modflag(1);
1060  }
1061 }
1062 
1064 
1065 void color_cb(Fl_Button* i, void *v) {
1066  Fl_Color c = current_widget->o->color();
1067  if (v == LOAD) {
1068  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
1069  } else {
1070  int mod = 0;
1071  Fl_Color d = fl_show_colormap(c);
1072  if (d == c) return;
1073  c = d;
1074  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1075  if (o->selected && o->is_widget()) {
1076  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1077  q->o->color(c); q->o->redraw();
1078  if (q->parent && q->parent->type_name() == tabs_type_name) {
1079  if (q->o->parent()) q->o->parent()->redraw();
1080  }
1081  mod = 1;
1082  }
1083  }
1084  if (mod) set_modflag(1);
1085  }
1086  i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw();
1087 }
1088 
1089 void color2_cb(Fl_Button* i, void *v) {
1091  if (v == LOAD) {
1092  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
1093  } else {
1094  int mod = 0;
1095  Fl_Color d = fl_show_colormap(c);
1096  if (d == c) return;
1097  c = d;
1098  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1099  if (o->selected && o->is_widget()) {
1100  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1101  q->o->selection_color(c); q->o->redraw();
1102  mod = 1;
1103  }
1104  }
1105  if (mod) set_modflag(1);
1106  }
1107  i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw();
1108 }
1109 
1110 void labelcolor_cb(Fl_Button* i, void *v) {
1112  if (v != LOAD) {
1113  int mod = 0;
1114  Fl_Color d = fl_show_colormap(c);
1115  if (d == c) return;
1116  c = d;
1117  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1118  if (o->selected && o->is_widget()) {
1119  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1120  q->o->labelcolor(c); q->redraw();
1121  mod = 1;
1122  }
1123  }
1124  if (mod) set_modflag(1);
1125  }
1126  i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw();
1127 }
1128 
1129 static Fl_Button* relative(Fl_Widget* o, int i) {
1130  Fl_Group* g = (Fl_Group*)(o->parent());
1131  return (Fl_Button*)(g->child(g->find(*o)+i));
1132 }
1133 
1135  {"FL_ALIGN_CENTER",0,0,(void*)(fl_intptr_t)(FL_ALIGN_CENTER)},
1136  {"FL_ALIGN_TOP",0,0,(void*)(fl_intptr_t)(FL_ALIGN_TOP)},
1137  {"FL_ALIGN_BOTTOM",0,0,(void*)(fl_intptr_t)(FL_ALIGN_BOTTOM)},
1138  {"FL_ALIGN_LEFT",0,0,(void*)(fl_intptr_t)(FL_ALIGN_LEFT)},
1139  {"FL_ALIGN_RIGHT",0,0,(void*)(fl_intptr_t)(FL_ALIGN_RIGHT)},
1140  {"FL_ALIGN_INSIDE",0,0,(void*)(fl_intptr_t)(FL_ALIGN_INSIDE)},
1141  {"FL_ALIGN_CLIP",0,0,(void*)(fl_intptr_t)(FL_ALIGN_CLIP)},
1142  {"FL_ALIGN_WRAP",0,0,(void*)(fl_intptr_t)(FL_ALIGN_WRAP)},
1143  {"FL_ALIGN_TEXT_OVER_IMAGE",0,0,(void*)(fl_intptr_t)(FL_ALIGN_TEXT_OVER_IMAGE)},
1144  {"FL_ALIGN_TOP_LEFT",0,0,(void*)(fl_intptr_t)(FL_ALIGN_TOP_LEFT)},
1145  {"FL_ALIGN_TOP_RIGHT",0,0,(void*)(fl_intptr_t)(FL_ALIGN_TOP_RIGHT)},
1146  {"FL_ALIGN_BOTTOM_LEFT",0,0,(void*)(fl_intptr_t)(FL_ALIGN_BOTTOM_LEFT)},
1147  {"FL_ALIGN_BOTTOM_RIGHT",0,0,(void*)(fl_intptr_t)(FL_ALIGN_BOTTOM_RIGHT)},
1148  {"FL_ALIGN_LEFT_TOP",0,0,(void*)(fl_intptr_t)(FL_ALIGN_LEFT_TOP)},
1149  {"FL_ALIGN_RIGHT_TOP",0,0,(void*)(fl_intptr_t)(FL_ALIGN_RIGHT_TOP)},
1150  {"FL_ALIGN_LEFT_BOTTOM",0,0,(void*)(fl_intptr_t)(FL_ALIGN_LEFT_BOTTOM)},
1151  {"FL_ALIGN_RIGHT_BOTTOM",0,0,(void*)(fl_intptr_t)(FL_ALIGN_RIGHT_BOTTOM)},
1152 {0}};
1153 
1154 void align_cb(Fl_Button* i, void *v) {
1156  if (v == LOAD) {
1157  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
1158  i->value(current_widget->o->align() & b);
1159  } else {
1160  int mod = 0;
1161  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1162  if (o->selected && o->is_widget()) {
1163  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1164  Fl_Align x = q->o->align();
1165  Fl_Align y;
1166  if (i->value()) {
1167  y = x | b;
1168  if (b == FL_ALIGN_LEFT || b == FL_ALIGN_TOP) {
1169  Fl_Button *b1 = relative(i,+1);
1170  b1->clear();
1171  y = y & ~(b1->argument());
1172  }
1173  if (b == FL_ALIGN_RIGHT || b == FL_ALIGN_BOTTOM) {
1174  Fl_Button *b1 = relative(i,-1);
1175  b1->clear();
1176  y = y & ~(b1->argument());
1177  }
1178  } else {
1179  y = x & ~b;
1180  }
1181  if (x != y) {
1182  q->o->align(y);
1183  q->redraw();
1184  mod = 1;
1185  }
1186  }
1187  }
1188  if (mod) set_modflag(1);
1189  }
1190 }
1191 
1192 void align_position_cb(Fl_Choice *i, void *v) {
1193  if (v == LOAD) {
1194  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
1195  Fl_Menu_Item *mi = (Fl_Menu_Item*)i->menu();
1197  for (;mi->text;mi++) {
1198  if ((Fl_Align)(mi->argument())==b)
1199  i->value(mi);
1200  }
1201  } else {
1202  const Fl_Menu_Item *mi = i->menu() + i->value();
1204  int mod = 0;
1205  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1206  if (o->selected && o->is_widget()) {
1207  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1208  Fl_Align x = q->o->align();
1209  Fl_Align y = (x & ~FL_ALIGN_POSITION_MASK) | b;
1210  if (x != y) {
1211  q->o->align(y);
1212  q->redraw();
1213  mod = 1;
1214  }
1215  }
1216  }
1217  if (mod) set_modflag(1);
1218  }
1219 }
1220 
1221 void align_text_image_cb(Fl_Choice *i, void *v) {
1222  if (v == LOAD) {
1223  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
1224  Fl_Menu_Item *mi = (Fl_Menu_Item*)i->menu();
1226  for (;mi->text;mi++) {
1227  if ((Fl_Align)(mi->argument())==b)
1228  i->value(mi);
1229  }
1230  } else {
1231  const Fl_Menu_Item *mi = i->menu() + i->value();
1233  int mod = 0;
1234  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1235  if (o->selected && o->is_widget()) {
1236  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1237  Fl_Align x = q->o->align();
1238  Fl_Align y = (x & ~FL_ALIGN_IMAGE_MASK) | b;
1239  if (x != y) {
1240  q->o->align(y);
1241  q->redraw();
1242  mod = 1;
1243  }
1244  }
1245  }
1246  if (mod) set_modflag(1);
1247  }
1248 }
1249 
1251 
1252 void callback_cb(CodeEditor* i, void *v) {
1253  if (v == LOAD) {
1254  const char *cbtext = current_widget->callback();
1255  i->buffer()->text( cbtext ? cbtext : "" );
1256  } else {
1257  int mod = 0;
1258  char *c = i->buffer()->text();
1259  const char *d = c_check(c);
1260  if (d) {
1261  fl_message("Error in callback: %s",d);
1262  if (i->window()) i->window()->make_current();
1263  haderror = 1;
1264  }
1265  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1266  if (o->selected) {
1267  o->callback(c);
1268  mod = 1;
1269  }
1270  }
1271  if (mod) set_modflag(1);
1272  free(c);
1273  }
1274 }
1275 
1276 void comment_cb(Fl_Text_Editor* i, void *v) {
1277  if (v == LOAD) {
1278  const char *cmttext = current_widget->comment();
1279  i->buffer()->text( cmttext ? cmttext : "" );
1280  } else {
1281  int mod = 0;
1282  char *c = i->buffer()->text();
1283  const char *d = c_check(c);
1284  if (d) {
1285  fl_message("Error in comment: %s",d);
1286  if (i->window()) i->window()->make_current();
1287  haderror = 1;
1288  }
1289  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1290  if (o->selected) {
1291  o->comment(c);
1292  mod = 1;
1293  }
1294  }
1295  if (mod) set_modflag(1);
1296  free(c);
1297  }
1298 }
1299 
1300 void user_data_cb(Fl_Input *i, void *v) {
1301  if (v == LOAD) {
1303  } else {
1304  int mod = 0;
1305  const char *c = i->value();
1306  const char *d = c_check(c);
1307  if (d) {fl_message("Error in user_data: %s",d); haderror = 1; return;}
1308  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1309  if (o->selected) {
1310  o->user_data(c);
1311  mod = 1;
1312  }
1313  }
1314  if (mod) set_modflag(1);
1315  }
1316 }
1317 
1318 void user_data_type_cb(Fl_Input *i, void *v) {
1319  static const char *dflt = "void*";
1320  if (v == LOAD) {
1321  const char *c = current_widget->user_data_type();
1322  if (!c) c = dflt;
1323  i->static_value(c);
1324  } else {
1325  int mod = 0;
1326  const char *c = i->value();
1327  const char *d = c_check(c);
1328  if (!*c) i->value(dflt);
1329  else if (!strcmp(c,dflt)) c = 0;
1330  if (!d) {
1331  if (c && *c && c[strlen(c)-1] != '*' && strcmp(c,"long"))
1332  d = "must be pointer or long";
1333  }
1334  if (d) {fl_message("Error in type: %s",d); haderror = 1; return;}
1335  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1336  if (o->selected) {
1337  o->user_data_type(c);
1338  mod = 1;
1339  }
1340  }
1341  if (mod) set_modflag(1);
1342  }
1343 }
1344 
1345 // "v_attributes" let user type in random code for attribute settings:
1346 
1347 void v_input_cb(Fl_Input* i, void* v) {
1348  int n = fl_intptr_t(i->user_data());
1349  if (v == LOAD) {
1351  } else {
1352  int mod = 0;
1353  const char *c = i->value();
1354  const char *d = c_check(c&&c[0]=='#' ? c+1 : c);
1355  if (d) {fl_message("Error in %s: %s",i->label(),d); haderror = 1; return;}
1356  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1357  if (o->selected && o->is_widget()) {
1358  Fl_Widget_Type *t = (Fl_Widget_Type*)o;
1359  t->extra_code(n,c);
1360  mod = 1;
1361  }
1362  }
1363  if (mod) set_modflag(1);
1364  }
1365 }
1366 
1367 void subclass_cb(Fl_Input* i, void* v) {
1368  if (v == LOAD) {
1369  if (current_widget->is_menu_item()) {i->deactivate(); return;} else i->activate();
1371  } else {
1372  int mod = 0;
1373  const char *c = i->value();
1374  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1375  if (o->selected && o->is_widget()) {
1376  Fl_Widget_Type *t = (Fl_Widget_Type*)o;
1377  t->subclass(c);
1378  mod = 1;
1379  }
1380  }
1381  if (mod) set_modflag(1);
1382  }
1383 }
1384 
1386 
1387 // textstuff: set textfont, textsize, textcolor attributes:
1388 
1389 // default widget returns 0 to indicate not-implemented:
1390 int Fl_Widget_Type::textstuff(int, Fl_Font&, int&, Fl_Color&) {return 0;}
1391 
1392 void textfont_cb(Fl_Choice* i, void* v) {
1393  Fl_Font n; int s; Fl_Color c;
1394  if (v == LOAD) {
1395  if (!current_widget->textstuff(0,n,s,c)) {i->deactivate(); return;}
1396  i->activate();
1397  if (n > 15) n = FL_HELVETICA;
1398  i->value(n);
1399  } else {
1400  int mod = 0;
1401  n = (Fl_Font)i->value();
1402  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1403  if (o->selected && o->is_widget()) {
1404  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1405  q->textstuff(1,n,s,c);
1406  q->o->redraw();
1407  mod = 1;
1408  }
1409  }
1410  if (mod) set_modflag(1);
1411  }
1412 }
1413 
1414 void textsize_cb(Fl_Value_Input* i, void* v) {
1415  Fl_Font n; int s; Fl_Color c;
1416  if (v == LOAD) {
1417  if (!current_widget->textstuff(0,n,s,c)) {i->deactivate(); return;}
1418  i->activate();
1419  } else {
1420  int mod = 0;
1421  s = int(i->value());
1422  if (s <= 0) s = Fl_Widget_Type::default_size;
1423  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1424  if (o->selected && o->is_widget()) {
1425  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1426  q->textstuff(2,n,s,c);
1427  q->o->redraw();
1428  mod = 1;
1429  }
1430  }
1431  if (mod) set_modflag(1);
1432  }
1433  i->value(s);
1434 }
1435 
1436 void textcolor_cb(Fl_Button* i, void* v) {
1437  Fl_Font n; int s; Fl_Color c;
1438  if (v == LOAD) {
1439  if (!current_widget->textstuff(0,n,s,c)) {i->deactivate(); return;}
1440  i->activate();
1441  } else {
1442  int mod = 0;
1443  c = i->color();
1444  Fl_Color d = fl_show_colormap(c);
1445  if (d == c) return;
1446  c = d;
1447  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1448  if (o->selected && o->is_widget()) {
1449  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1450  q->textstuff(3,n,s,c); q->o->redraw();
1451  mod = 1;
1452  }
1453  }
1454  if (mod) set_modflag(1);
1455  }
1456  i->color(c); i->labelcolor(fl_contrast(FL_BLACK,c)); i->redraw();
1457 }
1458 
1460 // Kludges to the panel for subclasses:
1461 
1462 void min_w_cb(Fl_Value_Input* i, void* v) {
1463  if (v == LOAD) {
1464  if (!current_widget->is_window()) {i->parent()->hide(); return;}
1465  i->parent()->show();
1466  i->value(((Fl_Window_Type*)current_widget)->sr_min_w);
1467  } else {
1468  int mod = 0;
1469  int n = (int)i->value();
1470  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1471  if (o->selected && o->is_window()) {
1472  ((Fl_Window_Type*)current_widget)->sr_min_w = n;
1473  mod = 1;
1474  }
1475  }
1476  if (mod) set_modflag(1);
1477  }
1478 }
1479 
1480 void min_h_cb(Fl_Value_Input* i, void* v) {
1481  if (v == LOAD) {
1482  if (!current_widget->is_window()) return;
1483  i->value(((Fl_Window_Type*)current_widget)->sr_min_h);
1484  } else {
1485  int mod = 0;
1486  int n = (int)i->value();
1487  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1488  if (o->selected && o->is_window()) {
1489  ((Fl_Window_Type*)current_widget)->sr_min_h = n;
1490  mod = 1;
1491  }
1492  }
1493  if (mod) set_modflag(1);
1494  }
1495 }
1496 
1497 void max_w_cb(Fl_Value_Input* i, void* v) {
1498  if (v == LOAD) {
1499  if (!current_widget->is_window()) return;
1500  i->value(((Fl_Window_Type*)current_widget)->sr_max_w);
1501  } else {
1502  int mod = 0;
1503  int n = (int)i->value();
1504  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1505  if (o->selected && o->is_window()) {
1506  ((Fl_Window_Type*)current_widget)->sr_max_w = n;
1507  mod = 1;
1508  }
1509  }
1510  if (mod) set_modflag(1);
1511  }
1512 }
1513 
1514 void max_h_cb(Fl_Value_Input* i, void* v) {
1515  if (v == LOAD) {
1516  if (!current_widget->is_window()) return;
1517  i->value(((Fl_Window_Type*)current_widget)->sr_max_h);
1518  } else {
1519  int mod = 0;
1520  int n = (int)i->value();
1521  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1522  if (o->selected && o->is_window()) {
1523  ((Fl_Window_Type*)current_widget)->sr_max_h = n;
1524  mod = 1;
1525  }
1526  }
1527  if (mod) set_modflag(1);
1528  }
1529 }
1530 
1531 void set_min_size_cb(Fl_Button*, void* v) {
1532  if (v == LOAD) {
1533  } else {
1534  int mod = 0;
1535  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1536  if (o->selected && o->is_window()) {
1538  win->sr_min_w = win->o->w();
1539  win->sr_min_h = win->o->h();
1540  mod = 1;
1541  }
1542  }
1544  if (mod) set_modflag(1);
1545  }
1546 }
1547 
1548 void set_max_size_cb(Fl_Button*, void* v) {
1549  if (v == LOAD) {
1550  } else {
1551  int mod = 0;
1552  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1553  if (o->selected && o->is_window()) {
1555  win->sr_max_w = win->o->w();
1556  win->sr_max_h = win->o->h();
1557  mod = 1;
1558  }
1559  }
1561  if (mod) set_modflag(1);
1562  }
1563 }
1564 
1565 void slider_size_cb(Fl_Value_Input* i, void* v) {
1566  if (v == LOAD) {
1567  if (current_widget->is_window())
1568  i->parent()->hide();
1569  else
1570  i->parent()->show();
1571  if (current_widget->is_valuator()<2) {i->deactivate(); return;}
1572  i->activate();
1573  i->value(((Fl_Slider*)(current_widget->o))->slider_size());
1574  } else {
1575  int mod = 0;
1576  double n = i->value();
1577  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1578  if (o->selected && o->is_widget()) {
1579  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1580  if (q->is_valuator()>=2) {
1581  ((Fl_Slider*)(q->o))->slider_size(n);
1582  q->o->redraw();
1583  mod = 1;
1584  }
1585  }
1586  }
1587  if (mod) set_modflag(1);
1588  }
1589 }
1590 
1591 void min_cb(Fl_Value_Input* i, void* v) {
1592  if (v == LOAD) {
1593  if (current_widget->is_valuator()) {
1594  i->activate();
1595  i->value(((Fl_Valuator*)(current_widget->o))->minimum());
1596  } else if (current_widget->is_spinner()) {
1597  i->activate();
1598  i->value(((Fl_Spinner*)(current_widget->o))->minimum());
1599  } else {
1600  i->deactivate();
1601  return;
1602  }
1603  } else {
1604  int mod = 0;
1605  double n = i->value();
1606  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1607  if (o->selected && o->is_widget()) {
1608  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1609  if (q->is_valuator()) {
1610  ((Fl_Valuator*)(q->o))->minimum(n);
1611  q->o->redraw();
1612  mod = 1;
1613  } else if (q->is_spinner()) {
1614  ((Fl_Spinner*)(q->o))->minimum(n);
1615  q->o->redraw();
1616  mod = 1;
1617  }
1618  }
1619  }
1620  if (mod) set_modflag(1);
1621  }
1622 }
1623 
1624 void max_cb(Fl_Value_Input* i, void* v) {
1625  if (v == LOAD) {
1626  if (current_widget->is_valuator()) {
1627  i->activate();
1628  i->value(((Fl_Valuator*)(current_widget->o))->maximum());
1629  } else if (current_widget->is_spinner()) {
1630  i->activate();
1631  i->value(((Fl_Spinner*)(current_widget->o))->maximum());
1632  } else {
1633  i->deactivate();
1634  return;
1635  }
1636  } else {
1637  int mod = 0;
1638  double n = i->value();
1639  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1640  if (o->selected && o->is_widget()) {
1641  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1642  if (q->is_valuator()) {
1643  ((Fl_Valuator*)(q->o))->maximum(n);
1644  q->o->redraw();
1645  mod = 1;
1646  } else if (q->is_spinner()) {
1647  ((Fl_Spinner*)(q->o))->maximum(n);
1648  q->o->redraw();
1649  mod = 1;
1650  }
1651  }
1652  }
1653  if (mod) set_modflag(1);
1654  }
1655 }
1656 
1657 void step_cb(Fl_Value_Input* i, void* v) {
1658  if (v == LOAD) {
1659  if (current_widget->is_valuator()) {
1660  i->activate();
1661  i->value(((Fl_Valuator*)(current_widget->o))->step());
1662  } else if (current_widget->is_spinner()) {
1663  i->activate();
1664  i->value(((Fl_Spinner*)(current_widget->o))->step());
1665  } else {
1666  i->deactivate();
1667  return;
1668  }
1669  } else {
1670  int mod = 0;
1671  double n = i->value();
1672  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1673  if (o->selected && o->is_widget()) {
1674  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1675  if (q->is_valuator()) {
1676  ((Fl_Valuator*)(q->o))->step(n);
1677  q->o->redraw();
1678  mod = 1;
1679  } else if (q->is_spinner()) {
1680  ((Fl_Spinner*)(q->o))->step(n);
1681  q->o->redraw();
1682  mod = 1;
1683  }
1684  }
1685  }
1686  if (mod) set_modflag(1);
1687  }
1688 }
1689 
1690 void value_cb(Fl_Value_Input* i, void* v) {
1691  if (v == LOAD) {
1692  if (current_widget->is_valuator()) {
1693  i->activate();
1694  i->value(((Fl_Valuator*)(current_widget->o))->value());
1695  } else if (current_widget->is_button()) {
1696  i->activate();
1697  i->value(((Fl_Button*)(current_widget->o))->value());
1698  } else if (current_widget->is_spinner()) {
1699  i->activate();
1700  i->value(((Fl_Spinner*)(current_widget->o))->value());
1701  } else
1702  i->deactivate();
1703  } else {
1704  int mod = 0;
1705  double n = i->value();
1706  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1707  if (o->selected && o->is_widget()) {
1708  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1709  if (q->is_valuator()) {
1710  ((Fl_Valuator*)(q->o))->value(n);
1711  mod = 1;
1712  } else if (q->is_button()) {
1713  ((Fl_Button*)(q->o))->value(n != 0);
1714  if (q->is_menu_item()) q->redraw();
1715  mod = 1;
1716  } else if (q->is_spinner()) {
1717  ((Fl_Spinner*)(q->o))->value(n);
1718  mod = 1;
1719  }
1720  }
1721  }
1722  if (mod) set_modflag(1);
1723  }
1724 }
1725 
1727 
1728 // subtypes:
1729 
1731 
1732 void subtype_cb(Fl_Choice* i, void* v) {
1733  if (v == LOAD) {
1735  if (!m) {i->deactivate(); return;}
1736  i->menu(m);
1737  int j;
1738  for (j = 0;; j++) {
1739  if (!m[j].text) {j = 0; break;}
1740  if (current_widget->is_spinner()) {
1741  if (m[j].argument() == ((Fl_Spinner*)current_widget->o)->type()) break;
1742  } else {
1743  if (m[j].argument() == current_widget->o->type()) break;
1744  }
1745  }
1746  i->value(j);
1747  i->activate();
1748  i->redraw();
1749  } else {
1750  int mod = 0;
1751  int n = int(i->mvalue()->argument());
1753  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1754  if (o->selected && o->is_widget()) {
1755  Fl_Widget_Type* q = (Fl_Widget_Type*)o;
1756  if (q->subtypes()==m) {
1757  if (q->is_spinner())
1758  ((Fl_Spinner*)q->o)->type(n);
1759  else
1760  q->o->type(n);
1761  q->redraw();
1762  mod = 1;
1763  }
1764  }
1765  }
1766  if (mod) set_modflag(1);
1767  }
1768 }
1769 
1771 
1772 void propagate_load(Fl_Group* g, void* v) {
1773  if (v == LOAD) {
1774  Fl_Widget*const* a = g->array();
1775  for (int i=g->children(); i--;) {
1776  Fl_Widget* o = *a++;
1777  o->do_callback(o,LOAD);
1778  }
1779  }
1780 }
1781 
1782 void set_cb(Fl_Button*, void*) {
1783  haderror = 0;
1784  Fl_Widget*const* a = the_panel->array();
1785  for (int i=the_panel->children(); i--;) {
1786  Fl_Widget* o = *a++;
1787  if (o->changed()) {
1788  o->do_callback();
1789  if (haderror) return;
1790  o->clear_changed();
1791  }
1792  }
1793 }
1794 
1795 void ok_cb(Fl_Return_Button* o, void* v) {
1796  set_cb(o,v);
1797  if (!haderror) the_panel->hide();
1798 }
1799 
1800 void revert_cb(Fl_Button*, void*) {
1801  // We have to revert all dynamically changing fields:
1802  // but for now only the first label works...
1805 }
1806 
1807 void cancel_cb(Fl_Button* o, void* v) {
1808  revert_cb(o,v);
1809  the_panel->hide();
1810 }
1811 
1812 void toggle_overlays(Fl_Widget *,void *); // in Fl_Window_Type.cxx
1813 void overlay_cb(Fl_Button*o,void *v) {
1814  toggle_overlays(o,v);
1815 }
1816 
1817 void leave_live_mode_cb(Fl_Widget*, void*);
1818 
1819 void live_mode_cb(Fl_Button*o,void *) {
1822  static Fl_Type *live_type = 0L;
1823  static Fl_Widget *live_widget = 0L;
1824  static Fl_Window *live_window = 0L;
1825  // if 'o' is 0, we must quit live mode
1826  if (!o) {
1827  o = wLiveMode;
1828  o->value(0);
1829  }
1830  if (o->value()) {
1831  if (numselected == 1) {
1832  Fl_Group::current(0L);
1833  live_widget = current_widget->enter_live_mode(1);
1834  if (live_widget) {
1835  live_type = current_widget;
1836  Fl_Group::current(0);
1837  int w = live_widget->w();
1838  int h = live_widget->h();
1839  live_window = new Fl_Double_Window(w+20, h+55, "Fluid Live Mode Widget");
1840  live_window->box(FL_FLAT_BOX);
1841  live_window->color(FL_GREEN);
1842  Fl_Group *rsz = new Fl_Group(0, h+20, 130, 35);
1843  rsz->box(FL_NO_BOX);
1844  Fl_Box *rsz_dummy = new Fl_Box(110, h+20, 1, 25);
1845  rsz_dummy->box(FL_NO_BOX);
1846  rsz->resizable(rsz_dummy);
1847  Fl_Button *btn = new Fl_Button(10, h+20, 100, 25, "Exit Live Mode");
1848  btn->labelsize(12);
1850  rsz->end();
1851  live_window->add(live_widget);
1852  live_widget->position(10, 10);
1853  live_window->resizable(live_widget);
1854  live_window->set_modal(); // block all other UI
1855  live_window->callback(leave_live_mode_cb);
1856  if (current_widget->is_window()) {
1858  int mw = w->sr_min_w; if (mw>0) mw += 20;
1859  int mh = w->sr_min_h; if (mh>0) mh += 55;
1860  int MW = w->sr_max_w; if (MW>0) MW += 20;
1861  int MH = w->sr_max_h; if (MH>2) MH += 55;
1862  if (mw || mh || MW || MH)
1863  live_window->size_range(mw, mh, MW, MH);
1864  }
1865  live_window->show();
1866  } else o->value(0);
1867  } else o->value(0);
1868  } else {
1869  if (live_type)
1870  live_type->leave_live_mode();
1871  if (live_window) {
1872  live_window->hide();
1873  Fl::delete_widget(live_window);
1874  }
1875  live_type = 0L;
1876  live_widget = 0L;
1877  live_window = 0L;
1878  }
1879 }
1880 
1881 // update the panel according to current widget set:
1882 static void load_panel() {
1883  if (!the_panel) return;
1884 
1885  // find all the Fl_Widget subclasses currently selected:
1886  numselected = 0;
1887  current_widget = 0;
1888  if (Fl_Type::current) {
1889  if (Fl_Type::current->is_widget())
1891  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1892  if (o->is_widget() && o->selected) {
1893  numselected++;
1895  }
1896  }
1897  }
1898  if (numselected)
1900  else
1901  the_panel->hide();
1902 }
1903 
1904 // This is called when user double-clicks an item, open or update the panel:
1907  load_panel();
1908  if (numselected) the_panel->show();
1909 }
1910 
1912 
1913 extern void redraw_overlays();
1915 extern void redraw_browser();
1916 extern void update_sourceview_position();
1917 
1918 // Called when ui changes what objects are selected:
1919 // p is selected object, null for all deletions (we must throw away
1920 // old panel in that case, as the object may no longer exist)
1922  // store all changes to the current selected objects:
1923  if (p && the_panel && the_panel->visible()) {
1924  set_cb(0,0);
1925  // if there was an error, we try to leave the selected set unchanged:
1926  if (haderror) {
1927  Fl_Type *q = 0;
1928  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1929  o->new_selected = o->selected;
1930  if (!q && o->selected) q = o;
1931  }
1932  if (!p || !p->selected) p = q;
1933  Fl_Type::current = p;
1934  redraw_browser();
1935  return;
1936  }
1937  }
1938  // update the selected flags to new set:
1939  Fl_Type *q = 0;
1940  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
1941  o->selected = o->new_selected;
1942  if (!q && o->selected) q = o;
1943  }
1944  if (!p || !p->selected) p = q;
1945  Fl_Type::current = p;
1947  redraw_overlays();
1948  // load the panel with the new settings:
1949  load_panel();
1950  // update the source viewer to show the code for the selected object
1952 }
1953 
1955 // Writing the C code:
1956 
1957 // test to see if user named a function, or typed in code:
1958 int is_name(const char *c) {
1959  for (; *c; c++) if (ispunct(*c) && *c!='_' && *c!=':') return 0;
1960  return 1;
1961 }
1962 
1963 // Test to see if name() is an array entry. If so, and this is the
1964 // highest number, return name[num+1]. Return null if not the highest
1965 // number or a field or function. Return name() if not an array entry.
1966 const char *array_name(Fl_Widget_Type *o) {
1967  const char *c = o->name();
1968  if (!c) return 0;
1969  const char *d;
1970  for (d = c; *d != '['; d++) {
1971  if (!*d) return c;
1972  if (ispunct(*d) && *d!='_') return 0;
1973  }
1974  int num = atoi(d+1);
1975  int sawthis = 0;
1976  Fl_Type *t = o->prev;
1977  Fl_Type *tp = o;
1978  const char *cn = o->class_name(1);
1979  for (; t && t->class_name(1) == cn; tp = t, t = t->prev) {/*empty*/}
1980  for (t = tp; t && t->class_name(1) == cn; t = t->next) {
1981  if (t == o) {sawthis=1; continue;}
1982  const char *e = t->name();
1983  if (!e) continue;
1984  if (strncmp(c,e,d-c)) continue;
1985  int n1 = atoi(e+(d-c)+1);
1986  if (n1 > num || (n1==num && sawthis)) return 0;
1987  }
1988  static char buffer[128];
1989  // MRS: we want strncpy() here...
1990  strncpy(buffer,c,d-c+1);
1991  snprintf(buffer+(d-c+1),sizeof(buffer) - (d-c+1), "%d]",num+1);
1992  return buffer;
1993 }
1994 
1995 // Test to see if extra code is a declaration:
1996 int isdeclare(const char *c) {
1997  while (isspace(*c)) c++;
1998  if (*c == '#') return 1;
1999  if (!strncmp(c,"extern",6)) return 1;
2000  if (!strncmp(c,"typedef",7)) return 1;
2001  if (!strncmp(c,"using",5)) return 1;
2002  return 0;
2003 }
2004 
2006  const char* t = subclassname(this);
2007  if (!subclass() || (is_class() && !strncmp(t, "Fl_", 3))) {
2008  write_declare("#include <FL/%s.H>", t);
2009  }
2010  for (int n=0; n < NUM_EXTRA_CODE; n++) {
2011  if (extra_code(n) && isdeclare(extra_code(n)))
2012  write_declare("%s", extra_code(n));
2013  }
2014  if (callback() && is_name(callback())) {
2015  int write_extern_declaration = 1;
2016  const Fl_Class_Type *cc = is_in_class();
2017  char buf[1024]; snprintf(buf, 1023, "%s(*)", callback());
2018  if (cc) {
2019  if (cc->has_function("static void", buf))
2020  write_extern_declaration = 0;
2021  } else {
2022  if (has_toplevel_function(0L, buf))
2023  write_extern_declaration = 0;
2024  }
2025  if (write_extern_declaration)
2026  write_declare("extern void %s(%s*, %s);", callback(), t,
2027  user_data_type() ? user_data_type() : "void*");
2028  }
2029  const char* k = class_name(1);
2030  const char* c = array_name(this);
2031  if (c && !k && !is_class()) {
2032  write_c("\n");
2033  if (!public_) write_c("static ");
2034  else write_h("extern %s *%s;\n", t, c);
2035  if (strchr(c, '[') == NULL) write_c("%s *%s=(%s *)0;\n", t, c, t);
2036  else write_c("%s *%s={(%s *)0};\n", t, c, t);
2037  }
2038  if (callback() && !is_name(callback())) {
2039  // see if 'o' or 'v' used, to prevent unused argument warnings:
2040  int use_o = 0;
2041  int use_v = 0;
2042  const char *d;
2043  for (d = callback(); *d;) {
2044  if (*d == 'o' && !is_id(d[1])) use_o = 1;
2045  if (*d == 'v' && !is_id(d[1])) use_v = 1;
2046  do d++; while (is_id(*d));
2047  while (*d && !is_id(*d)) d++;
2048  }
2049  const char* cn = callback_name();
2050  if (k) {
2051  write_c("\nvoid %s::%s_i(%s*", k, cn, t);
2052  } else {
2053  write_c("\nstatic void %s(%s*", cn, t);
2054  }
2055  if (use_o) write_c(" o");
2056  const char* ut = user_data_type() ? user_data_type() : "void*";
2057  write_c(", %s", ut);
2058  if (use_v) write_c(" v");
2059  write_c(") {\n %s", callback());
2060  if (*(d-1) != ';') {
2061  const char *p = strrchr(callback(), '\n');
2062  if (p) p ++;
2063  else p = callback();
2064  // Only add trailing semicolon if the last line is not a preprocessor
2065  // statement...
2066  if (*p != '#' && *p) write_c(";");
2067  }
2068  write_c("\n}\n");
2069  if (k) {
2070  write_c("void %s::%s(%s* o, %s v) {\n", k, cn, t, ut);
2071  write_c(" ((%s*)(o", k);
2072  Fl_Type *q = 0;
2073  for (Fl_Type* p = parent; p && p->is_widget(); q = p, p = p->parent)
2074  write_c("->parent()");
2075  if (!q || strcmp(q->type_name(), "widget_class"))
2076  write_c("->user_data()");
2077  write_c("))->%s_i(o,v);\n}\n", cn);
2078  }
2079  }
2080  if (image) {
2081  if (image->written != write_number) {
2082  image->write_static();
2084  }
2085  }
2086  if (inactive) {
2087  if (inactive->written != write_number) {
2090  }
2091  }
2092 }
2093 
2094 const char *Fl_Type::callback_name() {
2095  if (is_name(callback())) return callback();
2096  return unique_id(this, "cb", name(), label());
2097 }
2098 
2099 extern int varused_test, varused;
2100 
2102  const char* t = subclassname(this);
2103  const char *c = array_name(this);
2104  if (c) {
2105  if (class_name(1)) {
2107  write_h(" %s *%s;\n", t, c);
2108  }
2109  }
2110  if (class_name(1) && callback() && !is_name(callback())) {
2111  const char* cn = callback_name();
2112  const char* ut = user_data_type() ? user_data_type() : "void*";
2113  write_public(0);
2114  write_h(" inline void %s_i(%s*, %s);\n", cn, t, ut);
2115  write_h(" static void %s(%s*, %s);\n", cn, t, ut);
2116  }
2117  // figure out if local variable will be used (prevent compiler warnings):
2118  int wused = !name() && is_window();
2119  const char *ptr;
2120 
2121  varused = wused;
2122 
2123  if (!name() && !varused) {
2124  varused |= is_parent();
2125 
2126  if (!varused) {
2127  varused_test = 1;
2129  varused_test = 0;
2130  }
2131  }
2132 
2133  if (!varused) {
2134  for (int n=0; n < NUM_EXTRA_CODE; n++)
2135  if (extra_code(n) && !isdeclare(extra_code(n)))
2136  {
2137  int instring = 0;
2138  int inname = 0;
2139  for (ptr = extra_code(n); *ptr; ptr ++) {
2140  if (instring) {
2141  if (*ptr == '\\') ptr++;
2142  else if (*ptr == '\"') instring = 0;
2143  } else if (inname && !isalnum(*ptr & 255)) inname = 0;
2144  else if (*ptr == '\"') instring = 1;
2145  else if (isalnum(*ptr & 255) || *ptr == '_') {
2146  size_t len = strspn(ptr, "0123456789_"
2147  "abcdefghijklmnopqrstuvwxyz"
2148  "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
2149 
2150  if (!strncmp(ptr, "o", len)) {
2151  varused = 1;
2152  break;
2153  } else ptr += len - 1;
2154  }
2155  }
2156  }
2157  }
2158 
2159  write_c("%s{ ", indent());
2161  if (varused) write_c("%s* o = ", t);
2162  if (name()) write_c("%s = ", name());
2163  if (is_window()) {
2164  // Handle special case where user is faking a Fl_Group type as a window,
2165  // there is no 2-argument constructor in that case:
2166  if (!strstr(t, "Window"))
2167  write_c("new %s(0, 0, %d, %d", t, o->w(), o->h());
2168  else
2169  write_c("new %s(%d, %d", t, o->w(), o->h());
2170  } else {
2171  write_c("new %s(%d, %d, %d, %d", t, o->x(), o->y(), o->w(), o->h());
2172  }
2173  if (label() && *label()) {
2174  write_c(", ");
2175  switch (i18n_type) {
2176  case 0 : /* None */
2177  write_cstring(label());
2178  break;
2179  case 1 : /* GNU gettext */
2180  write_c("%s(", i18n_function);
2181  write_cstring(label());
2182  write_c(")");
2183  break;
2184  case 2 : /* POSIX catgets */
2185  write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog",
2186  i18n_set, msgnum());
2187  write_cstring(label());
2188  write_c(")");
2189  break;
2190  }
2191  }
2192  write_c(");\n");
2193 
2194  indentation += 2;
2195 
2196  if (wused) write_c("%sw = o; if (w) {/* empty */}\n", indent());
2197 
2199 }
2200 
2201 void Fl_Widget_Type::write_color(const char* field, Fl_Color color) {
2202  const char* color_name = 0;
2203  switch (color) {
2204  case FL_FOREGROUND_COLOR: color_name = "FL_FOREGROUND_COLOR"; break;
2205  case FL_BACKGROUND2_COLOR: color_name = "FL_BACKGROUND2_COLOR"; break;
2206  case FL_INACTIVE_COLOR: color_name = "FL_INACTIVE_COLOR"; break;
2207  case FL_SELECTION_COLOR: color_name = "FL_SELECTION_COLOR"; break;
2208  case FL_GRAY0: color_name = "FL_GRAY0"; break;
2209  case FL_DARK3: color_name = "FL_DARK3"; break;
2210  case FL_DARK2: color_name = "FL_DARK2"; break;
2211  case FL_DARK1: color_name = "FL_DARK1"; break;
2212  case FL_BACKGROUND_COLOR: color_name = "FL_BACKGROUND_COLOR"; break;
2213  case FL_LIGHT1: color_name = "FL_LIGHT1"; break;
2214  case FL_LIGHT2: color_name = "FL_LIGHT2"; break;
2215  case FL_LIGHT3: color_name = "FL_LIGHT3"; break;
2216  case FL_BLACK: color_name = "FL_BLACK"; break;
2217  case FL_RED: color_name = "FL_RED"; break;
2218  case FL_GREEN: color_name = "FL_GREEN"; break;
2219  case FL_YELLOW: color_name = "FL_YELLOW"; break;
2220  case FL_BLUE: color_name = "FL_BLUE"; break;
2221  case FL_MAGENTA: color_name = "FL_MAGENTA"; break;
2222  case FL_CYAN: color_name = "FL_CYAN"; break;
2223  case FL_DARK_RED: color_name = "FL_DARK_RED"; break;
2224  case FL_DARK_GREEN: color_name = "FL_DARK_GREEN"; break;
2225  case FL_DARK_YELLOW: color_name = "FL_DARK_YELLOW"; break;
2226  case FL_DARK_BLUE: color_name = "FL_DARK_BLUE"; break;
2227  case FL_DARK_MAGENTA: color_name = "FL_DARK_MAGENTA"; break;
2228  case FL_DARK_CYAN: color_name = "FL_DARK_CYAN"; break;
2229  case FL_WHITE: color_name = "FL_WHITE"; break;
2230  }
2231  const char *var = is_class() ? "this" : name() ? name() : "o";
2232  if (color_name) {
2233  write_c("%s%s->%s(%s);\n", indent(), var, field, color_name);
2234  } else {
2235  write_c("%s%s->%s((Fl_Color)%d);\n", indent(), var, field, color);
2236  }
2237 }
2238 
2239 // this is split from write_code1() for Fl_Window_Type:
2241  Fl_Widget* tplate = ((Fl_Widget_Type*)factory)->o;
2242  const char *var = is_class() ? "this" : name() ? name() : "o";
2243 
2244  if (tooltip() && *tooltip()) {
2245  write_c("%s%s->tooltip(",indent(), var);
2246  switch (i18n_type) {
2247  case 0 : /* None */
2249  break;
2250  case 1 : /* GNU gettext */
2251  write_c("%s(", i18n_function);
2253  write_c(")");
2254  break;
2255  case 2 : /* POSIX catgets */
2256  write_c("catgets(%s,%s,%d,", i18n_file[0] ? i18n_file : "_catalog",
2257  i18n_set, msgnum() + 1);
2259  write_c(")");
2260  break;
2261  }
2262  write_c(");\n");
2263  }
2264 
2265  if (is_spinner() && ((Fl_Spinner*)o)->type() != ((Fl_Spinner*)tplate)->type())
2266  write_c("%s%s->type(%d);\n", indent(), var, ((Fl_Spinner*)o)->type());
2267  else if (o->type() != tplate->type() && !is_window())
2268  write_c("%s%s->type(%d);\n", indent(), var, o->type());
2269  if (o->box() != tplate->box() || subclass())
2270  write_c("%s%s->box(FL_%s);\n", indent(), var, boxname(o->box()));
2271 
2272  // write shortcut command if needed
2273  int shortcut = 0;
2274  if (is_button()) shortcut = ((Fl_Button*)o)->shortcut();
2275  else if (is_input()) shortcut = ((Fl_Input_*)o)->shortcut();
2276  else if (is_value_input()) shortcut = ((Fl_Value_Input*)o)->shortcut();
2277  else if (is_text_display()) shortcut = ((Fl_Text_Display*)o)->shortcut();
2278  if (shortcut) {
2279  if (use_FL_COMMAND && (shortcut & (FL_CTRL|FL_META))) {
2280  write_c("%s%s->shortcut(FL_COMMAND|0x%x);\n", indent(), var, shortcut & ~(FL_CTRL|FL_META));
2281  } else {
2282  write_c("%s%s->shortcut(0x%x);\n", indent(), var, shortcut);
2283  }
2284  }
2285 
2286  if (is_button()) {
2287  Fl_Button* b = (Fl_Button*)o;
2288  if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var,
2289  boxname(b->down_box()));
2290  if (b->value()) write_c("%s%s->value(1);\n", indent(), var);
2291  } else if (!strcmp(type_name(), "Fl_Input_Choice")) {
2293  if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var,
2294  boxname(b->down_box()));
2295  } else if (is_menu_button()) {
2296  Fl_Menu_* b = (Fl_Menu_*)o;
2297  if (b->down_box()) write_c("%s%s->down_box(FL_%s);\n", indent(), var,
2298  boxname(b->down_box()));
2299  }
2300  if (o->color() != tplate->color() || subclass())
2301  write_color("color", o->color());
2302  if (o->selection_color() != tplate->selection_color() || subclass())
2303  write_color("selection_color", o->selection_color());
2304  if (image) image->write_code(var);
2305  if (inactive) inactive->write_code(var, 1);
2306  if (o->labeltype() != tplate->labeltype() || subclass())
2307  write_c("%s%s->labeltype(FL_%s);\n", indent(), var,
2309  if (o->labelfont() != tplate->labelfont() || subclass())
2310  write_c("%s%s->labelfont(%d);\n", indent(), var, o->labelfont());
2311  if (o->labelsize() != tplate->labelsize() || subclass())
2312  write_c("%s%s->labelsize(%d);\n", indent(), var, o->labelsize());
2313  if (o->labelcolor() != tplate->labelcolor() || subclass())
2314  write_color("labelcolor", o->labelcolor());
2315  if (is_valuator()) {
2316  Fl_Valuator* v = (Fl_Valuator*)o;
2317  Fl_Valuator* f = (Fl_Valuator*)(tplate);
2318  if (v->minimum()!=f->minimum())
2319  write_c("%s%s->minimum(%g);\n", indent(), var, v->minimum());
2320  if (v->maximum()!=f->maximum())
2321  write_c("%s%s->maximum(%g);\n", indent(), var, v->maximum());
2322  if (v->step()!=f->step())
2323  write_c("%s%s->step(%g);\n", indent(), var, v->step());
2324  if (v->value()) {
2325  if (is_valuator()==3) { // Fl_Scrollbar::value(double) is nott available
2326  write_c("%s%s->Fl_Slider::value(%g);\n", indent(), var, v->value());
2327  } else {
2328  write_c("%s%s->value(%g);\n", indent(), var, v->value());
2329  }
2330  }
2331  if (is_valuator()>=2) {
2332  double x = ((Fl_Slider*)v)->slider_size();
2333  double y = ((Fl_Slider*)f)->slider_size();
2334  if (x != y) write_c("%s%s->slider_size(%g);\n", indent(), var, x);
2335  }
2336  }
2337  if (is_spinner()) {
2338  Fl_Spinner* v = (Fl_Spinner*)o;
2339  Fl_Spinner* f = (Fl_Spinner*)(tplate);
2340  if (v->minimum()!=f->minimum())
2341  write_c("%s%s->minimum(%g);\n", indent(), var, v->minimum());
2342  if (v->maximum()!=f->maximum())
2343  write_c("%s%s->maximum(%g);\n", indent(), var, v->maximum());
2344  if (v->step()!=f->step())
2345  write_c("%s%s->step(%g);\n", indent(), var, v->step());
2346  if (v->value()!=1.0f)
2347  write_c("%s%s->value(%g);\n", indent(), var, v->value());
2348  }
2349 
2350  {Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) {
2351  Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c);
2352  if (f != ff) write_c("%s%s->textfont(%d);\n", indent(), var, f);
2353  if (s != fs) write_c("%s%s->textsize(%d);\n", indent(), var, s);
2354  if (c != fc) write_color("textcolor", c);
2355  }}
2356  const char* ud = user_data();
2357  if (class_name(1) && !parent->is_widget()) ud = "this";
2358  if (callback()) {
2359  write_c("%s%s->callback((Fl_Callback*)%s", indent(), var, callback_name());
2360  if (ud)
2361  write_c(", (void*)(%s));\n", ud);
2362  else
2363  write_c(");\n");
2364  } else if (ud) {
2365  write_c("%s%s->user_data((void*)(%s));\n", indent(), var, ud);
2366  }
2367  if (o->align() != tplate->align() || subclass()) {
2368  int i = o->align();
2369  write_c("%s%s->align(Fl_Align(%s", indent(), var,
2371  if (i & FL_ALIGN_INSIDE) write_c("|FL_ALIGN_INSIDE");
2372  write_c("));\n");
2373  }
2374  // avoid the unsupported combination of flegs when user sets
2375  // "when" to "FL_WHEN_NEVER", but keeps the "no change" set.
2376  // FIXME: This could be reflected in the GUI by graying out the button.
2377  Fl_When ww = o->when();
2378  if (ww==FL_WHEN_NOT_CHANGED)
2379  ww = FL_WHEN_NEVER;
2380  if (ww != tplate->when() || subclass())
2381  write_c("%s%s->when(%s);\n", indent(), var,
2382  item_name(whensymbolmenu, ww));
2383  if (!o->visible() && o->parent())
2384  write_c("%s%s->hide();\n", indent(), var);
2385  if (!o->active())
2386  write_c("%s%s->deactivate();\n", indent(), var);
2387  if (!is_group() && resizable())
2388  write_c("%sFl_Group::current()->resizable(%s);\n", indent(), var);
2389  if (hotspot()) {
2390  if (is_class())
2391  write_c("%shotspot(%s);\n", indent(), var);
2392  else if (is_window())
2393  write_c("%s%s->hotspot(%s);\n", indent(), var, var);
2394  else
2395  write_c("%s%s->window()->hotspot(%s);\n", indent(), var, var);
2396  }
2397 }
2398 
2400  for (int n=0; n < NUM_EXTRA_CODE; n++)
2401  if (extra_code(n) && !isdeclare(extra_code(n)))
2402  write_c("%s%s\n", indent(), extra_code(n));
2403 }
2404 
2406  indentation -= 2;
2407  write_c("%s} // %s* %s\n", indent(), subclassname(this),
2408  name() ? name() : "o");
2409 }
2410 
2412  write_extra_code();
2414 }
2415 
2417 
2420  write_indent(level+1);
2421  switch (public_) {
2422  case 0: write_string("private"); break;
2423  case 1: break;
2424  case 2: write_string("protected"); break;
2425  }
2426  if (tooltip() && *tooltip()) {
2427  write_string("tooltip");
2428  write_word(tooltip());
2429  }
2430  if (image_name() && *image_name()) {
2431  write_string("image");
2433  }
2434  if (inactive_name() && *inactive_name()) {
2435  write_string("deimage");
2437  }
2438  write_string("xywh {%d %d %d %d}", o->x(), o->y(), o->w(), o->h());
2439  Fl_Widget* tplate = ((Fl_Widget_Type*)factory)->o;
2440  if (is_spinner() && ((Fl_Spinner*)o)->type() != ((Fl_Spinner*)tplate)->type()) {
2441  write_string("type");
2442  write_word(item_name(subtypes(), ((Fl_Spinner*)o)->type()));
2443  } else if (o->type() != tplate->type() || is_window()) {
2444  write_string("type");
2446  }
2447  if (o->box() != tplate->box()) {
2448  write_string("box"); write_word(boxname(o->box()));}
2449  if (is_input()) {
2450  Fl_Input_* b = (Fl_Input_*)o;
2451  if (b->shortcut()) write_string("shortcut 0x%x", b->shortcut());
2452  }
2453  if (is_value_input()) {
2455  if (b->shortcut()) write_string("shortcut 0x%x", b->shortcut());
2456  }
2457  if (is_text_display()) {
2459  if (b->shortcut()) write_string("shortcut 0x%x", b->shortcut());
2460  }
2461  if (is_button()) {
2462  Fl_Button* b = (Fl_Button*)o;
2463  if (b->down_box()) {
2464  write_string("down_box"); write_word(boxname(b->down_box()));}
2465  if (b->shortcut()) write_string("shortcut 0x%x", b->shortcut());
2466  if (b->value()) write_string("value 1");
2467  } else if (!strcmp(type_name(), "Fl_Input_Choice")) {
2469  if (b->down_box()) {
2470  write_string("down_box"); write_word(boxname(b->down_box()));}
2471  } else if (is_menu_button()) {
2472  Fl_Menu_* b = (Fl_Menu_*)o;
2473  if (b->down_box()) {
2474  write_string("down_box"); write_word(boxname(b->down_box()));}
2475  }
2476  if (o->color()!=tplate->color())
2477  write_string("color %d", o->color());
2478  if (o->selection_color()!=tplate->selection_color())
2479  write_string("selection_color %d", o->selection_color());
2480  if (o->labeltype()!=tplate->labeltype()) {
2481  write_string("labeltype");
2483  }
2484  if (o->labelfont()!=tplate->labelfont())
2485  write_string("labelfont %d", o->labelfont());
2486  if (o->labelsize()!=tplate->labelsize())
2487  write_string("labelsize %d", o->labelsize());
2488  if (o->labelcolor()!=tplate->labelcolor())
2489  write_string("labelcolor %d", o->labelcolor());
2490  if (o->align()!=tplate->align())
2491  write_string("align %d", o->align());
2492  if (o->when() != tplate->when())
2493  write_string("when %d", o->when());
2494  if (is_valuator()) {
2495  Fl_Valuator* v = (Fl_Valuator*)o;
2496  Fl_Valuator* f = (Fl_Valuator*)(tplate);
2497  if (v->minimum()!=f->minimum()) write_string("minimum %g",v->minimum());
2498  if (v->maximum()!=f->maximum()) write_string("maximum %g",v->maximum());
2499  if (v->step()!=f->step()) write_string("step %g",v->step());
2500  if (v->value()!=0.0) write_string("value %g",v->value());
2501  if (is_valuator()>=2) {
2502  double x = ((Fl_Slider*)v)->slider_size();
2503  double y = ((Fl_Slider*)f)->slider_size();
2504  if (x != y) write_string("slider_size %g", x);
2505  }
2506  }
2507  if (is_spinner()) {
2508  Fl_Spinner* v = (Fl_Spinner*)o;
2509  Fl_Spinner* f = (Fl_Spinner*)(tplate);
2510  if (v->minimum()!=f->minimum()) write_string("minimum %g",v->minimum());
2511  if (v->maximum()!=f->maximum()) write_string("maximum %g",v->maximum());
2512  if (v->step()!=f->step()) write_string("step %g",v->step());
2513  if (v->value()!=1.0) write_string("value %g",v->value());
2514  }
2515  {Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) {
2516  Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c);
2517  if (f != ff) write_string("textfont %d", f);
2518  if (s != fs) write_string("textsize %d", s);
2519  if (c != fc) write_string("textcolor %d", c);
2520  }}
2521  if (!o->visible()) write_string("hide");
2522  if (!o->active()) write_string("deactivate");
2523  if (resizable()) write_string("resizable");
2524  if (hotspot()) write_string(is_menu_item() ? "divider" : "hotspot");
2525  for (int n=0; n < NUM_EXTRA_CODE; n++) if (extra_code(n)) {
2526  write_indent(level+1);
2527  write_string("code%d",n);
2528  write_word(extra_code(n));
2529  }
2530  if (subclass()) {
2531  write_indent(level+1);
2532  write_string("class");
2533  write_word(subclass());
2534  }
2535 }
2536 
2538 extern double read_version;
2539 void Fl_Widget_Type::read_property(const char *c) {
2540  int x,y,w,h; Fl_Font f; int s; Fl_Color cc;
2541  if (!strcmp(c,"private")) {
2542  public_ = 0;
2543  } else if (!strcmp(c,"protected")) {
2544  public_ = 2;
2545  } else if (!strcmp(c,"xywh")) {
2546  if (sscanf(read_word(),"%d %d %d %d",&x,&y,&w,&h) == 4) {
2547  x += pasteoffset;
2548  y += pasteoffset;
2549  // FIXME temporary change!
2550  if (read_version>=2.0 && o->parent() && o->parent()!=o->window()) {
2551  x += o->parent()->x();
2552  y += o->parent()->y();
2553  }
2554  o->resize(x,y,w,h);
2555  }
2556  } else if (!strcmp(c,"tooltip")) {
2557  tooltip(read_word());
2558  } else if (!strcmp(c,"image")) {
2559  image_name(read_word());
2560  } else if (!strcmp(c,"deimage")) {
2562  } else if (!strcmp(c,"type")) {
2563  if (is_spinner())
2564  ((Fl_Spinner*)o)->type(item_number(subtypes(), read_word()));
2565  else
2567  } else if (!strcmp(c,"box")) {
2568  const char* value = read_word();
2569  if ((x = boxnumber(value))) {
2570  if (x == ZERO_ENTRY) x = 0;
2571  o->box((Fl_Boxtype)x);
2572  } else if (sscanf(value,"%d",&x) == 1) o->box((Fl_Boxtype)x);
2573  } else if (is_button() && !strcmp(c,"down_box")) {
2574  const char* value = read_word();
2575  if ((x = boxnumber(value))) {
2576  if (x == ZERO_ENTRY) x = 0;
2577  ((Fl_Button*)o)->down_box((Fl_Boxtype)x);
2578  }
2579  } else if (!strcmp(type_name(), "Fl_Input_Choice") && !strcmp(c,"down_box")) {
2580  const char* value = read_word();
2581  if ((x = boxnumber(value))) {
2582  if (x == ZERO_ENTRY) x = 0;
2583  ((Fl_Input_Choice*)o)->down_box((Fl_Boxtype)x);
2584  }
2585  } else if (is_menu_button() && !strcmp(c,"down_box")) {
2586  const char* value = read_word();
2587  if ((x = boxnumber(value))) {
2588  if (x == ZERO_ENTRY) x = 0;
2589  ((Fl_Menu_*)o)->down_box((Fl_Boxtype)x);
2590  }
2591  } else if (is_button() && !strcmp(c,"value")) {
2592  const char* value = read_word();
2593  ((Fl_Button*)o)->value(atoi(value));
2594  } else if (!strcmp(c,"color")) {
2595  const char *cw = read_word();
2596  if (cw[0]=='0' && cw[1]=='x') {
2597  sscanf(cw,"0x%x",&x);
2598  o->color(x);
2599  } else {
2600  int n = sscanf(cw,"%d %d",&x,&y);
2601  if (n == 2) { // back compatibility...
2602  if (x != 47) o->color(x);
2603  o->selection_color(y);
2604  } else {
2605  o->color(x);
2606  }
2607  }
2608  } else if (!strcmp(c,"selection_color")) {
2609  if (sscanf(read_word(),"%d",&x)) o->selection_color(x);
2610  } else if (!strcmp(c,"labeltype")) {
2611  c = read_word();
2612  if (!strcmp(c,"image")) {
2614  if (!i) read_error("Image file '%s' not found", label());
2615  else setimage(i);
2616  image_name(label());
2617  label("");
2618  } else {
2620  }
2621  } else if (!strcmp(c,"labelfont")) {
2622  if (sscanf(read_word(),"%d",&x) == 1) o->labelfont(x);
2623  } else if (!strcmp(c,"labelsize")) {
2624  if (sscanf(read_word(),"%d",&x) == 1) o->labelsize(x);
2625  } else if (!strcmp(c,"labelcolor")) {
2626  if (sscanf(read_word(),"%d",&x) == 1) o->labelcolor(x);
2627  } else if (!strcmp(c,"align")) {
2628  if (sscanf(read_word(),"%d",&x) == 1) o->align(x);
2629  } else if (!strcmp(c,"when")) {
2630  if (sscanf(read_word(),"%d",&x) == 1) o->when(x);
2631  } else if (!strcmp(c,"minimum")) {
2632  if (is_valuator()) ((Fl_Valuator*)o)->minimum(strtod(read_word(),0));
2633  if (is_spinner()) ((Fl_Spinner*)o)->minimum(strtod(read_word(),0));
2634  } else if (!strcmp(c,"maximum")) {
2635  if (is_valuator()) ((Fl_Valuator*)o)->maximum(strtod(read_word(),0));
2636  if (is_spinner()) ((Fl_Spinner*)o)->maximum(strtod(read_word(),0));
2637  } else if (!strcmp(c,"step")) {
2638  if (is_valuator()) ((Fl_Valuator*)o)->step(strtod(read_word(),0));
2639  if (is_spinner()) ((Fl_Spinner*)o)->step(strtod(read_word(),0));
2640  } else if (!strcmp(c,"value")) {
2641  if (is_valuator()) ((Fl_Valuator*)o)->value(strtod(read_word(),0));
2642  if (is_spinner()) ((Fl_Spinner*)o)->value(strtod(read_word(),0));
2643  } else if ((!strcmp(c,"slider_size")||!strcmp(c,"size"))&&is_valuator()==2) {
2644  ((Fl_Slider*)o)->slider_size(strtod(read_word(),0));
2645  } else if (!strcmp(c,"textfont")) {
2646  if (sscanf(read_word(),"%d",&x) == 1) {f=(Fl_Font)x; textstuff(1,f,s,cc);}
2647  } else if (!strcmp(c,"textsize")) {
2648  if (sscanf(read_word(),"%d",&x) == 1) {s=x; textstuff(2,f,s,cc);}
2649  } else if (!strcmp(c,"textcolor")) {
2650  if (sscanf(read_word(),"%d",&x) == 1) {cc=(Fl_Color)x;textstuff(3,f,s,cc);}
2651  } else if (!strcmp(c,"hide")) {
2652  o->hide();
2653  } else if (!strcmp(c,"deactivate")) {
2654  o->deactivate();
2655  } else if (!strcmp(c,"resizable")) {
2656  resizable(1);
2657  } else if (!strcmp(c,"hotspot") || !strcmp(c, "divider")) {
2658  hotspot(1);
2659  } else if (!strcmp(c,"class")) {
2660  subclass(read_word());
2661  } else if (!strcmp(c,"shortcut")) {
2662  int shortcut = strtol(read_word(),0,0);
2663  if (is_button()) ((Fl_Button*)o)->shortcut(shortcut);
2664  else if (is_input()) ((Fl_Input_*)o)->shortcut(shortcut);
2665  else if (is_value_input()) ((Fl_Value_Input*)o)->shortcut(shortcut);
2666  else if (is_text_display()) ((Fl_Text_Display*)o)->shortcut(shortcut);
2667  } else {
2668  if (!strncmp(c,"code",4)) {
2669  int n = atoi(c+4);
2670  if (n >= 0 && n <= NUM_EXTRA_CODE) {
2671  extra_code(n,read_word());
2672  return;
2673  }
2674  } else if (!strcmp(c,"extra_code")) {
2675  extra_code(0,read_word());
2676  return;
2677  }
2679  }
2680 }
2681 
2683  // these extra ones are for looking up fdesign saved strings:
2684  {"NO_FRAME", 0,0,(void *)FL_NO_BOX},
2685  {"ROUNDED3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX},
2686  {"ROUNDED3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX},
2687  {"OVAL3D_UPBOX", 0,0,(void *)_FL_ROUND_UP_BOX},
2688  {"OVAL3D_DOWNBOX", 0,0,(void *)_FL_ROUND_DOWN_BOX},
2689  {"0", 0,0,(void *)ZERO_ENTRY},
2690  {"1", 0,0,(void *)FL_UP_BOX},
2691  {"2", 0,0,(void *)FL_DOWN_BOX},
2692  {"3", 0,0,(void *)FL_FLAT_BOX},
2693  {"4", 0,0,(void *)FL_BORDER_BOX},
2694  {"5", 0,0,(void *)FL_SHADOW_BOX},
2695  {"6", 0,0,(void *)FL_FRAME_BOX},
2696  {"7", 0,0,(void *)FL_ROUNDED_BOX},
2697  {"8", 0,0,(void *)FL_RFLAT_BOX},
2698  {"9", 0,0,(void *)FL_RSHADOW_BOX},
2699  {"10", 0,0,(void *)FL_UP_FRAME},
2700  {"11", 0,0,(void *)FL_DOWN_FRAME},
2701 {0}};
2702 
2703 extern int fdesign_flip;
2704 int lookup_symbol(const char *, int &, int numberok = 0);
2705 
2706 int Fl_Widget_Type::read_fdesign(const char* propname, const char* value) {
2707  int v;
2708  if (!strcmp(propname,"box")) {
2709  float x,y,w,h;
2710  if (sscanf(value,"%f %f %f %f",&x,&y,&w,&h) == 4) {
2711  if (fdesign_flip) {
2712  Fl_Type *p;
2713  for (p = parent; p && !p->is_window(); p = p->parent) {/*empty*/}
2714  if (p && p->is_widget()) y = ((Fl_Widget_Type*)p)->o->h()-(y+h);
2715  }
2716  x += pasteoffset;
2717  y += pasteoffset;
2718  o->resize(int(x),int(y),int(w),int(h));
2719  }
2720  } else if (!strcmp(propname,"label")) {
2721  label(value);
2722  } else if (!strcmp(propname,"name")) {
2723  this->name(value);
2724  } else if (!strcmp(propname,"callback")) {
2725  callback(value); user_data_type("long");
2726  } else if (!strcmp(propname,"argument")) {
2727  user_data(value);
2728  } else if (!strcmp(propname,"shortcut")) {
2729  if (value[0]) {
2730  char buf[128]; sprintf(buf,"o->shortcut(\"%s\");",value);
2731  extra_code(0,buf);
2732  }
2733  } else if (!strcmp(propname,"style")) {
2734  if (!strncmp(value,"FL_NORMAL",9)) return 1;
2735  if (!lookup_symbol(value,v,1)) return 0;
2736  o->labelfont(v); o->labeltype((Fl_Labeltype)(v>>8));
2737  } else if (!strcmp(propname,"size")) {
2738  if (!lookup_symbol(value,v,1)) return 0;
2739  o->labelsize(v);
2740  } else if (!strcmp(propname,"type")) {
2741  if (!strncmp(value,"NORMAL",6)) return 1;
2742  if (lookup_symbol(value,v,1)) {o->type(v); return 1;}
2743  if (!strcmp(value+strlen(value)-5,"FRAME")) goto TRY_BOXTYPE;
2744  if (!strcmp(value+strlen(value)-3,"BOX")) goto TRY_BOXTYPE;
2745  return 0;
2746  } else if (!strcmp(propname,"lcol")) {
2747  if (!lookup_symbol(value,v,1)) return 0;
2748  o->labelcolor(v);
2749  } else if (!strcmp(propname,"return")) {
2750  if (!lookup_symbol(value,v,0)) return 0;
2751  o->when(v|FL_WHEN_RELEASE);
2752  } else if (!strcmp(propname,"alignment")) {
2753  if (!lookup_symbol(value,v)) {
2754  // convert old numeric values:
2755  int v1 = atoi(value); if (v1 <= 0 && strcmp(value,"0")) return 0;
2756  v = 0;
2757  if (v1 >= 5) {v = FL_ALIGN_INSIDE; v1 -= 5;}
2758  switch (v1) {
2759  case 0: v += FL_ALIGN_TOP; break;
2760  case 1: v += FL_ALIGN_BOTTOM; break;
2761  case 2: v += FL_ALIGN_LEFT; break;
2762  case 3: v += FL_ALIGN_RIGHT; break;
2763  case 4: v += FL_ALIGN_CENTER; break;
2764  default: return 0;
2765  }
2766  }
2767  o->align(v);
2768  } else if (!strcmp(propname,"resizebox")) {
2769  resizable(1);
2770  } else if (!strcmp(propname,"colors")) {
2771  char* p = (char*)value;
2772  while (*p != ' ') {if (!*p) return 0; p++;}
2773  *p = 0;
2774  int v1;
2775  if (!lookup_symbol(value,v,1) || !lookup_symbol(p+1,v1,1)) {
2776  *p=' '; return 0;}
2777  o->color(v,v1);
2778  } else if (!strcmp(propname,"resize")) {
2779  return !strcmp(value,"FL_RESIZE_ALL");
2780  } else if (!strcmp(propname,"gravity")) {
2781  return !strcmp(value,"FL_NoGravity FL_NoGravity");
2782  } else if (!strcmp(propname,"boxtype")) {
2783  TRY_BOXTYPE:
2784  int x = boxnumber(value);
2785  if (!x) {x = item_number(boxmenu1, value); if (x < 0) return 0;}
2786  if (x == ZERO_ENTRY) {
2787  x = 0;
2788  if (o->box() != ((Fl_Widget_Type*)factory)->o->box()) return 1; // kludge for frame
2789  }
2790  o->box((Fl_Boxtype)x);
2791  } else {
2792  return 0;
2793  }
2794  return 1;
2795 }
2796 
2798  live_mode_cb(0, 0);
2799 }
2800 
2802  live_widget = widget(o->x(), o->y(), o->w(), o->h());
2803  if (live_widget)
2804  copy_properties();
2805  return live_widget;
2806 }
2807 
2809 }
2810 
2815  if (!live_widget)
2816  return;
2817 
2818  // copy all attributes common to all widget types
2819  Fl_Widget *w = live_widget;
2820  w->label(o->label());
2821  w->tooltip(tooltip());
2822  w->type(o->type());
2823  w->box(o->box());
2824  w->color(o->color());
2826  w->labeltype(o->labeltype());
2827  w->labelfont(o->labelfont());
2828  w->labelsize(o->labelsize());
2829  w->labelcolor(o->labelcolor());
2830  w->align(o->align());
2831 
2832  // copy all attributes specific to widgets derived from Fl_Button
2833  if (is_button()) {
2834  Fl_Button* d = (Fl_Button*)live_widget, *s = (Fl_Button*)o;
2835  d->down_box(s->down_box());
2836  d->shortcut(s->shortcut());
2837  d->value(s->value());
2838  }
2839 
2840  // copy all attributes specific to widgets derived from Fl_Input_
2841  if (is_input()) {
2842  Fl_Input_* d = (Fl_Input_*)live_widget, *s = (Fl_Input_*)o;
2843  d->shortcut(s->shortcut());
2844  }
2845 
2846  // copy all attributes specific to widgets derived from Fl_Value_Input
2847  if (is_value_input()) {
2849  d->shortcut(s->shortcut());
2850  }
2851 
2852  // copy all attributes specific to widgets derived from Fl_Text_Display
2853  if (is_text_display()) {
2855  d->shortcut(s->shortcut());
2856  }
2857 
2858  // copy all attributes specific to Fl_Valuator and derived classes
2859  if (is_valuator()) {
2861  d->minimum(s->minimum());
2862  d->maximum(s->maximum());
2863  d->step(s->step());
2864  d->value(s->value());
2865  if (is_valuator()>=2) {
2866  Fl_Slider *d = (Fl_Slider*)live_widget, *s = (Fl_Slider*)o;
2867  d->slider_size(s->slider_size());
2868  }
2869  }
2870 
2871  // copy all attributes specific to Fl_Spinner and derived classes
2872  if (is_spinner()) {
2873  Fl_Spinner* d = (Fl_Spinner*)live_widget, *s = (Fl_Spinner*)o;
2874  d->minimum(s->minimum());
2875  d->maximum(s->maximum());
2876  d->step(s->step());
2877  d->value(s->value());
2878  }
2879 
2880 /* TODO: implement this
2881  {Fl_Font ff; int fs; Fl_Color fc; if (textstuff(4,ff,fs,fc)) {
2882  Fl_Font f; int s; Fl_Color c; textstuff(0,f,s,c);
2883  if (f != ff) write_string("textfont %d", f);
2884  if (s != fs) write_string("textsize %d", s);
2885  if (c != fc) write_string("textcolor %d", c);
2886  }}*/
2887 
2888  if (!o->visible())
2889  w->hide();
2890  if (!o->active())
2891  w->deactivate();
2892  if (resizable() && w->parent())
2893  w->parent()->resizable(o);
2894 }
2895 
2897 {
2899  Fl_Pack *d = (Fl_Pack*)live_widget, *s =(Fl_Pack*)o;
2900  d->spacing(s->spacing());
2901 }
2902 
2903 //
2904 // End of "$Id$".
2905 //
revert_cb
void revert_cb(Fl_Button *, void *)
Definition: Fl_Widget_Type.cxx:1800
FL_GTK_ROUND_UP_BOX
#define FL_GTK_ROUND_UP_BOX
Definition: Enumerations.H:704
step_cb
void step_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1657
Fl_Type::callback
const char * callback() const
Definition: Fl_Type.h:100
Fl_Text_Display::buffer
void buffer(Fl_Text_Buffer *buf)
Definition: Fl_Text_Display.cxx:384
FL_GTK_UP_FRAME
#define FL_GTK_UP_FRAME
Definition: Enumerations.H:698
name_public_cb
void name_public_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:357
Fl_Type::title
virtual const char * title()
Definition: Fl_Type.cxx:294
labeltype_cb
void labeltype_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:1039
FL_ALIGN_LEFT
const Fl_Align FL_ALIGN_LEFT
Definition: Enumerations.H:839
Fl_Group_Type::copy_properties
virtual void copy_properties()
Definition: Fl_Group_Type.cxx:384
Fl_Widget_Type::setlabel
virtual void setlabel(const char *)
Definition: Fl_Widget_Type.cxx:191
Fl_Widget_Type::_make
virtual Fl_Widget_Type * _make()=0
oldlabel
static char * oldlabel
Definition: Fl_Widget_Type.cxx:376
slider_size_cb
void slider_size_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1565
Fl_Choice
A button that is used to pop up a menu.
Definition: Fl_Choice.H:83
alignmenu
static Fl_Menu_Item alignmenu[]
Definition: Fl_Widget_Type.cxx:1134
overlay_cb
void overlay_cb(Fl_Button *o, void *v)
Definition: Fl_Widget_Type.cxx:1813
Fl.H
Fl_Widget::activate
void activate()
Definition: Fl_Widget.cxx:241
Fluid_Image.h
use_FL_COMMAND
int use_FL_COMMAND
Definition: Fl_Window_Type.cxx:43
FL_SHADOW_LABEL
#define FL_SHADOW_LABEL
Definition: Enumerations.H:782
FL_RSHADOW_BOX
#define FL_RSHADOW_BOX
Definition: Enumerations.H:675
Fl_Widget_Class_Type
Definition: Fl_Type.h:644
buf
static char * buf
Definition: fl_encoding_mac_roman.cxx:76
Fl_Widget_Type
Definition: Fl_Type.h:374
Fl_Widget_Type::~Fl_Widget_Type
~Fl_Widget_Type()
Definition: Fl_Widget_Type.cxx:210
item_name
const char * item_name(Fl_Menu_Item *m, int i)
Definition: Fl_Widget_Type.cxx:629
resizable_cb
void resizable_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:885
Fl_Widget::align
Fl_Align align() const
Definition: Fl_Widget.H:348
FL_NO_LABEL
does nothing
Definition: Enumerations.H:765
Fl_Window::show
virtual void show()
Definition: Fl_win32.cxx:2542
tabs_type_name
const char tabs_type_name[]
Definition: Fl_Group_Type.cxx:227
Fl_Button::value
int value(int v)
Definition: Fl_Button.cxx:41
boxmenu
Fl_Menu_Item boxmenu[]
Definition: Fl_Widget_Type.cxx:653
hotspot_cb
void hotspot_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:897
FL_META
#define FL_META
One of the meta/Windows keys is down.
Definition: Enumerations.H:563
Fl_Window_Type::sr_min_h
int sr_min_h
Definition: Fl_Type.h:641
FL_PLASTIC_THIN_UP_BOX
#define FL_PLASTIC_THIN_UP_BOX
Definition: Enumerations.H:690
Fl_Group::find
int find(const Fl_Widget *) const
Definition: Fl_Group.cxx:52
Fl_Type::current
static Fl_Type * current
Definition: Fl_Type.h:114
reading_file
int reading_file
Definition: factory.cxx:1087
Fl_Type::next
Fl_Type * next
Definition: Fl_Type.h:71
Fl_Color
unsigned int Fl_Color
Definition: Enumerations.H:934
ui_find_image
Fluid_Image * ui_find_image(const char *oldname)
Definition: Fluid_Image.cxx:242
labelfont_cb
void labelfont_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:988
Fl_Group::end
void end()
Definition: Fl_Group.cxx:75
Fl_Spinner.H
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_GLEAM_DOWN_BOX
#define FL_GLEAM_DOWN_BOX
Definition: Enumerations.H:709
x_cb
void x_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:503
box_cb
void box_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:732
Fl_Widget_Type::write_color
void write_color(const char *, Fl_Color)
Definition: Fl_Widget_Type.cxx:2201
lookup_symbol
int lookup_symbol(const char *, int &, int numberok=0)
Definition: factory.cxx:1233
Fl_Widget_Type::tooltip_
const char * tooltip_
Definition: Fl_Type.h:381
FL_GLEAM_THIN_UP_BOX
#define FL_GLEAM_THIN_UP_BOX
Definition: Enumerations.H:712
Fl_Button::down_box
Fl_Boxtype down_box() const
Definition: Fl_Button.H:152
read_version
double read_version
Definition: file.cxx:355
FL_FRAME_BOX
#define FL_FRAME_BOX
Definition: Enumerations.H:745
FL_DARK_CYAN
const Fl_Color FL_DARK_CYAN
Definition: Enumerations.H:969
Fl_Spinner::selection_color
void selection_color(Fl_Color val)
Definition: Fl_Spinner.H:248
Fl_Widget_Type::image_name
const char * image_name() const
Definition: Fl_Type.h:419
Fl_Input.H
Fl_Window_Type::sr_max_h
int sr_max_h
Definition: Fl_Type.h:641
Fl_Type::is_text_display
virtual int is_text_display() const
Definition: Fl_Type.cxx:755
FL_DARK_RED
const Fl_Color FL_DARK_RED
Definition: Enumerations.H:963
FL_ENGRAVED_FRAME
see figure 1
Definition: Enumerations.H:617
item_number
int item_number(Fl_Menu_Item *m, const char *i)
Definition: Fl_Widget_Type.cxx:640
Fl_Valuator::value
double value() const
Definition: Fl_Valuator.H:125
FL_GLEAM_DOWN_FRAME
#define FL_GLEAM_DOWN_FRAME
Definition: Enumerations.H:711
Fl_Type::write_properties
virtual void write_properties()
Definition: Fl_Type.cxx:935
Fl_Widget::show
virtual void show()
Definition: Fl_Widget.cxx:271
FL_SHADOW_FRAME
#define FL_SHADOW_FRAME
Definition: Enumerations.H:668
FL_INACTIVE_COLOR
const Fl_Color FL_INACTIVE_COLOR
the inactive foreground color
Definition: Enumerations.H:939
Fl_Boxtype
Fl_Boxtype
Definition: Enumerations.H:603
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
v_input_cb
void v_input_cb(Fl_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1347
FL_OFLAT_BOX
#define FL_OFLAT_BOX
Definition: Enumerations.H:683
FL_THIN_UP_FRAME
see figure 1
Definition: Enumerations.H:613
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
read_error
void read_error(const char *format,...)
Definition: file.cxx:151
set_cb
void set_cb(Fl_Button *, void *)
Definition: Fl_Widget_Type.cxx:1782
fl_uintptr_t
unsigned long fl_uintptr_t
Definition: Fl_Widget.H:40
boxname
const char * boxname(int i)
Definition: Fl_Widget_Type.cxx:716
Fl_Widget_Type::read_fdesign
virtual int read_fdesign(const char *, const char *)
Definition: Fl_Widget_Type.cxx:2706
relative
static Fl_Button * relative(Fl_Widget *o, int i)
Definition: Fl_Widget_Type.cxx:1129
Fl_Slider
Definition: Fl_Slider.H:61
Fl_Button::shortcut
int shortcut() const
Definition: Fl_Button.H:125
align_position_cb
void align_position_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:1192
when_button_cb
void when_button_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:841
Fl_Input_::value
int value(const char *)
Definition: Fl_Input_.cxx:1284
labelsize_cb
void labelsize_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1008
FL_GREEN
const Fl_Color FL_GREEN
Definition: Enumerations.H:958
Fl_Widget_Type::setimage
void setimage(Fluid_Image *)
Definition: Fl_Widget_Type.cxx:171
FL_WHEN_NOT_CHANGED
Do the callback whenever the user interacts with the widget.
Definition: Enumerations.H:442
check_redraw_corresponding_parent
void check_redraw_corresponding_parent(Fl_Type *)
Definition: Fl_Window_Type.cxx:1096
Fl_Button
Buttons generate callbacks when they are clicked by the user.
Definition: Fl_Button.H:79
FL_BORDER_FRAME
see figure 1
Definition: Enumerations.H:621
Fl_Widget_Type::tooltip
const char * tooltip() const
Definition: Fl_Type.h:417
Fl_Widget::window
Fl_Window * window() const
Definition: Fl_Window.cxx:118
Fl_Light_Button
Definition: Fl_Light_Button.H:38
image_input
static Fl_Input * image_input
Definition: Fl_Widget_Type.cxx:399
Fl_Widget_Type::textstuff
virtual int textstuff(int what, Fl_Font &, int &, Fl_Color &)
Definition: Fl_Widget_Type.cxx:1390
fc
static Fl_File_Chooser * fc
Definition: fl_file_dir.cxx:25
Fl_Widget::clear_changed
void clear_changed()
Definition: Fl_Widget.H:791
FL_WHEN_RELEASE
Do the callback when the button or key is released and the value changes.
Definition: Enumerations.H:443
inactive_input
static Fl_Input * inactive_input
Definition: Fl_Widget_Type.cxx:441
redraw_browser
void redraw_browser()
Definition: Fl_Type.cxx:452
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_ROUND_DOWN_BOX
#define FL_ROUND_DOWN_BOX
Definition: Enumerations.H:665
ok_cb
void ok_cb(Fl_Return_Button *o, void *v)
Definition: Fl_Widget_Type.cxx:1795
gridy
int gridy
Definition: fluid.cxx:93
down_box
static void down_box(int x, int y, int w, int h, Fl_Color c)
Definition: fl_gleam.cxx:159
Fl_Window_Type::sr_min_w
int sr_min_w
Definition: Fl_Type.h:641
Fl_Class_Type::has_function
int has_function(const char *, const char *) const
Definition: Fl_Function_Type.cxx:1482
FL_PLASTIC_UP_BOX
#define FL_PLASTIC_UP_BOX
Definition: Enumerations.H:686
varused_test
int varused_test
Definition: code.cxx:150
FL_GLEAM_ROUND_DOWN_BOX
#define FL_GLEAM_ROUND_DOWN_BOX
Definition: Enumerations.H:715
leave_live_mode_cb
void leave_live_mode_cb(Fl_Widget *, void *)
Definition: Fl_Widget_Type.cxx:2797
label_cb
void label_cb(Fl_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:379
Fl_Table.H
tooltip_cb
void tooltip_cb(Fl_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:483
y_cb
void y_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:528
the_panel
static Fl_Window * the_panel
Definition: Fl_Widget_Type.cxx:294
Fl_Type::level
int level
Definition: Fl_Type.h:69
Fl_Widget::changed
unsigned int changed() const
Definition: Fl_Widget.H:781
free
void free()
H
static int H
Definition: Fl_Tooltip.cxx:76
FL_BLUE
const Fl_Color FL_BLUE
Definition: Enumerations.H:960
FL_SUBMENU
This item is a submenu to other items.
Definition: Fl_Menu_Item.H:39
Fl_Spinner::step
double step() const
Definition: Fl_Spinner.H:179
wc_relative_cb
void wc_relative_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:603
Fl_Type::is_widget
virtual int is_widget() const
Definition: Fl_Type.cxx:749
FL_GRAY0
const Fl_Color FL_GRAY0
Definition: Enumerations.H:945
NULL
#define NULL
Definition: forms.H:34
Fl_Type::is_menu_item
virtual int is_menu_item() const
Definition: Fl_Type.cxx:756
i18n_function
const char * i18n_function
Definition: fluid.cxx:704
write_declare
int write_declare(const char *format,...)
Definition: code.cxx:127
FL_ALIGN_TEXT_OVER_IMAGE
const Fl_Align FL_ALIGN_TEXT_OVER_IMAGE
Definition: Enumerations.H:845
Fl_Widget_Type::ideal_spacing
virtual void ideal_spacing(int &x, int &y)
Definition: Fl_Widget_Type.cxx:85
current_widget
Fl_Widget_Type * current_widget
Definition: Fl_Widget_Type.cxx:303
FL_ROUNDED_BOX
#define FL_ROUNDED_BOX
Definition: Enumerations.H:670
Fl_Tabs
Definition: Fl_Tabs.H:201
Fl_Widget::when
Fl_When when() const
Definition: Fl_Widget.H:621
Fl_Widget::do_callback
void do_callback()
Definition: Fl_Widget.H:861
fl_contrast
Fl_Color fl_contrast(Fl_Color fg, Fl_Color bg)
Definition: fl_color.cxx:435
Fl_Input_::shortcut
int shortcut() const
Definition: Fl_Input_.H:374
FL_WINDOW
#define FL_WINDOW
window type id all subclasses have type() >= this
Definition: Fl_Window.H:33
FL_DIAMOND_UP_BOX
#define FL_DIAMOND_UP_BOX
Definition: Enumerations.H:677
FL_DARK2
const Fl_Color FL_DARK2
Definition: Enumerations.H:947
Fluid_Image::written
int written
Definition: Fluid_Image.h:38
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_Type::leave_live_mode
virtual void leave_live_mode()
Definition: Fl_Type.cxx:1110
Fl_Widget::user_data
void * user_data() const
Definition: Fl_Widget.H:593
Fl_Valuator::maximum
double maximum() const
Definition: Fl_Valuator.H:81
b
long b
Definition: jpegint.h:397
oldlabellen
static unsigned oldlabellen
Definition: Fl_Widget_Type.cxx:377
FL_BLACK
const Fl_Color FL_BLACK
Definition: Enumerations.H:956
snprintf
#define snprintf
Definition: flstring.h:64
h_cb
void h_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:578
FL_ALIGN_BOTTOM_LEFT
const Fl_Align FL_ALIGN_BOTTOM_LEFT
Definition: Enumerations.H:860
FL_GTK_THIN_DOWN_FRAME
#define FL_GTK_THIN_DOWN_FRAME
Definition: Enumerations.H:703
Fl_Type::is_in_class
const class Fl_Class_Type * is_in_class() const
Definition: Fl_Function_Type.cxx:1318
Fl_Type::first
static Fl_Type * first
Definition: Fl_Type.h:70
Fl_Widget_Type::image_name_
const char * image_name_
Definition: Fl_Type.h:382
min_cb
void min_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1591
w_input
Fl_Value_Input * w_input
Definition: Fl_Widget_Type.cxx:501
Fl::h
static int h()
Definition: Fl_win32.cxx:571
FL_PLASTIC_DOWN_BOX
#define FL_PLASTIC_DOWN_BOX
Definition: Enumerations.H:687
Fl_Type::is_button
virtual int is_button() const
Definition: Fl_Type.cxx:752
Fl::box_dh
static int box_dh(Fl_Boxtype)
Definition: fl_boxtype.cxx:397
Fl_Type::add_child
virtual void add_child(Fl_Type *, Fl_Type *beforethis)
Definition: Fl_Type.cxx:569
write_cstring
void write_cstring(const char *s, int length)
Definition: code.cxx:154
Fl_Menu_Item::argument
long argument() const
Definition: Fl_Menu_Item.H:262
Fl_Type::is_group
virtual int is_group() const
Definition: Fl_Type.cxx:758
FL_FOREGROUND_COLOR
const Fl_Color FL_FOREGROUND_COLOR
the default foreground color (0) used for labels and text
Definition: Enumerations.H:937
buffer
static char * buffer
Definition: file.cxx:215
FL_ALIGN_INSIDE
const Fl_Align FL_ALIGN_INSIDE
Definition: Enumerations.H:843
Fl_Value_Input
Definition: Fl_Value_Input.H:56
user_data_cb
void user_data_cb(Fl_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1300
Fl::box_dw
static int box_dw(Fl_Boxtype)
Definition: fl_boxtype.cxx:391
FL_ALIGN_LEFT_BOTTOM
const Fl_Align FL_ALIGN_LEFT_BOTTOM
Definition: Enumerations.H:864
Fl_Window.H
pasteoffset
int pasteoffset
Definition: Fl_Widget_Type.cxx:2537
force_parent
int force_parent
Definition: Fl_Widget_Type.cxx:41
Fl_Widget_Type::Fl_Widget_Type
Fl_Widget_Type()
Definition: Fl_Widget_Type.cxx:196
textfont_cb
void textfont_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:1392
Fl_Window::make_current
void make_current()
Definition: Fl_win32.cxx:2590
Fl_Widget_Type::extra_code
const char * extra_code(int n) const
Definition: Fl_Type.h:413
Fl_Widget::color
Fl_Color color() const
Definition: Fl_Widget.H:378
FL_ENGRAVED_BOX
see figure 1
Definition: Enumerations.H:615
Fl_Widget_Type::setinactive
void setinactive(Fluid_Image *)
Definition: Fl_Widget_Type.cxx:181
FL_GLEAM_THIN_DOWN_BOX
#define FL_GLEAM_THIN_DOWN_BOX
Definition: Enumerations.H:713
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_Type::comment
const char * comment()
Definition: Fl_Type.h:106
Fl_Widget_Type::default_size
static int default_size
Definition: Fl_Type.h:398
Fl_Widget::position
void position(int X, int Y)
Definition: Fl_Widget.H:332
Fl_Widget::w
void w(int v)
Definition: Fl_Widget.H:143
name_cb
void name_cb(Fl_Input *o, void *v)
Definition: Fl_Widget_Type.cxx:308
Fl_Menu_Item::user_data
void * user_data() const
Definition: Fl_Menu_Item.H:251
_FL_ROUND_UP_BOX
see figure 1
Definition: Enumerations.H:627
Fl_Widget::selection_color
Fl_Color selection_color() const
Definition: Fl_Widget.H:396
Fl_Widget::x
void x(int v)
Definition: Fl_Widget.H:139
Fl_Spinner::type
uchar type() const
Definition: Fl_Spinner.H:214
textsize_cb
void textsize_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1414
Fl_Type::new_selected
char new_selected
Definition: Fl_Type.h:64
FL_DARK_GREEN
const Fl_Color FL_DARK_GREEN
Definition: Enumerations.H:965
user_data_type_cb
void user_data_type_cb(Fl_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1318
FL_FLAT_BOX
a flat box
Definition: Enumerations.H:606
Fl_Slider.H
Fl_Widget_Type::is_public
virtual int is_public() const
Definition: Fl_Widget_Type.cxx:53
FL_THIN_UP_BOX
see figure 1
Definition: Enumerations.H:611
FL_GTK_THIN_UP_FRAME
#define FL_GTK_THIN_UP_FRAME
Definition: Enumerations.H:702
Fl_Type::is_class
virtual int is_class() const
Definition: Fl_Type.cxx:764
down_box_cb
void down_box_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:756
FL_ALIGN_TOP_LEFT
const Fl_Align FL_ALIGN_TOP_LEFT
Definition: Enumerations.H:858
y_input
Fl_Value_Input * y_input
Definition: Fl_Widget_Type.cxx:501
Fl_Widget_Type::extra_code_
const char * extra_code_[4]
Definition: Fl_Type.h:379
Fl_Type::user_data
const char * user_data() const
Definition: Fl_Type.h:102
set_max_size_cb
void set_max_size_cb(Fl_Button *, void *v)
Definition: Fl_Widget_Type.cxx:1548
FL_UP_BOX
see figure 1
Definition: Enumerations.H:607
FL_YELLOW
const Fl_Color FL_YELLOW
Definition: Enumerations.H:959
Fl_Pack_Type::copy_properties
void copy_properties()
Definition: Fl_Widget_Type.cxx:2896
boxnumber
int boxnumber(const char *i)
Definition: Fl_Widget_Type.cxx:723
fl_show_colormap.H
FL_HELVETICA
const Fl_Font FL_HELVETICA
Helvetica (or Arial) normal (0)
Definition: Enumerations.H:879
load_panel
static void load_panel()
Definition: Fl_Widget_Type.cxx:1882
FL_WHEN_RELEASE_ALWAYS
Do the callback when the button or key is released, even if the value doesn't change.
Definition: Enumerations.H:444
FL_DOWN_BOX
see figure 1
Definition: Enumerations.H:608
FL_WHEN_ENTER_KEY_ALWAYS
Do the callback when the user presses the ENTER key, even if the value doesn't change.
Definition: Enumerations.H:446
Fl_Type::type_name
virtual const char * type_name()=0
labeltypemenu
Fl_Menu_Item labeltypemenu[]
Definition: Fl_Widget_Type.cxx:1031
Fl_Group::array
Fl_Widget *const * array() const
Definition: Fl_Group.cxx:44
Fl_Spinner::value
double value() const
Definition: Fl_Spinner.H:230
Fl_Widget_Type::hotspot
uchar hotspot() const
Definition: Fl_Type.h:423
Fl_Window::set_modal
void set_modal()
Definition: Fl_Window.H:289
Fl_Widget_Type::o
Fl_Widget * o
Definition: Fl_Type.h:401
Fl_Widget_Type::public_
int public_
Definition: Fl_Type.h:402
subclass_cb
void subclass_cb(Fl_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1367
i18n_include
const char * i18n_include
Definition: fluid.cxx:703
FL_DARK_YELLOW
const Fl_Color FL_DARK_YELLOW
Definition: Enumerations.H:966
FL_PLASTIC_DOWN_FRAME
#define FL_PLASTIC_DOWN_FRAME
Definition: Enumerations.H:689
labelcolor_cb
void labelcolor_cb(Fl_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:1110
selection_changed
void selection_changed(Fl_Type *p)
Definition: Fl_Widget_Type.cxx:1921
Fl_Window::size_range
void size_range(int minw, int minh, int maxw=0, int maxh=0, int dw=0, int dh=0, int aspect=0)
Definition: Fl_Window.H:438
write_string
void write_string(const char *format,...)
Definition: file.cxx:93
Fl_Widget::visible
unsigned int visible() const
Definition: Fl_Widget.H:660
Fl_Type::is_window
virtual int is_window() const
Definition: Fl_Type.cxx:759
indentation
int indentation
Definition: code.cxx:98
Fl_Choice::value
int value() const
Definition: Fl_Choice.H:95
Fl_Window
Definition: Fl_Window.H:57
subtype_cb
void subtype_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:1732
Fl_Return_Button
Definition: Fl_Return_Button.H:33
Fl_Widget::hide
virtual void hide()
Definition: Fl_Widget.cxx:283
FL_BORDER_BOX
see figure 1
Definition: Enumerations.H:619
Fl_Pack::spacing
int spacing() const
Definition: Fl_Pack.H:61
FL_FLOAT_INPUT
#define FL_FLOAT_INPUT
Definition: Fl_Input_.H:30
Fl_Widget_Type::subtypes
virtual Fl_Menu_Item * subtypes()
Definition: Fl_Widget_Type.cxx:1730
isdeclare
int isdeclare(const char *c)
Definition: Fl_Widget_Type.cxx:1996
Fl_Type
Definition: Fl_Type.h:43
Fl_Input
Definition: Fl_Input.H:222
FL_ROUND_UP_BOX
#define FL_ROUND_UP_BOX
Definition: Enumerations.H:664
indent
const char * indent()
Definition: code.cxx:99
FL_PLASTIC_THIN_DOWN_BOX
#define FL_PLASTIC_THIN_DOWN_BOX
Definition: Enumerations.H:691
Fl_Text_Display::shortcut
int shortcut() const
Definition: Fl_Text_Display.H:277
Fl_Type::callback_name
const char * callback_name()
Definition: Fl_Widget_Type.cxx:2094
Fl_Widget::measure_label
void measure_label(int &ww, int &hh) const
Definition: Fl_Widget.H:957
Fl_Type::class_name
const char * class_name(const int need_nest) const
Definition: Fl_Function_Type.cxx:1293
array_name
const char * array_name(Fl_Widget_Type *o)
Definition: Fl_Widget_Type.cxx:1966
FL_CYAN
const Fl_Color FL_CYAN
Definition: Enumerations.H:962
Fl_Widget::redraw
void redraw()
Definition: Fl.cxx:1782
Fl_Wizard
Definition: Fl_Wizard.H:41
FL_NORMAL_SIZE
Fl_Fontsize FL_NORMAL_SIZE
normal font size
Definition: Fl_Widget.cxx:117
FL_GLEAM_ROUND_UP_BOX
#define FL_GLEAM_ROUND_UP_BOX
Definition: Enumerations.H:714
Fl_Widget
Definition: Fl_Widget.H:101
Fl_Widget::deactivate
void deactivate()
Definition: Fl_Widget.cxx:253
sort
Fl_Type * sort(Fl_Type *parent)
Definition: Fl_Widget_Type.cxx:270
Fl_Valuator::minimum
double minimum() const
Definition: Fl_Valuator.H:77
Fl_Group
Definition: Fl_Group.H:41
Fl_Group::current
static Fl_Group * current()
Definition: Fl_Group.cxx:84
fl_intptr_t
long fl_intptr_t
Definition: Fl_Widget.H:39
Fl_Menu_
Definition: Fl_Menu_.H:51
FL_GLEAM_UP_BOX
#define FL_GLEAM_UP_BOX
Definition: Enumerations.H:708
FL_OVAL_BOX
#define FL_OVAL_BOX
Definition: Enumerations.H:680
Fl_Input_::static_value
int static_value(const char *)
Definition: Fl_Input_.cxx:1248
FL_LIGHT2
const Fl_Color FL_LIGHT2
Definition: Enumerations.H:951
FL_LIGHT3
const Fl_Color FL_LIGHT3
Definition: Enumerations.H:952
alignment_panel.h
write_word
void write_word(const char *w)
Definition: file.cxx:58
FL_NO_BOX
nothing is drawn at all, this box is invisible
Definition: Enumerations.H:605
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_Type::inactive_name_
const char * inactive_name_
Definition: Fl_Type.h:383
Fl_Widget::box
Fl_Boxtype box() const
Definition: Fl_Widget.H:363
FL_DIAMOND_DOWN_BOX
#define FL_DIAMOND_DOWN_BOX
Definition: Enumerations.H:678
Fl_Type::is_menu_button
virtual int is_menu_button() const
Definition: Fl_Type.cxx:757
Fluid_Image::increment
void increment()
Definition: Fluid_Image.cxx:216
Fl_Widget_Type.h
FL_LIGHT1
const Fl_Color FL_LIGHT1
Definition: Enumerations.H:950
numselected
static int numselected
Definition: Fl_Widget_Type.cxx:305
Fl_Group::children
int children() const
Definition: Fl_Group.H:75
w_cb
void w_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:553
Fl_Type::read_property
virtual void read_property(const char *)
Definition: Fl_Type.cxx:965
Fl_Window::hide
virtual void hide()
Definition: Fl.cxx:1546
FL_DARK_BLUE
const Fl_Color FL_DARK_BLUE
Definition: Enumerations.H:967
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_EMBOSSED_LABEL
#define FL_EMBOSSED_LABEL
Definition: Enumerations.H:786
Fl_Widget_Type::subclass_
const char * subclass_
Definition: Fl_Type.h:380
Fl_Type::msgnum
int msgnum()
Definition: Fl_Type.cxx:633
FL_GTK_DOWN_FRAME
#define FL_GTK_DOWN_FRAME
Definition: Enumerations.H:699
comment_cb
void comment_cb(Fl_Text_Editor *i, void *v)
Definition: Fl_Widget_Type.cxx:1276
Fl_Widget_Class_Type::wc_relative
char wc_relative
Definition: Fl_Type.h:652
Fl_Menu_::mvalue
const Fl_Menu_Item * mvalue() const
Definition: Fl_Menu_.H:138
FL_SELECTION_COLOR
const Fl_Color FL_SELECTION_COLOR
the default selection/highlight color
Definition: Enumerations.H:940
fl_show_colormap
FL_EXPORT Fl_Color fl_show_colormap(Fl_Color oldcol)
Pops up a window to let the user pick a colormap entry.
Definition: fl_show_colormap.cxx:146
color
void color(int n)
Definition: gl2opengl.h:29
FL_PLASTIC_UP_FRAME
#define FL_PLASTIC_UP_FRAME
Definition: Enumerations.H:688
FL_ALIGN_RIGHT_TOP
const Fl_Align FL_ALIGN_RIGHT_TOP
Definition: Enumerations.H:863
Fl_Window::label
const char * label() const
Definition: Fl_Window.H:450
FL_GTK_ROUND_DOWN_BOX
#define FL_GTK_ROUND_DOWN_BOX
Definition: Enumerations.H:705
Fl_Widget_Type::copy_properties
virtual void copy_properties()
Definition: Fl_Widget_Type.cxx:2814
Fl_Widget::y
void y(int v)
Definition: Fl_Widget.H:141
FL_OSHADOW_BOX
#define FL_OSHADOW_BOX
Definition: Enumerations.H:681
FL_RED
const Fl_Color FL_RED
Definition: Enumerations.H:957
set_min_size_cb
void set_min_size_cb(Fl_Button *, void *v)
Definition: Fl_Widget_Type.cxx:1531
write_h
void write_h(const char *format,...)
Definition: code.cxx:272
Fluid_Image::decrement
void decrement()
Definition: Fluid_Image.cxx:220
Fl_Box
Definition: Fl_Box.H:34
boxmenu1
Fl_Menu_Item boxmenu1[]
Definition: Fl_Widget_Type.cxx:2682
min_h_cb
void min_h_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1480
max_w_cb
void max_w_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1497
set_modflag
void set_modflag(int mf)
Definition: fluid.cxx:1687
FL_PLASTIC_ROUND_DOWN_BOX
#define FL_PLASTIC_ROUND_DOWN_BOX
Definition: Enumerations.H:693
Fl_Widget_Type::widget
virtual Fl_Widget * widget(int, int, int, int)=0
max_h_cb
void max_h_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1514
name_public_member_cb
void name_public_member_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:332
color_cb
void color_cb(Fl_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:1065
Fl_Slider::slider_size
float slider_size() const
Definition: Fl_Slider.H:87
x
int x
Definition: test.c:73
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_GTK_DOWN_BOX
#define FL_GTK_DOWN_BOX
Definition: Enumerations.H:697
Fl_Widget::callback
Fl_Callback_p callback() const
Definition: Fl_Widget.H:561
Fl_Text_Display
Rich text display widget.
Definition: Fl_Text_Display.H:82
Fl_Font
int Fl_Font
Definition: Enumerations.H:877
Fl_Widget_Type::subclass
const char * subclass() const
Definition: Fl_Type.h:415
Fl_Valuator
Definition: Fl_Valuator.H:49
Fl_Labeltype
Fl_Labeltype
Definition: Enumerations.H:763
storestring
int storestring(const char *n, const char *&p, int nostrip)
Definition: Fl_Type.cxx:670
Fl_Widget_Type::ideal_size
virtual void ideal_size(int &w, int &h)
Definition: Fl_Widget_Type.cxx:72
when_cb
void when_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:817
FL_ALIGN_WRAP
const Fl_Align FL_ALIGN_WRAP
Definition: Enumerations.H:851
Fl_Type::visible
char visible
Definition: Fl_Type.h:67
Fl_Widget_Type::write_code1
void write_code1()
Definition: Fl_Widget_Type.cxx:2101
FL_BACKGROUND2_COLOR
const Fl_Color FL_BACKGROUND2_COLOR
the default background color for text, list, and valuator widgets
Definition: Enumerations.H:938
FL_ALIGN_TOP
const Fl_Align FL_ALIGN_TOP
Definition: Enumerations.H:833
FL_GLEAM_UP_FRAME
#define FL_GLEAM_UP_FRAME
Definition: Enumerations.H:710
haderror
static int haderror
Definition: Fl_Widget_Type.cxx:306
FL_ALIGN_CENTER
const Fl_Align FL_ALIGN_CENTER
Definition: Enumerations.H:830
LOAD
void *const LOAD
Definition: Fl_Widget_Type.cxx:304
Fl_Group.H
Fl_Widget_Type::image
Fluid_Image * image
Definition: Fl_Type.h:404
Fl_Double_Window
Definition: Fl_Double_Window.H:40
align_cb
void align_cb(Fl_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:1154
Fl_Spinner::maximum
double maximum() const
Definition: Fl_Spinner.H:155
CodeEditor
Definition: CodeEditor.h:35
FL_SHADOW_BOX
#define FL_SHADOW_BOX
Definition: Enumerations.H:667
Fl_Menu_Item
Definition: Fl_Menu_Item.H:112
read_word
const char * read_word(int wantbrace)
Definition: file.cxx:230
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_Widget::argument
long argument() const
Definition: Fl_Widget.H:605
Fl_Widget_Type::is_widget
virtual int is_widget() const
Definition: Fl_Widget_Type.cxx:52
Fl_Widget::tooltip
const char * tooltip() const
Definition: Fl_Widget.H:552
Fl_Widget_Type::write_properties
virtual void write_properties()
Definition: Fl_Widget_Type.cxx:2418
y
int y
Definition: test.c:74
Fl_Type::write_comment_inline_c
void write_comment_inline_c(const char *ind=0L)
Definition: Fl_Type.cxx:1050
FL_EMBOSSED_FRAME
see figure 1
Definition: Enumerations.H:618
Fl_Widget_Type::write_static
void write_static()
Definition: Fl_Widget_Type.cxx:2005
update_sourceview_position
void update_sourceview_position()
Definition: fluid.cxx:1591
Fl_Widget_Type::read_property
virtual void read_property(const char *)
Definition: Fl_Widget_Type.cxx:2539
x_input
Fl_Value_Input * x_input
Definition: Fl_Widget_Type.cxx:501
Fl_Type::is_value_input
virtual int is_value_input() const
Definition: Fl_Type.cxx:754
image_cb
void image_cb(Fl_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:401
Fl_Type::is_spinner
virtual int is_spinner() const
Definition: Fl_Type.cxx:751
FL_DARK_MAGENTA
const Fl_Color FL_DARK_MAGENTA
Definition: Enumerations.H:968
active_cb
void active_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:947
Fl_Widget::type
uchar type() const
Definition: Fl_Widget.H:274
i18n_set
const char * i18n_set
Definition: fluid.cxx:706
FL_ALIGN_TOP_RIGHT
const Fl_Align FL_ALIGN_TOP_RIGHT
Definition: Enumerations.H:859
propagate_load
void propagate_load(Fl_Group *g, void *v)
Definition: Fl_Widget_Type.cxx:1772
varused
int varused
Definition: code.cxx:151
subclassname
const char * subclassname(Fl_Type *l)
Definition: Fl_Widget_Type.cxx:55
visible_cb
void visible_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:920
is_id
int is_id(char c)
Definition: code.cxx:40
f
Fl_Box_Draw_F * f
Definition: fl_boxtype.cxx:285
Fl_Widget::parent
Fl_Group * parent() const
Definition: Fl_Widget.H:254
image_browse_cb
void image_browse_cb(Fl_Button *b, void *v)
Definition: Fl_Widget_Type.cxx:420
Fl_Group::child
Fl_Widget * child(int n) const
Definition: Fl_Group.H:79
fdesign_flip
int fdesign_flip
Definition: file.cxx:550
gridx
int gridx
Definition: fluid.cxx:92
Fl_Spinner::color
void color(Fl_Color v)
Definition: Fl_Spinner.H:240
FL_PLASTIC_ROUND_UP_BOX
#define FL_PLASTIC_ROUND_UP_BOX
Definition: Enumerations.H:692
_FL_ROUND_DOWN_BOX
see figure 1
Definition: Enumerations.H:628
Y
static int Y
Definition: Fl_Tooltip.cxx:76
Fl_Menu_Item::text
const char * text
menu item text, returned by label()
Definition: Fl_Menu_Item.H:113
FL_BACKGROUND_COLOR
const Fl_Color FL_BACKGROUND_COLOR
Definition: Enumerations.H:949
Fl_Type::prev
Fl_Type * prev
Definition: Fl_Type.h:71
Fl_Window_Type
Definition: Fl_Type.h:584
Fl_Type::selected
char selected
Definition: Fl_Type.h:65
has_toplevel_function
int has_toplevel_function(const char *rtype, const char *sig)
Definition: Fl_Type.cxx:989
Fl_Window_Type::sr_max_w
int sr_max_w
Definition: Fl_Type.h:641
Fl_Widget_Type::open
void open()
Definition: Fl_Widget_Type.cxx:1905
Fl_Widget_Type::enter_live_mode
virtual Fl_Widget * enter_live_mode(int top=0)
Definition: Fl_Widget_Type.cxx:2801
FL_ENGRAVED_LABEL
#define FL_ENGRAVED_LABEL
Definition: Enumerations.H:784
Fluid_Image::find
static Fluid_Image * find(const char *)
Definition: Fluid_Image.cxx:160
ui_find_image_name
const char * ui_find_image_name
Definition: Fluid_Image.cxx:241
align_text_image_cb
void align_text_image_cb(Fl_Choice *i, void *v)
Definition: Fl_Widget_Type.cxx:1221
FL_ROUNDED_FRAME
#define FL_ROUNDED_FRAME
Definition: Enumerations.H:671
FL_DARK1
const Fl_Color FL_DARK1
Definition: Enumerations.H:948
write_indent
void write_indent(int n)
Definition: file.cxx:103
Fl_Input_
Definition: Fl_Input_.H:94
Fl_Widget::resize
virtual void resize(int x, int y, int w, int h)
Definition: Fl_Widget.cxx:150
Fl_Widget_Type::xclass
const char * xclass
Definition: Fl_Type.h:400
Fl::w
static int w()
Definition: Fl_win32.cxx:579
Fl_Widget_Type::inactive_name
const char * inactive_name() const
Definition: Fl_Type.h:421
wLiveMode
Fl_Button * wLiveMode
Definition: widget_panel.cxx:89
is_name
int is_name(const char *c)
Definition: Fl_Widget_Type.cxx:1958
FL_ALIGN_RIGHT
const Fl_Align FL_ALIGN_RIGHT
Definition: Enumerations.H:841
FL_UP_FRAME
see figure 1
Definition: Enumerations.H:609
Fl::delete_widget
static void delete_widget(Fl_Widget *w)
Definition: Fl.cxx:1966
widget_panel.h
Fl_Type::factory
Fl_Type * factory
Definition: Fl_Type.h:73
i18n_file
const char * i18n_file
Definition: fluid.cxx:705
whenmenu
Fl_Menu_Item whenmenu[]
Definition: Fl_Widget_Type.cxx:800
color2_cb
void color2_cb(Fl_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:1089
redraw_overlays
void redraw_overlays()
Definition: Fl_Window_Type.cxx:1112
Fl_Widget_Type::inactive
Fluid_Image * inactive
Definition: Fl_Type.h:406
Fl_Widget_Type::redraw
void redraw()
Definition: Fl_Widget_Type.cxx:256
Fl_Widget::labelsize
Fl_Fontsize labelsize() const
Definition: Fl_Widget.H:502
Fl_When
Fl_When
Definition: Enumerations.H:439
Fl_Widget_Type::make
Fl_Type * make()
Definition: Fl_Widget_Type.cxx:94
fl_message.H
Fl_Value_Input::shortcut
int shortcut() const
Definition: Fl_Value_Input.H:87
FL_GTK_THIN_UP_BOX
#define FL_GTK_THIN_UP_BOX
Definition: Enumerations.H:700
Fl_Align
unsigned Fl_Align
Definition: Enumerations.H:828
h_input
Fl_Value_Input * h_input
Definition: Fl_Widget_Type.cxx:501
Fl_Widget_Type::write_code2
void write_code2()
Definition: Fl_Widget_Type.cxx:2411
live_mode_cb
void live_mode_cb(Fl_Button *o, void *)
Definition: Fl_Widget_Type.cxx:1819
max_cb
void max_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1624
FL_MAGENTA
const Fl_Color FL_MAGENTA
Definition: Enumerations.H:961
uchar
unsigned char uchar
Definition: fl_types.h:30
Fl_Widget::deimage
Fl_Image * deimage()
Definition: Fl_Widget.H:533
FL_WHEN_NEVER
Never call the callback.
Definition: Enumerations.H:440
FL_THIN_DOWN_FRAME
see figure 1
Definition: Enumerations.H:614
Fl_Type::is_valuator
virtual int is_valuator() const
Definition: Fl_Type.cxx:750
FL_CTRL
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:559
Fluid_Image::image
void image(Fl_Widget *)
Definition: Fluid_Image.cxx:33
FL_EMBOSSED_BOX
see figure 1
Definition: Enumerations.H:616
NUM_EXTRA_CODE
#define NUM_EXTRA_CODE
Definition: Fl_Type.h:372
textcolor_cb
void textcolor_cb(Fl_Button *i, void *v)
Definition: Fl_Widget_Type.cxx:1436
FL_ALIGN_POSITION_MASK
const Fl_Align FL_ALIGN_POSITION_MASK
Definition: Enumerations.H:867
Fluid_Image
Definition: Fluid_Image.h:29
Fl_Widget_Type::write_widget_code
void write_widget_code()
Definition: Fl_Widget_Type.cxx:2240
Fl_Widget_Type::hotspot_
uchar hotspot_
Definition: Fl_Type.h:384
FL_ALIGN_LEFT_TOP
const Fl_Align FL_ALIGN_LEFT_TOP
Definition: Enumerations.H:862
Fluid_Image::deimage
void deimage(Fl_Widget *)
Definition: Fluid_Image.cxx:37
callback_cb
void callback_cb(CodeEditor *i, void *v)
Definition: Fl_Widget_Type.cxx:1252
Fl_Spinner::minimum
double minimum() const
Definition: Fl_Spinner.H:161
c_check
const char * c_check(const char *c, int type)
Definition: Fl_Function_Type.cxx:121
make_widget_panel
Fl_Double_Window * make_widget_panel()
Definition: widget_panel.cxx:94
FL_GTK_THIN_DOWN_BOX
#define FL_GTK_THIN_DOWN_BOX
Definition: Enumerations.H:701
Fl_Type::is_input
virtual int is_input() const
Definition: Fl_Type.cxx:753
Fl_Type::remove
Fl_Type * remove()
Definition: Fl_Type.cxx:650
Fl_Class_Type
Definition: Fl_Type.h:338
Fl_Input_Choice
Definition: Fl_Input_Choice.H:95
Fl_Valuator::step
void step(int a)
Definition: Fl_Valuator.H:106
cancel_cb
void cancel_cb(Fl_Button *o, void *v)
Definition: Fl_Widget_Type.cxx:1807
FL_OVAL_FRAME
#define FL_OVAL_FRAME
Definition: Enumerations.H:682
Fl_Button::clear
int clear()
Definition: Fl_Button.H:117
FL_ALIGN_IMAGE_MASK
const Fl_Align FL_ALIGN_IMAGE_MASK
Definition: Enumerations.H:868
FL_GTK_UP_BOX
#define FL_GTK_UP_BOX
Definition: Enumerations.H:696
Fl_Widget::image
Fl_Image * image()
Definition: Fl_Widget.H:514
whensymbolmenu
static Fl_Menu_Item whensymbolmenu[]
Definition: Fl_Widget_Type.cxx:808
Fl_Widget_Type::write_extra_code
void write_extra_code()
Definition: Fl_Widget_Type.cxx:2399
toggle_overlays
void toggle_overlays(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:1117
Fl_Group::resizable
void resizable(Fl_Widget &o)
Definition: Fl_Group.H:117
Fl_Spinner
Definition: Fl_Spinner.H:45
ZERO_ENTRY
#define ZERO_ENTRY
Definition: Fl_Widget_Type.cxx:651
FL_ALIGN_CLIP
const Fl_Align FL_ALIGN_CLIP
Definition: Enumerations.H:849
FL_RFLAT_BOX
#define FL_RFLAT_BOX
Definition: Enumerations.H:673
inactive_cb
void inactive_cb(Fl_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:443
Fl_Widget_Type::leave_live_mode
virtual void leave_live_mode()
Definition: Fl_Widget_Type.cxx:2808
Fl_Text_Editor
Definition: Fl_Text_Editor.H:40
FL_DOWN_FRAME
see figure 1
Definition: Enumerations.H:610
min_w_cb
void min_w_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1462
Fl_Widget_Type::resizable
uchar resizable() const
Definition: Fl_Widget_Type.cxx:859
FL_INT_INPUT
#define FL_INT_INPUT
Definition: Fl_Input_.H:31
inactive_browse_cb
void inactive_browse_cb(Fl_Button *b, void *v)
Definition: Fl_Widget_Type.cxx:462
fontmenu
Fl_Menu_Item fontmenu[]
Definition: Fl_Widget_Type.cxx:969
Fl_Widget_Type::write_block_close
void write_block_close()
Definition: Fl_Widget_Type.cxx:2405
i18n_type
int i18n_type
Definition: fluid.cxx:702
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
value_cb
void value_cb(Fl_Value_Input *i, void *v)
Definition: Fl_Widget_Type.cxx:1690
Fl_Pack
Definition: Fl_Pack.H:43
FL_DARK3
const Fl_Color FL_DARK3
Definition: Enumerations.H:946
FL_THIN_DOWN_BOX
see figure 1
Definition: Enumerations.H:612
write_public
void write_public(int state)
Definition: Fl_Function_Type.cxx:1447