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_Window_Type.cxx
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Window type code for the Fast Light Tool Kit (FLTK).
5 //
6 // The widget describing an Fl_Window. This is also all the code
7 // for interacting with the overlay, which allows the user to
8 // select, move, and resize the children widgets.
9 //
10 // Copyright 1998-2010 by Bill Spitzak and others.
11 //
12 // This library is free software. Distribution and use rights are outlined in
13 // the file "COPYING" which should have been included with this file. If this
14 // file is missing or damaged, see the license at:
15 //
16 // http://www.fltk.org/COPYING.php
17 //
18 // Please report all bugs and problems on the following page:
19 //
20 // http://www.fltk.org/str.php
21 //
22 
23 #include <FL/Fl.H>
24 #include <FL/Fl_Overlay_Window.H>
25 #include <FL/fl_message.H>
26 #include <FL/fl_draw.H>
27 #include <FL/x.H>
28 #include <FL/Fl_Menu_Item.H>
29 #include <FL/Fl_Round_Button.H>
30 #include "Fl_Widget_Type.h"
31 #include "undo.h"
32 #include <math.h>
33 #include <stdlib.h>
34 #include "alignment_panel.h"
35 #include <stdio.h>
36 
37 extern int gridx;
38 extern int gridy;
39 extern int snap;
40 extern int show_guides;
41 
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 inline int fl_min(int a, int b) { return (a < b ? a : b); }
53 
54 #include "widget_panel.h"
55 
56 // Update the XYWH values in the widget panel...
57 static void update_xywh() {
63  }
64 }
65 
66 void guides_cb(Fl_Check_Button *i, long) {
67  show_guides = i->value();
68  fluid_prefs.set("show_guides", show_guides);
69 
70  for (Fl_Type *p = Fl_Type::first; p; p = p->next) {
71  if (p->is_window()) {
73  ((Fl_Overlay_Window *)(w->o))->redraw_overlay();
74  }
75  }
76 }
77 
78 void grid_cb(Fl_Int_Input *i, long v) {
79  int n = atoi(i->value());
80  if (n < 0) n = 0;
81  switch (v) {
82  case 1:
83  gridx = n;
84  fluid_prefs.set("gridx", n);
85  break;
86  case 2:
87  gridy = n;
88  fluid_prefs.set("gridy", n);
89  break;
90  case 3:
91  snap = n;
92  fluid_prefs.set("snap", n);
93  break;
94  }
95 
96  // Next go through all of the windows in the project and set the
97  // stepping for resizes...
98  Fl_Type *p;
99  Fl_Window_Type *w;
100 
101  for (p = Fl_Type::first; p; p = p->next) {
102  if (p->is_window()) {
103  w = (Fl_Window_Type *)p;
104  ((Fl_Window *)(w->o))->size_range(gridx, gridy,
105  Fl::w(), Fl::h(),
106  gridx, gridy, 0);
107  }
108  }
109 }
110 
111 // Set default widget sizes...
113  // Update the "normal" text size of new widgets...
114  b->setonly();
117 }
118 
119 
120 void i18n_type_cb(Fl_Choice *c, void *) {
121  undo_checkpoint();
122 
123  switch (i18n_type = c->value()) {
124  case 0 : /* None */
127  i18n_set_input->hide();
129  break;
130  case 1 : /* GNU gettext */
131  i18n_include_input->value("<libintl.h>");
133  i18n_function_input->value("gettext");
137  i18n_set_input->hide();
139  break;
140  case 2 : /* POSIX cat */
141  i18n_include_input->value("<nl_types.h>");
142  i18n_file_input->value("");
144  i18n_set_input->value("1");
149  i18n_set_input->show();
151  break;
152  }
153 
154  set_modflag(1);
155 }
156 
157 void i18n_text_cb(Fl_Input *i, void *) {
158  undo_checkpoint();
159 
160  if (i == i18n_function_input)
161  i18n_function = i->value();
162  else if (i == i18n_file_input)
163  i18n_file = i->value();
164  else if (i == i18n_include_input)
165  i18n_include = i->value();
166 
167  set_modflag(1);
168 }
169 
170 void i18n_int_cb(Fl_Int_Input *i, void *) {
171  undo_checkpoint();
172 
173  if (i == i18n_set_input)
174  i18n_set = i->value();
175 
176  set_modflag(1);
177 }
178 
179 extern const char* header_file_name;
180 extern const char* code_file_name;
181 
182 void show_project_cb(Fl_Widget *, void *) {
193  switch (i18n_type) {
194  case 0 : /* None */
197  i18n_set_input->hide();
199  break;
200  case 1 : /* GNU gettext */
203  i18n_set_input->hide();
205  break;
206  case 2 : /* POSIX cat */
209  i18n_set_input->show();
211  break;
212  }
214  project_window->show();
215 }
216 
217 void show_grid_cb(Fl_Widget *, void *) {
218  char buf[128];
219  sprintf(buf,"%d",gridx); horizontal_input->value(buf);
220  sprintf(buf,"%d",gridy); vertical_input->value(buf);
221  sprintf(buf,"%d",snap); snap_input->value(buf);
224  if (s<=8) def_widget_size[0]->setonly();
225  else if (s<=11) def_widget_size[1]->setonly();
226  else if (s<=14) def_widget_size[2]->setonly();
227  else if (s<=18) def_widget_size[3]->setonly();
228  else if (s<=24) def_widget_size[4]->setonly();
229  else if (s<=32) def_widget_size[5]->setonly();
231  grid_window->show();
232 }
233 
234 void show_settings_cb(Fl_Widget *, void *) {
237 }
238 
242 }
243 
244 void header_input_cb(Fl_Input* i, void*) {
245  if (header_file_name && strcmp(header_file_name, i->value()))
246  set_modflag(1);
247  header_file_name = i->value();
248 }
249 void code_input_cb(Fl_Input* i, void*) {
250  if (code_file_name && strcmp(code_file_name, i->value()))
251  set_modflag(1);
252  code_file_name = i->value();
253 }
254 
256  if (include_H_from_C != b->value()) {
257  set_modflag(1);
258  include_H_from_C = b->value();
259  }
260 }
261 
263  if (use_FL_COMMAND != b->value()) {
264  set_modflag(1);
265  use_FL_COMMAND = b->value();
266  }
267 }
268 
270 
272  {"Single",0,0,(void*)FL_WINDOW},
273  {"Double",0,0,(void*)(FL_WINDOW+1)},
274  {0}};
275 
277 
278 // The following Fl_Widget is used to simulate the windows. It has
279 // an overlay for the fluid ui, and special-cases the FL_NO_BOX.
280 
282  void draw();
283  void draw_overlay();
284 public:
286  int handle(int);
288  void resize(int,int,int,int);
289  uchar *read_image(int &ww, int &hh);
290 };
292  const int CHECKSIZE = 8;
293  // see if box is clear or a frame or rounded:
294  if ((damage()&FL_DAMAGE_ALL) &&
295  (!box() || (box()>=4&&!(box()&2)) || box()>=_FL_ROUNDED_BOX)) {
296  // if so, draw checkerboard so user can see what areas are clear:
297  for (int Y = 0; Y < h(); Y += CHECKSIZE)
298  for (int X = 0; X < w(); X += CHECKSIZE) {
299  fl_color(((Y/(2*CHECKSIZE))&1) != ((X/(2*CHECKSIZE))&1) ?
300  FL_WHITE : FL_BLACK);
301  fl_rectf(X,Y,CHECKSIZE,CHECKSIZE);
302  }
303  }
305 }
306 
307 extern Fl_Window *main_window;
308 
309 // Read an image of the overlay window
310 uchar *Overlay_Window::read_image(int &ww, int &hh) {
311  // Create an off-screen buffer for the window...
312  //main_window->make_current();
313  make_current();
314 
315  ww = w();
316  hh = h();
317 
318  Fl_Offscreen offscreen = fl_create_offscreen(ww, hh);
319  uchar *pixels;
320 
321  // Redraw the window into the offscreen buffer...
322  fl_begin_offscreen(offscreen);
323 
324  if (!shown()) image(Fl::scheme_bg_);
325 
326  redraw();
327  draw();
328 
329  // Read the screen image...
330  pixels = fl_read_image(0, 0, 0, ww, hh);
331 
333 
334  // Cleanup and return...
335  fl_delete_offscreen(offscreen);
337  return pixels;
338 }
339 
341  window->draw_overlay();
342 }
344  int ret = window->handle(e);
345  if (ret==0) {
346  switch (e) {
347  case FL_SHOW:
348  case FL_HIDE:
349  ret = Fl_Overlay_Window::handle(e);
350  }
351  }
352  return ret;
353 }
354 
357  while (p && !p->is_code_block()) p = p->parent;
358  if (!p) {
359  fl_message("Please select a function");
360  return 0;
361  }
362  Fl_Window_Type *myo = new Fl_Window_Type();
363  if (!this->o) {// template widget
364  this->o = new Fl_Window(100,100);
366  }
367  // Set the size ranges for this window; in order to avoid opening the
368  // X display we use an arbitrary maximum size...
369  ((Fl_Window *)(this->o))->size_range(gridx, gridy,
370  3072, 2048,
371  gridx, gridy, 0);
372  myo->factory = this;
373  myo->drag = 0;
374  myo->numselected = 0;
375  Overlay_Window *w = new Overlay_Window(100,100);
376  w->window = myo;
377  myo->o = w;
378  myo->add(p);
379  myo->modal = 0;
380  myo->non_modal = 0;
381  return myo;
382 }
383 
385  if (!cc->is_widget()) return;
386  Fl_Widget_Type* c = (Fl_Widget_Type*)cc;
387  Fl_Widget* b = before ? ((Fl_Widget_Type*)before)->o : 0;
388  ((Fl_Window*)o)->insert(*(c->o), b);
389  o->redraw();
390 }
391 
393  Fl_Widget_Type* c = (Fl_Widget_Type*)cc;
394  ((Fl_Window*)o)->remove(c->o);
395  o->redraw();
396 }
397 
399  Fl_Widget_Type* c = (Fl_Widget_Type*)cc;
400  ((Fl_Window*)o)->remove(c->o);
401  Fl_Widget* b = before ? ((Fl_Widget_Type*)before)->o : 0;
402  ((Fl_Window*)o)->insert(*(c->o), b);
403  o->redraw();
404 }
405 
407 
408 // Double-click on window widget shows the window, or if already shown,
409 // it shows the control panel.
412  if (w->shown()) {
413  w->show();
415  } else {
416  Fl_Widget *p = w->resizable();
417  if (!p) w->resizable(w);
418  w->show();
419  w->resizable(p);
420  }
421 
422  w->image(Fl::scheme_bg_);
423  w->size_range(gridx, gridy, Fl::w(), Fl::h(), gridx, gridy, 0);
424 }
425 
426 // Read an image of the window
427 uchar *Fl_Window_Type::read_image(int &ww, int &hh) {
429 
430  // Read the screen image...
431  return (w->read_image(ww, hh));
432 }
433 
434 
435 // control panel items:
436 
437 void modal_cb(Fl_Light_Button* i, void* v) {
438  if (v == LOAD) {
439  if (!current_widget->is_window()) {i->hide(); return;}
440  i->show();
441  i->value(((Fl_Window_Type *)current_widget)->modal);
442  } else {
443  ((Fl_Window_Type *)current_widget)->modal = i->value();
444  set_modflag(1);
445  }
446 }
447 
448 void non_modal_cb(Fl_Light_Button* i, void* v) {
449  if (v == LOAD) {
450  if (!current_widget->is_window()) {i->hide(); return;}
451  i->show();
452  i->value(((Fl_Window_Type *)current_widget)->non_modal);
453  } else {
454  ((Fl_Window_Type *)current_widget)->non_modal = i->value();
455  set_modflag(1);
456  }
457 }
458 
459 void border_cb(Fl_Light_Button* i, void* v) {
460  if (v == LOAD) {
461  if (!current_widget->is_window()) {i->hide(); return;}
462  i->show();
463  i->value(((Fl_Window*)(current_widget->o))->border());
464  } else {
465  ((Fl_Window*)(current_widget->o))->border(i->value());
466  set_modflag(1);
467  }
468 }
469 
470 void xclass_cb(Fl_Input* i, void* v) {
471  if (v == LOAD) {
472  if (!current_widget->is_window()) {
473  i->hide();
474  i->parent()->hide(); // hides the "X Class:" label as well
475  return;
476  }
477  i->show();
478  i->parent()->show();
479  i->value(((Fl_Widget_Type *)current_widget)->xclass);
480  } else {
481  int mod = 0;
482  for (Fl_Type *o = Fl_Type::first; o; o = o->next) {
483  if (o->selected && o->is_widget()) {
484  mod = 1;
486  if (w->is_window() || w->is_button())
487  storestring(i->value(),w->xclass);
488  if (w->is_window()) ((Fl_Window*)(w->o))->xclass(w->xclass);
489  else if (w->is_menu_item()) w->redraw();
490  }
491  }
492  if (mod) set_modflag(1);
493  }
494 }
495 
497 
498 void Fl_Window_Type::setlabel(const char *n) {
499  if (o) ((Fl_Window *)o)->label(n);
500 }
501 
502 // make() is called on this widget when user picks window off New menu:
504 
505 // Resize from window manager...
506 void Overlay_Window::resize(int X,int Y,int W,int H) {
507  Fl_Widget* t = resizable(); resizable(0);
508 
509  // do not set the mod flag if the window was not resized. In FLUID, all
510  // windows are opened without a given x/y position, so modifying x/y
511  // should not mark the project as dirty
512  if (W!=w() || H!=h())
513  set_modflag(1);
514 
516  resizable(t);
517  update_xywh();
518 }
519 
520 // calculate actual move by moving mouse position (mx,my) to
521 // nearest multiple of gridsize, and snap to original position
523  int mydx, mydy;
524  if (Fl::event_state(FL_ALT) || !snap) {
525  mydx = mx-x1;
526  mydy = my-y1;
527 
528  if (abs(mydx) < 2 && abs(mydy) < 2) mydx = mydy = 0;
529  } else {
530  int dx0 = mx-x1;
531  int ix = (drag&RIGHT) ? br : bx;
532  mydx = gridx ? ((ix+dx0+gridx/2)/gridx)*gridx - ix : dx0;
533  if (dx0 > snap) {
534  if (mydx < 0) mydx = 0;
535  } else if (dx0 < -snap) {
536  if (mydx > 0) mydx = 0;
537  } else
538  mydx = 0;
539  int dy0 = my-y1;
540  int iy = (drag&BOTTOM) ? by : bt;
541  mydy = gridy ? ((iy+dy0+gridy/2)/gridy)*gridy - iy : dy0;
542  if (dy0 > snap) {
543  if (mydy < 0) mydy = 0;
544  } else if (dy0 < -snap) {
545  if (mydy > 0) mydy = 0;
546  } else
547  mydy = 0;
548  }
549 
550  if (!(drag & (DRAG | BOX | LEFT | RIGHT))) {
551  mydx = 0;
552  dx = 0;
553  }
554 
555  if (!(drag & (DRAG | BOX | TOP | BOTTOM))) {
556  mydy = 0;
557  dy = 0;
558  }
559 
560  if (dx != mydx || dy != mydy) {
561  dx = mydx; dy = mydy;
562  ((Overlay_Window *)o)->redraw_overlay();
563  }
564 }
565 
566 // Move a widget according to dx and dy calculated above
567 void Fl_Window_Type::newposition(Fl_Widget_Type *myo,int &X,int &Y,int &R,int &T) {
568  X = myo->o->x();
569  Y = myo->o->y();
570  R = X+myo->o->w();
571  T = Y+myo->o->h();
572  if (!drag) return;
573  if (drag&DRAG) {
574  X += dx;
575  Y += dy;
576  R += dx;
577  T += dy;
578  } else {
579  if (drag&LEFT) {
580  if (X==bx) {
581  X += dx;
582  } else {
583  if (X<bx+dx) X = bx+dx;
584  }
585  }
586  if (drag&TOP) {
587  if (Y==by) {
588  Y += dy;
589  } else {
590  if (Y<by+dy) Y = by+dy;
591  }
592  }
593  if (drag&RIGHT) {
594  if (R==br) {
595  R += dx;
596  } else {
597  if (R>br+dx) R = br+dx;
598  }
599  }
600  if (drag&BOTTOM) {
601  if (T==bt) {
602  T += dy;
603  } else {
604  if (T>bt+dx) T = bt+dx;
605  }
606  }
607  }
608  if (R<X) {int n = X; X = R; R = n;}
609  if (T<Y) {int n = Y; Y = T; T = n;}
610 }
611 
612 // draw a vertical arrow pointing toward y2
613 static void draw_v_arrow(int x, int y1, int y2) {
614  int dy = (y1>y2) ? -1 : 1 ;
615  fl_yxline(x, y1, y2);
616  fl_xyline(x-4, y2, x+4);
617  fl_line(x-2, y2-dy*5, x, y2-dy);
618  fl_line(x+2, y2-dy*5, x, y2-dy);
619 }
620 
621 static void draw_h_arrow(int x1, int y, int x2) {
622  int dx = (x1>x2) ? -1 : 1 ;
623  fl_xyline(x1, y, x2);
624  fl_yxline(x2, y-4, y+4);
625  fl_line(x2-dx*5, y-2, x2-dx, y);
626  fl_line(x2-dx*5, y+2, x2-dx, y);
627 }
628 
629 static void draw_top_brace(const Fl_Widget *w) {
630  fl_yxline(w->x(), w->y()-2, w->y()+6);
631  fl_yxline(w->x()+w->w()-1, w->y()-2, w->y()+6);
632  fl_xyline(w->x()-2, w->y(), w->x()+w->w()+1);
633 }
634 
635 static void draw_left_brace(const Fl_Widget *w) {
636  fl_xyline(w->x()-2, w->y(), w->x()+6);
637  fl_xyline(w->x()-2, w->y()+w->h()-1, w->x()+6);
638  fl_yxline(w->x(), w->y()-2, w->y()+w->h()+1);
639 }
640 
641 static void draw_right_brace(const Fl_Widget *w) {
642  int xx = w->x() + w->w() - 1;
643  fl_xyline(xx-6, w->y(), xx+2);
644  fl_xyline(xx-6, w->y()+w->h()-1, xx+2);
645  fl_yxline(xx, w->y()-2, w->y()+w->h()+1);
646 }
647 
648 static void draw_bottom_brace(const Fl_Widget *w) {
649  int yy = w->y() + w->h() - 1;
650  fl_yxline(w->x(), yy-6, yy+2);
651  fl_yxline(w->x()+w->w()-1, yy-6, yy+2);
652  fl_xyline(w->x()-2, yy, w->x()+w->w()+1);
653 }
654 
655 static void draw_height(int x, int y, int b, Fl_Align a) {
656  char buf[16];
657  int h = b - y;
658  sprintf(buf, "%d", h);
659  fl_font(FL_HELVETICA, 9);
660  int lw = (int)fl_width(buf);
661  int lx;
662 
663  b --;
664  if (h < 30) {
665  // Move height to the side...
666  if (a == FL_ALIGN_LEFT) lx = x - lw - 2;
667  else lx = x + 2;
668 
669  fl_yxline(x, y, b);
670  } else {
671  // Put height inside the arrows...
672  lx = x - lw / 2;
673 
674  fl_yxline(x, y, y + (h - 11) / 2);
675  fl_yxline(x, y + (h + 11) / 2, b);
676  }
677 
678  // Draw the height...
679  fl_draw(buf, lx, y + (h + 9) / 2);
680 
681  // Draw the arrowheads...
682  fl_line(x-2, y+5, x, y+1, x+2, y+5);
683  fl_line(x-2, b-5, x, b-1, x+2, b-5);
684 
685  // Draw the end lines...
686  fl_xyline(x - 4, y, x + 4);
687  fl_xyline(x - 4, b, x + 4);
688 }
689 
690 static void draw_width(int x, int y, int r, Fl_Align a) {
691  char buf[16];
692  int w = r-x;
693  sprintf(buf, "%d", w);
694  fl_font(FL_HELVETICA, 9);
695  int lw = (int)fl_width(buf);
696  int ly = y + 4;
697 
698  r --;
699 
700  if (lw > (w - 20)) {
701  // Move width above/below the arrows...
702  if (a == FL_ALIGN_TOP) ly -= 10;
703  else ly += 10;
704 
705  fl_xyline(x, y, r);
706  } else {
707  // Put width inside the arrows...
708  fl_xyline(x, y, x + (w - lw - 2) / 2);
709  fl_xyline(x + (w + lw + 2) / 2, y, r);
710  }
711 
712  // Draw the width...
713  fl_draw(buf, x + (w - lw) / 2, ly);
714 
715  // Draw the arrowheads...
716  fl_line(x+5, y-2, x+1, y, x+5, y+2);
717  fl_line(r-5, y-2, r-1, y, r-5, y+2);
718 
719  // Draw the end lines...
720  fl_yxline(x, y - 4, y + 4);
721  fl_yxline(r, y - 4, y + 4);
722 }
723 
725  if (recalc) {
726  bx = o->w(); by = o->h(); br = 0; bt = 0;
727  numselected = 0;
728  for (Fl_Type *q=next; q && q->level>level; q=q->next)
729  if (q->selected && q->is_widget() && !q->is_menu_item()) {
730  numselected++;
731  Fl_Widget_Type* myo = (Fl_Widget_Type*)q;
732  if (myo->o->x() < bx) bx = myo->o->x();
733  if (myo->o->y() < by) by = myo->o->y();
734  if (myo->o->x()+myo->o->w() > br) br = myo->o->x()+myo->o->w();
735  if (myo->o->y()+myo->o->h() > bt) bt = myo->o->y()+myo->o->h();
736  }
737  recalc = 0;
738  sx = bx; sy = by; sr = br; st = bt;
739  }
740  fl_color(FL_RED);
741  if (drag==BOX && (x1 != mx || y1 != my)) {
742  int x = x1; int r = mx; if (x > r) {x = mx; r = x1;}
743  int y = y1; int b = my; if (y > b) {y = my; b = y1;}
744  fl_rect(x,y,r-x,b-y);
745  }
746  if (overlays_invisible && !drag) return;
747  if (selected) fl_rect(0,0,o->w(),o->h());
748  if (!numselected) return;
749  int mybx,myby,mybr,mybt;
750  int mysx,mysy,mysr,myst;
751  mybx = mysx = o->w(); myby = mysy = o->h(); mybr = mysr = 0; mybt = myst = 0;
752  Fl_Type *selection = 0L; // used to store the one selected widget (if n==1)
753  for (Fl_Type *q=next; q && q->level>level; q = q->next)
754  if (q->selected && q->is_widget() && !q->is_menu_item()) {
755  selection = q;
756  Fl_Widget_Type* myo = (Fl_Widget_Type*)q;
757  int x,y,r,t;
758  newposition(myo,x,y,r,t);
759  if (!show_guides || !drag || numselected != 1) fl_rect(x,y,r-x,t-y);
760  if (x < mysx) mysx = x;
761  if (y < mysy) mysy = y;
762  if (r > mysr) mysr = r;
763  if (t > myst) myst = t;
764  if (!(myo->o->align() & FL_ALIGN_INSIDE)) {
765  // Adjust left/right/top/bottom for top/bottom labels...
766  int ww, hh;
767  ww = (myo->o->align() & FL_ALIGN_WRAP) ? myo->o->w() : 0;
768  hh = myo->o->labelsize();
769  myo->o->measure_label(ww, hh);
770  if (myo->o->align() & FL_ALIGN_TOP) y -= hh;
771  else if (myo->o->align() & FL_ALIGN_BOTTOM) t += hh;
772  else if (myo->o->align() & FL_ALIGN_LEFT) x -= ww + 4;
773  else if (myo->o->align() & FL_ALIGN_RIGHT) r += ww + 4;
774  }
775  if (x < mybx) mybx = x;
776  if (y < myby) myby = y;
777  if (r > mybr) mybr = r;
778  if (t > mybt) mybt = t;
779  }
780  if (selected) return;
781 
782  if (show_guides && drag) {
783  // draw overlays for UI Guideline distances
784  // - check for distance to the window edge
785  // * FLTK suggests 10 pixels from the edge
786  int d;
787  int xsp, ysp;
788  int mybx_bak = mybx, myby_bak = myby, mybr_bak = mybr, mybt_bak = mybt;
789  Fl_Widget_Type *mysel = (Fl_Widget_Type *)selection;
790 
791 
792  ideal_spacing(xsp, ysp);
793 
794  if (drag) {
795  // Check top spacing...
796  if (abs(d = myby - ysp) < 3) {
797  dy -= d;
798  if (drag & DRAG) mybt -= d;
799  myby -= d;
800  draw_v_arrow(mybx+5, myby, 0);
801  }
802 
803  // Check bottom spacing...
804  if (abs(d = o->h() - mybt - ysp) < 3) {
805  dy += d;
806  if (drag & DRAG) myby += d;
807  mybt += d;
808  draw_v_arrow(mybx+5, mybt, o->h());
809  }
810 
811  // Check left spacing...
812  if (abs(d = mybx - xsp) < 3) {
813  dx -= d;
814  if (drag & DRAG) mybr -= d;
815  mybx -= d;
816  draw_h_arrow(mybx, myby+5, 0);
817  }
818 
819  // Check right spacing...
820  if (abs(d = o->w() - mybr - xsp) < 3) {
821  dx += d;
822  if (drag & DRAG) mybx += d;
823  mybr += d;
824  draw_h_arrow(mybr, myby+5, o->w());
825  }
826  }
827 
828  if (numselected==1 && selection && !(drag & DRAG)) {
829  // Check ideal sizes
830  int x,y,r,t;
831  newposition(mysel,x,y,r,t);
832  int w = r-x;
833  int h = t-y;
834  int iw = w, ih = h;
835 
836  mysel->ideal_size(iw, ih);
837 
838  if (drag & (TOP | BOTTOM)) {
839  // Check height
840  if (abs(d = ih - h) < 5) {
841  // Resize height
842  if (drag & TOP) {
843  myby -= d;
844  y -= d;
845  dy -= d;
846  } else {
847  mybt += d;
848  t += d;
849  dy += d;
850  }
851  }
852 
853  // Draw height guide
854  draw_height(x < 50 ? x+10 : x-10, y, t,
855  x < 50 ? FL_ALIGN_RIGHT : FL_ALIGN_LEFT);
856  }
857 
858  if (drag & (LEFT | RIGHT)) {
859  // Check width
860  if (abs(d = iw - w) < 5) {
861  // Resize width
862  if (drag & LEFT) {
863  mybx -= d;
864  x -= d;
865  dx -= d;
866  } else {
867  mybr += d;
868  r += d;
869  dx += d;
870  }
871  }
872 
873  // Draw width guide
874  draw_width(x, y < 50 ? y+10 : y-10, r,
875  y < 50 ? FL_ALIGN_BOTTOM : FL_ALIGN_TOP);
876  }
877  }
878 
879  // Check spacing and alignment between individual widgets
880  if (drag && selection->is_widget()) {
881  for (Fl_Type *q=next; q && q->level>level; q = q->next)
882  if (q != selection && q->is_widget()) {
883  Fl_Widget_Type *qw = (Fl_Widget_Type*)q;
884  // Only check visible widgets...
885  if (!qw->o->visible_r()) continue;
886 
887  // Get bounding box of widget...
888  int qx = qw->o->x();
889  int qr = qw->o->x() + qw->o->w();
890  int qy = qw->o->y();
891  int qt = qw->o->y() + qw->o->h();
892 
893  if (!(qw->o->align() & FL_ALIGN_INSIDE)) {
894  // Adjust top/bottom for top/bottom labels...
895  int ww, hh;
896  ww = qw->o->w();
897  hh = qw->o->labelsize();
898  qw->o->measure_label(ww, hh);
899  if (qw->o->align() & FL_ALIGN_TOP) qy -= hh;
900  if (qw->o->align() & FL_ALIGN_BOTTOM) qt += hh;
901  }
902 
903  // Do horizontal alignment when the widget is within 25
904  // pixels vertically...
905  if (fl_min(abs(qy - mysel->o->y() - mysel->o->h()),
906  abs(mysel->o->y() - qt)) < 25) {
907  // Align to left of other widget...
908  if ((drag & (LEFT | DRAG)) && abs(d = mybx - qx) < 3) {
909  dx += d;
910  mybx += d;
911  if (drag & DRAG) mybr += d;
912 
913  draw_left_brace(qw->o);
914  }
915 
916  // Align to right of other widget...
917  if ((drag & (RIGHT | DRAG)) &&
918  abs(d = qr - mybr) < 3) {
919  dx += d;
920  if (drag & DRAG) mybx += d;
921  mybr += d;
922 
923  draw_right_brace(qw->o);
924  }
925  }
926 
927  // Align to top of other widget...
928  if ((drag & (TOP | DRAG)) && abs(d = myby - qy) < 3) {
929  dy += d;
930  myby += d;
931  if (drag & DRAG) mybt += d;
932 
933  draw_top_brace(qw->o);
934  }
935 
936  // Align to bottom of other widget...
937  if ((drag & (BOTTOM | DRAG)) && abs(d = qt - mybt) < 3) {
938  dy += d;
939  if (drag & DRAG) myby += d;
940  mybt += d;
941 
942  draw_bottom_brace(qw->o);
943  }
944 
945  // Check spacing between widgets
946  if (mysel->is_group()) mysel->ideal_spacing(xsp, ysp);
947  else qw->ideal_spacing(xsp, ysp);
948 
949  if ((qt)>=myby && qy<=mybt) {
950  if (drag & (LEFT | DRAG)) {
951  // Compare left of selected to left of current
952  if (abs(d = qx - mybx - xsp) >= 3)
953  d = qx - mybx + xsp;
954 
955  if (abs(d) < 3) {
956  dx += d;
957  mybx += d;
958  if (drag & DRAG) mybr += d;
959 
960  // Draw left arrow
961  draw_h_arrow(mybx, (myby+mybt)/2, qx);
962  }
963 
964  // Compare left of selected to right of current
965  if (abs(d = qr - mybx - xsp) >= 3)
966  d = qr - mybx + xsp;
967 
968  if (abs(d) < 3) {
969  dx += d;
970  mybx += d;
971  if (drag & DRAG) mybr += d;
972 
973  // Draw left arrow
974  draw_h_arrow(mybx, (myby+mybt)/2, qr);
975  }
976  }
977 
978  if (drag & (RIGHT | DRAG)) {
979  // Compare right of selected to left of current
980  if (abs(d = qx - mybr - xsp) >= 3)
981  d = qx - mybr + xsp;
982 
983  if (abs(d) < 3) {
984  dx += d;
985  if (drag & DRAG) mybx += d;
986  mybr += d;
987 
988  // Draw right arrow
989  draw_h_arrow(mybr, (myby+mybt)/2, qx);
990  }
991 
992  // Compare right of selected to right of current
993  if (abs(d = qr - mybr + xsp) >= 3)
994  d = qr - mybr - xsp;
995 
996  if (abs(d) < 3) {
997  dx += d;
998  if (drag & DRAG) mybx += d;
999  mybr += d;
1000 
1001  // Draw right arrow
1002  draw_h_arrow(mybr, (myby+mybt)/2, qr);
1003  }
1004  }
1005  }
1006 
1007  if (qr>=mybx && qx<=mybr) {
1008  // Compare top of selected to top of current
1009  if (drag & (TOP | DRAG)) {
1010  if (abs(d = qy - myby - ysp) >= 3)
1011  d = qy - myby + ysp;
1012 
1013  if (abs(d) < 3) {
1014  dy += d;
1015  myby += d;
1016  if (drag & DRAG) mybt += d;
1017 
1018  // Draw up arrow...
1019  draw_v_arrow((mybx+mybr)/2, myby, qy);
1020  }
1021 
1022  // Compare top of selected to bottom of current
1023  if (abs(d = qt - myby - ysp) >= 3)
1024  d = qt - myby + ysp;
1025 
1026  if (abs(d) < 3) {
1027  dy += d;
1028  myby += d;
1029  if (drag & DRAG) mybt += d;
1030 
1031  // Draw up arrow...
1032  draw_v_arrow((mybx+mybr)/2, myby, qt);
1033  }
1034  }
1035 
1036  // Compare bottom of selected to top of current
1037  if (drag & (BOTTOM | DRAG)) {
1038  if (abs(d = qy - mybt - ysp) >= 3)
1039  d = qy - mybt + ysp;
1040 
1041  if (abs(d) < 3) {
1042  dy += d;
1043  if (drag & DRAG) myby += d;
1044  mybt += d;
1045 
1046  // Draw down arrow...
1047  draw_v_arrow((mybx+mybr)/2, mybt, qy);
1048  }
1049 
1050  // Compare bottom of selected to bottom of current
1051  if (abs(d = qt - mybt - ysp) >= 3)
1052  d = qt - mybt + ysp;
1053 
1054  if (abs(d) < 3) {
1055  dy += d;
1056  if (drag & DRAG) myby += d;
1057  mybt += d;
1058 
1059  // Draw down arrow...
1060  draw_v_arrow((mybx+mybr)/2, mybt, qt);
1061  }
1062  }
1063  }
1064  }
1065  }
1066  mysx += mybx-mybx_bak; mysr += mybr-mybr_bak;
1067  mysy += myby-myby_bak; myst += mybt-mybt_bak;
1068  }
1069  // align the snapping selection box with the box we draw.
1070  sx = mysx; sy = mysy; sr = mysr; st = myst;
1071 
1072  // Draw selection box + resize handles...
1073  // draw box including all labels
1075  fl_rect(mybx,myby,mybr-mybx,mybt-myby);
1077  // draw box excluding labels
1078  fl_rect(mysx,mysy,mysr-mysx,myst-mysy);
1079  fl_rectf(mysx,mysy,5,5);
1080  fl_rectf(mysr-5,mysy,5,5);
1081  fl_rectf(mysr-5,myst-5,5,5);
1082  fl_rectf(mysx,myst-5,5,5);
1083 }
1084 
1085 extern Fl_Menu_Item Main_Menu[];
1086 
1087 // Calculate new bounding box of selected widgets:
1089  Main_Menu[40].label("Hide O&verlays");
1090  overlays_invisible = 0;
1091  recalc = 1;
1092  ((Overlay_Window *)(this->o))->redraw_overlay();
1093 }
1094 
1095 // check if we must redraw any parent of tabs/wizard type
1097  Fl_Widget_Type * prev_parent = 0;
1098  if( !s || !s->selected || !s->is_widget()) return;
1099  for (Fl_Type *i=s; i && i->parent; i=i->parent) {
1100  if (i->is_group() && prev_parent &&
1101  (!strcmp(i->type_name(), "Fl_Tabs") ||
1102  !strcmp(i->type_name(), "Fl_Wizard"))) {
1103  ((Fl_Tabs*)((Fl_Widget_Type*)i)->o)->value(prev_parent->o);
1104  return;
1105  }
1106  if (i->is_group() && s->is_widget())
1107  prev_parent = (Fl_Widget_Type*)i;
1108  }
1109 }
1110 
1111 // do that for every window (when selected set changes):
1113  for (Fl_Type *o=Fl_Type::first; o; o=o->next)
1114  if (o->is_window()) ((Fl_Window_Type*)o)->fix_overlay();
1115 }
1116 
1117 void toggle_overlays(Fl_Widget *,void *) {
1119 
1120  if (overlays_invisible) Main_Menu[40].label("Show O&verlays");
1121  else Main_Menu[40].label("Hide O&verlays");
1122 
1123  for (Fl_Type *o=Fl_Type::first; o; o=o->next)
1124  if (o->is_window()) {
1125  Fl_Widget_Type* w = (Fl_Widget_Type*)o;
1126  ((Overlay_Window*)(w->o))->redraw_overlay();
1127  }
1128 }
1129 
1130 extern void select(Fl_Type *,int);
1131 extern void select_only(Fl_Type *);
1132 extern void deselect();
1133 extern Fl_Type* in_this_only;
1134 extern void fix_group_size(Fl_Type *t);
1135 
1137 extern Fl_Menu_Item New_Menu[];
1138 
1139 // move the selected children according to current dx,dy,drag state:
1141 {
1142  undo_checkpoint();
1143  Fl_Type *i;
1144  for (i=next; i && i->level>level;) {
1145  if (i->selected && i->is_widget() && !i->is_menu_item()) {
1146  Fl_Widget_Type* myo = (Fl_Widget_Type*)i;
1147  int x,y,r,t;
1148  newposition(myo,x,y,r,t);
1149  myo->o->resize(x,y,r-x,t-y);
1150  // move all the children, whether selected or not:
1151  Fl_Type* p;
1152  for (p = myo->next; p && p->level>myo->level; p = p->next)
1153  if (p->is_widget() && !p->is_menu_item()) {
1154  Fl_Widget_Type* myo2 = (Fl_Widget_Type*)p;
1155  int X,Y,R,T;
1156  newposition(myo2,X,Y,R,T);
1157  myo2->o->resize(X,Y,R-X,T-Y);
1158  }
1159  i = p;
1160  } else {
1161  i = i->next;
1162  }
1163  }
1164  for (i=next; i && i->level>level; i=i->next)
1165  fix_group_size(i);
1166  o->redraw();
1167  recalc = 1;
1168  ((Overlay_Window *)(this->o))->redraw_overlay();
1169  set_modflag(1);
1170  dx = dy = 0;
1171 
1172  update_xywh();
1173 }
1174 
1175 int Fl_Window_Type::handle(int event) {
1176  static Fl_Type* selection;
1177  switch (event) {
1178  case FL_PUSH:
1179  x1 = mx = Fl::event_x();
1180  y1 = my = Fl::event_y();
1181  drag = dx = dy = 0;
1182  // test for popup menu:
1183  if (Fl::event_button() >= 3) {
1184  in_this_only = this; // modifies how some menu items work.
1185  static const Fl_Menu_Item* myprev;
1186  const Fl_Menu_Item* m = New_Menu->popup(mx,my,"New",myprev);
1187  if (m && m->callback()) {myprev = m; m->do_callback(this->o);}
1188  in_this_only = 0;
1189  return 1;
1190  }
1191  // find the innermost item clicked on:
1192  selection = this;
1193  {for (Fl_Type* i=next; i && i->level>level; i=i->next)
1194  if (i->is_widget() && !i->is_menu_item()) {
1195  Fl_Widget_Type* myo = (Fl_Widget_Type*)i;
1196  for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent())
1197  if (!o1->visible()) goto CONTINUE2;
1198  if (Fl::event_inside(myo->o)) {
1199  selection = myo;
1200  if (Fl::event_clicks()==1)
1201  reveal_in_browser(myo);
1202  }
1203  CONTINUE2:;
1204  }}
1205  // see if user grabs edges of selected region:
1206  if (numselected && !(Fl::event_state(FL_SHIFT)) &&
1207  mx<=br+snap && mx>=bx-snap && my<=bt+snap && my>=by-snap) {
1208  int snap1 = snap>5 ? snap : 5;
1209  int w1 = (br-bx)/4; if (w1 > snap1) w1 = snap1;
1210  if (mx>=br-w1) drag |= RIGHT;
1211  else if (mx<bx+w1) drag |= LEFT;
1212  w1 = (bt-by)/4; if (w1 > snap1) w1 = snap1;
1213  if (my<=by+w1) drag |= TOP;
1214  else if (my>bt-w1) drag |= BOTTOM;
1215  if (!drag) drag = DRAG;
1216  }
1217  // do object-specific selection of other objects:
1218  {Fl_Type* t = selection->click_test(mx, my);
1219  if (t) {
1220  //if (t == selection) return 1; // indicates mouse eaten w/o change
1221  if (Fl::event_state(FL_SHIFT)) {
1222  Fl::event_is_click(0);
1223  select(t, !t->selected);
1224  } else {
1225  deselect();
1226  select(t, 1);
1227  if (t->is_menu_item()) t->open();
1228  }
1229  selection = t;
1230  drag = 0;
1231  } else {
1232  if (!drag) drag = BOX; // if all else fails, start a new selection region
1233  }}
1234  return 1;
1235 
1236  case FL_DRAG:
1237  if (!drag) return 0;
1238  mx = Fl::event_x();
1239  my = Fl::event_y();
1240  newdx();
1241  return 1;
1242 
1243  case FL_RELEASE:
1244  if (!drag) return 0;
1245  mx = Fl::event_x();
1246  my = Fl::event_y();
1247  if (drag != BOX && (dx || dy || !Fl::event_is_click())) {
1248  if (dx || dy) moveallchildren();
1249  } else if ((Fl::event_clicks() || Fl::event_state(FL_CTRL))) {
1251  } else {
1252  if (mx<x1) {int t = x1; x1 = mx; mx = t;}
1253  if (my<y1) {int t = y1; y1 = my; my = t;}
1254  int n = 0;
1255  int toggle = Fl::event_state(FL_SHIFT);
1256  // clear selection on everything:
1257  if (!toggle) deselect(); else Fl::event_is_click(0);
1258  // select everything in box:
1259  for (Fl_Type*i=next; i&&i->level>level; i=i->next)
1260  if (i->is_widget() && !i->is_menu_item()) {
1261  Fl_Widget_Type* myo = (Fl_Widget_Type*)i;
1262  for (Fl_Widget *o1 = myo->o; o1; o1 = o1->parent())
1263  if (!o1->visible()) goto CONTINUE;
1264  if (Fl::event_inside(myo->o)) selection = myo;
1265  if (myo->o->x()>=x1 && myo->o->y()>y1 &&
1266  myo->o->x()+myo->o->w()<mx && myo->o->y()+myo->o->h()<my) {
1267  n++;
1268  select(myo, toggle ? !myo->selected : 1);
1269  }
1270  CONTINUE:;
1271  }
1272  // if nothing in box, select what was clicked on:
1273  if (!n) {
1274  select(selection, toggle ? !selection->selected : 1);
1275  }
1276  }
1277  drag = 0;
1278  ((Overlay_Window *)o)->redraw_overlay();
1279  return 1;
1280 
1281  case FL_KEYBOARD: {
1282 
1283  int backtab = 0;
1284  switch (Fl::event_key()) {
1285 
1286  case FL_Escape:
1287  ((Fl_Window*)o)->hide();
1288  return 1;
1289 
1290  case FL_Tab: {
1291  if (Fl::event_state(FL_SHIFT)) backtab = 1;
1292  // find current child:
1294  while (i && (!i->is_widget() || i->is_menu_item())) i = i->parent;
1295  if (!i) return 0;
1296  Fl_Type *p = i->parent;
1297  while (p && p != this) p = p->parent;
1298  if (!p || !p->is_widget()) {
1299  i = next; if (!i || i->level <= level) return 0;
1300  }
1301  p = i;
1302  for (;;) {
1303  i = backtab ? i->prev : i->next;
1304  if (!i || i->level <= level) {i = p; break;}
1305  if (i->is_widget() && !i->is_menu_item()) break;
1306  }
1307  deselect(); select(i,1);
1308  return 1;}
1309 
1310  case FL_Left: dx = -1; dy = 0; goto ARROW;
1311  case FL_Right: dx = +1; dy = 0; goto ARROW;
1312  case FL_Up: dx = 0; dy = -1; goto ARROW;
1313  case FL_Down: dx = 0; dy = +1; goto ARROW;
1314  ARROW:
1315  // for some reason BOTTOM/TOP are swapped... should be fixed...
1317  if (Fl::event_state(FL_CTRL)) {dx *= gridx; dy *= gridy;}
1318  moveallchildren();
1319  drag = 0;
1320  return 1;
1321 
1322  case 'o':
1323  toggle_overlays(0, 0);
1324  break;
1325 
1326  default:
1327  return 0;
1328  }}
1329 
1330  case FL_SHORTCUT: {
1331  in_this_only = this; // modifies how some menu items work.
1332  const Fl_Menu_Item* m = Main_Menu->test_shortcut();
1333  if (m && m->callback()) m->do_callback(this->o);
1334  in_this_only = 0;
1335  return (m != 0);}
1336 
1337  default:
1338  return 0;
1339  }
1340 }
1341 
1343 
1344 #include <stdio.h>
1345 #include "../src/flstring.h"
1346 
1349 }
1350 
1352  const char *var = is_class() ? "this" : name() ? name() : "o";
1353  write_extra_code();
1354  if (modal) write_c("%s%s->set_modal();\n", indent(), var);
1355  else if (non_modal) write_c("%s%s->set_non_modal();\n", indent(), var);
1356  if (!((Fl_Window*)o)->border()) {
1357  write_c("%s%s->clear_border();\n", indent(), var);
1358  }
1359  if (xclass) {
1360  write_c("%s%s->xclass(", indent(), var);
1362  write_c(");\n");
1363  }
1364  if (sr_max_w || sr_max_h) {
1365  write_c("%s%s->size_range(%d, %d, %d, %d);\n", indent(), var,
1367  } else if (sr_min_w || sr_min_h) {
1368  write_c("%s%s->size_range(%d, %d);\n", indent(), var, sr_min_w, sr_min_h);
1369  }
1370  write_c("%s%s->end();\n", indent(), var);
1371  if (((Fl_Window*)o)->resizable() == o)
1372  write_c("%s%s->resizable(%s);\n", indent(), var, var);
1374 }
1375 
1378  if (modal) write_string("modal");
1379  else if (non_modal) write_string("non_modal");
1380  if (!((Fl_Window*)o)->border()) write_string("noborder");
1381  if (xclass) {write_string("xclass"); write_word(xclass);}
1382  if (sr_min_w || sr_min_h || sr_max_w || sr_max_h)
1383  write_string("size_range {%d %d %d %d}", sr_min_w, sr_min_h, sr_max_w, sr_max_h);
1384  if (o->visible()) write_string("visible");
1385 }
1386 
1387 extern int pasteoffset;
1388 void Fl_Window_Type::read_property(const char *c) {
1389  if (!strcmp(c,"modal")) {
1390  modal = 1;
1391  } else if (!strcmp(c,"non_modal")) {
1392  non_modal = 1;
1393  } else if (!strcmp(c, "visible")) {
1394  if (Fl::first_window()) open(); // only if we are using user interface
1395  } else if (!strcmp(c,"noborder")) {
1396  ((Fl_Window*)o)->border(0);
1397  } else if (!strcmp(c,"xclass")) {
1399  ((Fl_Window*)o)->xclass(xclass);
1400  } else if (!strcmp(c,"size_range")) {
1401  int mw, mh, MW, MH;
1402  if (sscanf(read_word(),"%d %d %d %d",&mw,&mh,&MW,&MH) == 4) {
1403  sr_min_w = mw; sr_min_h = mh; sr_max_w = MW; sr_max_h = MH;
1404  }
1405  } else if (!strcmp(c,"xywh")) {
1407  pasteoffset = 0; // make it not apply to contents
1408  } else {
1410  }
1411 }
1412 
1413 int Fl_Window_Type::read_fdesign(const char* propname, const char* value) {
1414  int x;
1415  o->box(FL_NO_BOX); // because fdesign always puts an Fl_Box next
1416  if (!strcmp(propname,"Width")) {
1417  if (sscanf(value,"%d",&x) == 1) o->size(x,o->h());
1418  } else if (!strcmp(propname,"Height")) {
1419  if (sscanf(value,"%d",&x) == 1) o->size(o->w(),x);
1420  } else if (!strcmp(propname,"NumberofWidgets")) {
1421  return 1; // we can figure out count from file
1422  } else if (!strcmp(propname,"border")) {
1423  if (sscanf(value,"%d",&x) == 1) ((Fl_Window*)o)->border(x);
1424  } else if (!strcmp(propname,"title")) {
1425  label(value);
1426  } else {
1427  return Fl_Widget_Type::read_fdesign(propname,value);
1428  }
1429  return 1;
1430 }
1431 
1433 
1436 
1439  while (p && (!p->is_decl_block() || (p->is_widget() && p->is_class()))) p = p->parent;
1441  myo->name("UserInterface");
1442 
1443  if (!this->o) {// template widget
1444  this->o = new Fl_Window(100,100);
1445  Fl_Group::current(0);
1446  }
1447  // Set the size ranges for this window; in order to avoid opening the
1448  // X display we use an arbitrary maximum size...
1449  ((Fl_Window *)(this->o))->size_range(gridx, gridy,
1450  3072, 2048,
1451  gridx, gridy, 0);
1452  myo->factory = this;
1453  myo->drag = 0;
1454  myo->numselected = 0;
1455  Overlay_Window *w = new Overlay_Window(100,100);
1456  w->window = myo;
1457  myo->o = w;
1458  myo->add(p);
1459  myo->modal = 0;
1460  myo->non_modal = 0;
1461  myo->wc_relative = 0;
1462 
1463  return myo;
1464 }
1465 
1468  if (wc_relative) write_string("position_relative");
1469 }
1470 
1472  if (!strcmp(c,"position_relative")) {
1473  wc_relative = 1;
1474  } else {
1476  }
1477 }
1478 
1479 // Convert A::B::C::D to D (i.e. keep only innermost name)
1480 // This is useful for classes that contain a namespace component
1481 static const char *trimclassname(const char *n) {
1482  const char *nn;
1483  while((nn = strstr(n, "::"))) {
1484  n = nn + 2;
1485  }
1486  return(n);
1487 }
1488 
1489 
1491 #if 0
1493 #endif // 0
1494 
1495  current_widget_class = this;
1496  write_public_state = 1;
1497 
1498  const char *c = subclass();
1499  if (!c) c = "Fl_Group";
1500 
1501  write_comment_h();
1502  write_h("\nclass %s : public %s {\n", name(), c);
1503  if (strstr(c, "Window")) {
1504  write_h(" void _%s();\n", trimclassname(name()));
1505  write_h("public:\n");
1506  write_h(" %s(int X, int Y, int W, int H, const char *L = 0);\n", trimclassname(name()));
1507  write_h(" %s(int W, int H, const char *L = 0);\n", trimclassname(name()));
1508  write_h(" %s();\n", trimclassname(name()));
1509 
1510  // a constructor with all four dimensions plus label
1511  write_c("%s::%s(int X, int Y, int W, int H, const char *L)\n", name(), trimclassname(name()));
1512  write_c(" : %s(X, Y, W, H, L) {\n", c);
1513  write_c(" _%s();\n", trimclassname(name()));
1514  write_c("}\n\n");
1515 
1516  // a constructor with just the size and label. The window manager will position the window
1517  write_c("%s::%s(int W, int H, const char *L)\n", name(), trimclassname(name()));
1518  write_c(" : %s(0, 0, W, H, L) {\n", c);
1519  write_c(" clear_flag(16);\n");
1520  write_c(" _%s();\n", trimclassname(name()));
1521  write_c("}\n\n");
1522 
1523  // a constructor that takes size and label from the Fluid database
1524  write_c("%s::%s()\n", name(), trimclassname(name()));
1525  write_c(" : %s(0, 0, %d, %d, ", c, o->w(), o->h());
1526  const char *cstr = label();
1527  if (cstr) write_cstring(cstr);
1528  else write_c("0");
1529  write_c(") {\n");
1530  write_c(" clear_flag(16);\n");
1531  write_c(" _%s();\n", trimclassname(name()));
1532  write_c("}\n\n");
1533 
1534  write_c("void %s::_%s() {\n", name(), trimclassname(name()));
1535 // write_c(" %s *w = this;\n", name());
1536  } else {
1537  write_h("public:\n");
1538  write_h(" %s(int X, int Y, int W, int H, const char *L = 0);\n", trimclassname(name()));
1539 
1540  write_c("%s::%s(int X, int Y, int W, int H, const char *L)\n", name(), trimclassname(name()));
1541  if (wc_relative)
1542  write_c(" : %s(0, 0, W, H, L) {\n", c);
1543  else
1544  write_c(" : %s(X, Y, W, H, L) {\n", c);
1545  }
1546 
1547 // write_c(" %s *o = this;\n", name());
1548 
1550 }
1551 
1553  write_extra_code();
1554  if (wc_relative) write_c("%sposition(X, Y);\n", indent());
1555  if (modal) write_c("%sset_modal();\n", indent());
1556  else if (non_modal) write_c("%sset_non_modal();\n", indent());
1557  if (!((Fl_Window*)o)->border()) write_c("%sclear_border();\n", indent());
1558  if (xclass) {
1559  write_c("%sxclass(", indent());
1561  write_c(");\n");
1562  }
1563  write_c("%send();\n", indent());
1564  if (((Fl_Window*)o)->resizable() == o)
1565  write_c("%sresizable(this);\n", indent());
1566  write_c("}\n");
1567 }
1568 
1570 // live mode support
1571 
1573  Fl_Window *win = new Fl_Window(o->x(), o->y(), o->w(), o->h());
1574  live_widget = win;
1575  if (live_widget) {
1576  copy_properties();
1577  Fl_Type *n;
1578  for (n = next; n && n->level > level; n = n->next) {
1579  if (n->level == level+1)
1580  n->enter_live_mode();
1581  }
1582  win->end();
1583  }
1584  return live_widget;
1585 }
1586 
1588 }
1589 
1596 }
1597 
1598 
1599 //
1600 // End of "$Id$".
1601 //
Fl_Window_Type::RIGHT
Definition: Fl_Type.h:597
fl_font
void fl_font(Fl_Font face, Fl_Fontsize fsize)
Definition: fl_draw.H:509
FL_Up
#define FL_Up
The up arrow key.
Definition: Enumerations.H:481
fl_width
FL_EXPORT double fl_width(const char *txt)
Definition: fl_font.cxx:65
FL_ALIGN_LEFT
const Fl_Align FL_ALIGN_LEFT
Definition: Enumerations.H:839
Fl_Window_Type::enter_live_mode
Fl_Widget * enter_live_mode(int top=0)
Definition: Fl_Window_Type.cxx:1572
Fl_Group::resizable
Fl_Widget * resizable() const
Definition: Fl_Group.H:152
draw_bottom_brace
static void draw_bottom_brace(const Fl_Widget *w)
Definition: Fl_Window_Type.cxx:648
Fl_Choice
A button that is used to pop up a menu.
Definition: Fl_Choice.H:83
FL_DAMAGE_ALL
Definition: Enumerations.H:1112
include_H_from_C_button
Fl_Check_Button * include_H_from_C_button
Definition: alignment_panel.cxx:36
Fl.H
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::align
Fl_Align align() const
Definition: Fl_Widget.H:348
fl_line
void fl_line(int x, int y, int x1, int y1)
Definition: fl_draw.H:223
fl_rectf
void fl_rectf(int x, int y, int w, int h)
Definition: fl_draw.H:206
Fl_Button::value
int value(int v)
Definition: Fl_Button.cxx:41
FL_HIDE
Definition: Enumerations.H:369
Fl_Round_Button
Definition: Fl_Round_Button.H:36
Fl_Window_Type::br
int br
Definition: Fl_Type.h:592
header_file_name
const char * header_file_name
Definition: fluid.cxx:700
widget_x_input
Fl_Value_Input * widget_x_input
Definition: widget_panel.cxx:57
Fl_Window_Type::handle
int handle(int)
Definition: Fl_Window_Type.cxx:1175
Fl_Window_Type::sr_min_h
int sr_min_h
Definition: Fl_Type.h:641
Fl_Type::current
static Fl_Type * current
Definition: Fl_Type.h:114
Overlay_Window::resize
void resize(int, int, int, int)
Definition: Fl_Window_Type.cxx:506
Fl_Type::next
Fl_Type * next
Definition: Fl_Type.h:71
Fl_Button::setonly
void setonly()
Definition: Fl_Button.cxx:59
Fl_Group::end
void end()
Definition: Fl_Group.cxx:75
Fl_Window_Type::st
int st
Definition: Fl_Type.h:593
fl_message
void fl_message(const char *,...)
Definition: fl_ask.cxx:338
main_window
Fl_Window * main_window
Definition: fluid.cxx:176
draw_right_brace
static void draw_right_brace(const Fl_Widget *w)
Definition: Fl_Window_Type.cxx:641
Fl_Window_Type::DRAG
Definition: Fl_Type.h:597
fl_min
int fl_min(int a, int b)
Definition: Fl_Window_Type.cxx:52
Fl_Window_Type::sr_max_h
int sr_max_h
Definition: Fl_Type.h:641
toggle_overlays
void toggle_overlays(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:1117
Fl_Valuator::value
double value() const
Definition: Fl_Valuator.H:125
reveal_in_browser
void reveal_in_browser(Fl_Type *t)
Definition: Fl_Type.cxx:1082
Fl_Widget::show
virtual void show()
Definition: Fl_Widget.cxx:271
LOAD
#define LOAD()
Definition: infback.c:128
show_global_settings_cb
void show_global_settings_cb(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:239
FL_WHITE
const Fl_Color FL_WHITE
Definition: Enumerations.H:971
Fl_Window::hotspot
void hotspot(int x, int y, int offscreen=0)
Definition: Fl_Window_hotspot.cxx:24
Fl_Type::parent
Fl_Type * parent
Definition: Fl_Type.h:63
deselect
void deselect()
Definition: Fl_Type.cxx:249
check_redraw_corresponding_parent
void check_redraw_corresponding_parent(Fl_Type *s)
Definition: Fl_Window_Type.cxx:1096
Fl_Type::enter_live_mode
virtual Fl_Widget * enter_live_mode(int top=0)
Definition: Fl_Type.cxx:1102
Fl_Menu_Item::test_shortcut
const Fl_Menu_Item * test_shortcut() const
Definition: Fl_Menu.cxx:1067
Fl::event_state
static int event_state()
Definition: Fl.H:704
Fl_Widget_Type::read_fdesign
virtual int read_fdesign(const char *, const char *)
Definition: Fl_Widget_Type.cxx:2706
Fl_Window_Type::recalc
int recalc
Definition: Fl_Type.h:607
select
void select(Fl_Type *, int)
Definition: Fl_Type.cxx:240
i18n_function
const char * i18n_function
Definition: fluid.cxx:704
Fl_Int_Input
Definition: Fl_Int_Input.H:31
Fl_Input_::value
int value(const char *)
Definition: Fl_Input_.cxx:1284
draw_h_arrow
static void draw_h_arrow(int x1, int y, int x2)
Definition: Fl_Window_Type.cxx:621
fl_color
void fl_color(Fl_Color c)
Definition: fl_draw.H:52
Fl_Type::add
void add(Fl_Type *parent)
Definition: Fl_Type.cxx:574
Fl_Window_Type::sx
int sx
Definition: Fl_Type.h:593
Fl::event_button
static int event_button()
Definition: Fl.H:678
xclass_cb
void xclass_cb(Fl_Input *i, void *v)
Definition: Fl_Window_Type.cxx:470
Fl_Window_Type::my
int my
Definition: Fl_Type.h:590
Fl_Widget::window
Fl_Window * window() const
Definition: Fl_Window.cxx:118
Fl_Light_Button
Definition: Fl_Light_Button.H:38
header_file_input
Fl_Input * header_file_input
Definition: alignment_panel.cxx:32
FL_DRAG
Definition: Enumerations.H:268
horizontal_input
Fl_Int_Input * horizontal_input
Definition: alignment_panel.cxx:424
draw_top_brace
static void draw_top_brace(const Fl_Widget *w)
Definition: Fl_Window_Type.cxx:629
FL_SHIFT
#define FL_SHIFT
One of the shift keys is down.
Definition: Enumerations.H:557
Fl_Menu_Item::label
const char * label() const
Definition: Fl_Menu_Item.H:148
Fl::event_is_click
static int event_is_click()
Definition: Fl.H:661
x.H
FL_SOLID
line style: ___________
Definition: fl_draw.H:179
Overlay_Window
Definition: Fl_Window_Type.cxx:281
Fl_Window_Type::sr_min_w
int sr_min_w
Definition: Fl_Type.h:641
make_project_window
Fl_Double_Window * make_project_window()
Definition: alignment_panel.cxx:57
Fl_Widget_Class_Type::read_property
virtual void read_property(const char *)
Definition: Fl_Window_Type.cxx:1471
Fl_Type::level
int level
Definition: Fl_Type.h:69
H
static int H
Definition: Fl_Tooltip.cxx:76
Fl_Type::is_widget
virtual int is_widget() const
Definition: Fl_Type.cxx:749
Fl_Window_Type::read_fdesign
virtual int read_fdesign(const char *, const char *)
Definition: Fl_Window_Type.cxx:1413
Fl_Type::is_menu_item
virtual int is_menu_item() const
Definition: Fl_Type.cxx:756
FL_DOT
line style: . . . . . .
Definition: fl_draw.H:181
fl_draw
FL_EXPORT void fl_draw(const char *str, int x, int y)
Definition: fl_font.cxx:70
Overlay_Window::draw_overlay
void draw_overlay()
Definition: Fl_Window_Type.cxx:340
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_Widget_Class_Type::write_code2
void write_code2()
Definition: Fl_Window_Type.cxx:1552
select_only
void select_only(Fl_Type *)
Definition: Fl_Type.cxx:245
Fl_Window_Type::by
int by
Definition: Fl_Type.h:592
i18n_set_input
Fl_Int_Input * i18n_set_input
Definition: alignment_panel.cxx:53
Fl_Tabs
Definition: Fl_Tabs.H:201
Fl_Window_Type::BOTTOM
Definition: Fl_Type.h:597
FL_WINDOW
#define FL_WINDOW
window type id all subclasses have type() >= this
Definition: Fl_Window.H:33
i18n_include_input
Fl_Input * i18n_include_input
Definition: alignment_panel.cxx:49
Fl::event_key
static int event_key()
Definition: Fl.H:723
write_c
void write_c(const char *format,...)
Definition: code.cxx:265
snap_input
Fl_Int_Input * snap_input
Definition: alignment_panel.cxx:428
Overlay_Window::Overlay_Window
Overlay_Window(int W, int H)
Definition: Fl_Window_Type.cxx:287
Fl_Window_Type::numselected
int numselected
Definition: Fl_Type.h:596
b
long b
Definition: jpegint.h:397
FL_BLACK
const Fl_Color FL_BLACK
Definition: Enumerations.H:956
show_grid_cb
void show_grid_cb(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:217
header_input_cb
void header_input_cb(Fl_Input *i, void *)
Definition: Fl_Window_Type.cxx:244
Fl_Overlay_Window::resize
void resize(int, int, int, int)
Definition: Fl_Overlay_Window.cxx:55
Fl_Type::first
static Fl_Type * first
Definition: Fl_Type.h:70
Fl_Widget_Class_type
Fl_Widget_Class_Type Fl_Widget_Class_type
Definition: Fl_Window_Type.cxx:1434
Fl_Widget_Class_Type::make
Fl_Type * make()
Definition: Fl_Window_Type.cxx:1437
Fl_Type::insert
void insert(Fl_Type *n)
Definition: Fl_Type.cxx:614
i18n_text_cb
void i18n_text_cb(Fl_Input *i, void *)
Definition: Fl_Window_Type.cxx:157
show_project_cb
void show_project_cb(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:182
Fl::h
static int h()
Definition: Fl_win32.cxx:571
Fl::event_x
static int event_x()
Definition: Fl.H:598
Fl_Type::is_button
virtual int is_button() const
Definition: Fl_Type.cxx:752
write_cstring
void write_cstring(const char *s, int length)
Definition: code.cxx:154
widget_h_input
Fl_Value_Input * widget_h_input
Definition: widget_panel.cxx:63
FL_Down
#define FL_Down
The down arrow key.
Definition: Enumerations.H:483
Fl_Widget::w
int w() const
Definition: Fl_Widget.H:294
Fl_Type::is_group
virtual int is_group() const
Definition: Fl_Type.cxx:758
FL_ALIGN_INSIDE
const Fl_Align FL_ALIGN_INSIDE
Definition: Enumerations.H:843
Fl::first_window
static Fl_Window * first_window()
Definition: Fl.cxx:751
in_this_only
Fl_Type * in_this_only
Definition: Fl_Type.cxx:773
math.h
Fl_Window_Type::leave_live_mode
void leave_live_mode()
Definition: Fl_Window_Type.cxx:1587
Fl_Window::make_current
void make_current()
Definition: Fl_win32.cxx:2590
fluid_prefs
Fl_Preferences fluid_prefs
Fl_Window_Type::Overlay_Window
friend class Overlay_Window
Definition: Fl_Type.h:589
Fl_Window_Type::copy_properties
void copy_properties()
Definition: Fl_Window_Type.cxx:1593
p
static menustate * p
Definition: Fl_Menu.cxx:606
Fl_Widget_Type::default_size
static int default_size
Definition: Fl_Type.h:398
FL_Left
#define FL_Left
The left arrow key.
Definition: Enumerations.H:480
Fl_Widget::w
void w(int v)
Definition: Fl_Widget.H:143
Fl_Menu_Item::callback
Fl_Callback_p callback() const
Definition: Fl_Menu_Item.H:217
FL_Right
#define FL_Right
The right arrow key.
Definition: Enumerations.H:482
_FL_ROUNDED_BOX
see figure 1
Definition: Enumerations.H:623
Fl_Widget::x
void x(int v)
Definition: Fl_Widget.H:139
draw_v_arrow
static void draw_v_arrow(int x, int y1, int y2)
Definition: Fl_Window_Type.cxx:613
FL_Tab
#define FL_Tab
The tab key.
Definition: Enumerations.H:469
undo_checkpoint
void undo_checkpoint()
Definition: undo.cxx:125
Fl_Overlay_Window::show
void show()
Definition: Fl_Overlay_Window.cxx:30
FL_ALT
#define FL_ALT
One of the alt keys is down.
Definition: Enumerations.H:560
Fl_Type::is_class
virtual int is_class() const
Definition: Fl_Type.cxx:764
fl_xyline
void fl_xyline(int x, int y, int x1)
Definition: fl_draw.H:255
Fl_Widget_Class_Type::write_public_state
char write_public_state
Definition: Fl_Type.h:651
snap
int snap
Definition: fluid.cxx:94
draw_height
static void draw_height(int x, int y, int b, Fl_Align a)
Definition: Fl_Window_Type.cxx:655
Fl_Window_Type::fix_overlay
void fix_overlay()
Definition: Fl_Window_Type.cxx:1088
fl_draw.H
utility header to pull drawing functions together
undo.h
i18n_set
const char * i18n_set
Definition: fluid.cxx:706
FL_HELVETICA
const Fl_Font FL_HELVETICA
Helvetica (or Arial) normal (0)
Definition: Enumerations.H:879
Main_Menu
Fl_Menu_Item Main_Menu[]
Definition: Fl_Window_Type.cxx:1136
code_input_cb
void code_input_cb(Fl_Input *i, void *)
Definition: Fl_Window_Type.cxx:249
gridx
int gridx
Definition: fluid.cxx:92
Fl_Window_Type::Fl_Window_Type
Fl_Window_Type()
Definition: Fl_Type.h:613
Fl_Window_Type::dx
int dx
Definition: Fl_Type.h:594
fl_read_image
FL_EXPORT uchar * fl_read_image(uchar *p, int X, int Y, int W, int H, int alpha=0)
Definition: fl_read_image.cxx:152
Fl_Window_Type::setlabel
virtual void setlabel(const char *)
Definition: Fl_Window_Type.cxx:498
Fl_Widget_Type::o
Fl_Widget * o
Definition: Fl_Type.h:401
Fl_Window_Type::open
void open()
Definition: Fl_Window_Type.cxx:410
fix_group_size
void fix_group_size(Fl_Type *t)
Definition: Fl_Group_Type.cxx:42
Fl_Preferences::set
char set(const char *entry, int value)
Definition: Fl_Preferences.cxx:525
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
Fl_Choice::value
int value() const
Definition: Fl_Choice.H:95
Fl_Window
Definition: Fl_Window.H:57
Fl_Widget::hide
virtual void hide()
Definition: Fl_Widget.cxx:283
Fl_Type
Definition: Fl_Type.h:43
Fl_Input
Definition: Fl_Input.H:222
fl_line_style
void fl_line_style(int style, int width=0, char *dashes=0)
Definition: fl_draw.H:177
Fl_Type::write_comment_h
void write_comment_h(const char *ind="")
Definition: Fl_Type.cxx:1004
overlays_invisible
static int overlays_invisible
Definition: Fl_Window_Type.cxx:276
indent
const char * indent()
Definition: code.cxx:99
Overlay_Window::draw
void draw()
Definition: Fl_Window_Type.cxx:291
FL_PUSH
Definition: Enumerations.H:236
Fl_Widget::damage
uchar damage() const
Definition: Fl_Widget.H:917
widget_w_input
Fl_Value_Input * widget_w_input
Definition: widget_panel.cxx:61
Fl_Widget::measure_label
void measure_label(int &ww, int &hh) const
Definition: Fl_Widget.H:957
non_modal_cb
void non_modal_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Window_Type.cxx:448
include_H_from_C
int include_H_from_C
Definition: Fl_Window_Type.cxx:42
Overlay_Window::read_image
uchar * read_image(int &ww, int &hh)
Definition: Fl_Window_Type.cxx:310
fl_yxline
void fl_yxline(int x, int y, int y1)
Definition: fl_draw.H:270
i18n_type_cb
void i18n_type_cb(Fl_Choice *c, void *)
Definition: Fl_Window_Type.cxx:120
Fl_Widget::redraw
void redraw()
Definition: Fl.cxx:1782
Fl_Widget
Definition: Fl_Widget.H:101
Fl_Group::current
static Fl_Group * current()
Definition: Fl_Group.cxx:84
New_Menu
Fl_Menu_Item New_Menu[]
Definition: factory.cxx:976
alignment_panel.h
write_word
void write_word(const char *w)
Definition: file.cxx:58
Fl_Window_Type::bx
int bx
Definition: Fl_Type.h:592
grid_cb
void grid_cb(Fl_Int_Input *i, long v)
Definition: Fl_Window_Type.cxx:78
FL_NO_BOX
nothing is drawn at all, this box is invisible
Definition: Enumerations.H:605
Fl_Type::open
virtual void open()
Definition: Fl_Type.cxx:727
Fl_Window_Type::TOP
Definition: Fl_Type.h:597
FL_ALIGN_BOTTOM
const Fl_Align FL_ALIGN_BOTTOM
Definition: Enumerations.H:835
Fl_Group::add
void add(Fl_Widget &)
Definition: Fl_Group.cxx:491
Fl_Widget::box
Fl_Boxtype box() const
Definition: Fl_Widget.H:363
fl_delete_offscreen
void fl_delete_offscreen(Fl_Offscreen gWorld)
Fl_Widget::h
int h() const
Definition: Fl_Widget.H:299
Fl_Window::shown
int shown()
Definition: Fl_Window.H:485
i18n_file
const char * i18n_file
Definition: fluid.cxx:705
Fl_Widget_Type.h
Overlay_Window::handle
int handle(int)
Definition: Fl_Window_Type.cxx:343
Fl::event_y
static int event_y()
Definition: Fl.H:603
update_xywh
static void update_xywh()
Definition: Fl_Window_Type.cxx:57
FL_KEYBOARD
Definition: Enumerations.H:315
Fl_Widget::h
void h(int v)
Definition: Fl_Widget.H:145
i18n_int_cb
void i18n_int_cb(Fl_Int_Input *i, void *)
Definition: Fl_Window_Type.cxx:170
Fl_Window_Type::newposition
void newposition(Fl_Widget_Type *, int &x, int &y, int &w, int &h)
Definition: Fl_Window_Type.cxx:567
global_settings_window
Fl_Double_Window * global_settings_window
Definition: alignment_panel.cxx:635
i18n_type_chooser
Fl_Choice * i18n_type_chooser
Definition: alignment_panel.cxx:40
Fl_Widget_Class_Type::wc_relative
char wc_relative
Definition: Fl_Type.h:652
def_widget_size
Fl_Round_Button * def_widget_size[6]
Definition: alignment_panel.cxx:436
Fl_Window_Type::moveallchildren
void moveallchildren()
Definition: Fl_Window_Type.cxx:1140
gridy
int gridy
Definition: fluid.cxx:93
Fl_Widget_Class_Type::write_properties
virtual void write_properties()
Definition: Fl_Window_Type.cxx:1466
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_SHOW
Definition: Enumerations.H:377
FL_RED
const Fl_Color FL_RED
Definition: Enumerations.H:957
settings_window
Fl_Double_Window * settings_window
Definition: alignment_panel.cxx:147
write_h
void write_h(const char *format,...)
Definition: code.cxx:272
Fl_Window_type
Fl_Window_Type Fl_Window_type
Definition: Fl_Window_Type.cxx:503
Fl_Type::click_test
virtual Fl_Type * click_test(int, int)
Definition: Fl_Type.cxx:568
Fl::event_clicks
static int event_clicks()
Definition: Fl.H:645
Fl_Window::handle
virtual int handle(int)
Definition: Fl.cxx:1684
Fl_Window_Type::write_properties
virtual void write_properties()
Definition: Fl_Window_Type.cxx:1376
project_window
Fl_Double_Window * project_window
Definition: alignment_panel.cxx:26
pasteoffset
int pasteoffset
Definition: Fl_Widget_Type.cxx:2537
guides_cb
void guides_cb(Fl_Check_Button *i, long)
Definition: Fl_Window_Type.cxx:66
fl_begin_offscreen
void fl_begin_offscreen(Fl_Offscreen gWorld)
set_modflag
void set_modflag(int mf)
Definition: fluid.cxx:1687
Fl_Window_Type::move_child
void move_child(Fl_Type *, Fl_Type *)
Definition: Fl_Window_Type.cxx:398
Fl_Widget::size
void size(int W, int H)
Definition: Fl_Widget.H:341
x
int x
Definition: test.c:73
grid_window
Fl_Double_Window * grid_window
Definition: alignment_panel.cxx:422
widget_y_input
Fl_Value_Input * widget_y_input
Definition: widget_panel.cxx:59
Fl_Widget::visible_r
int visible_r() const
Definition: Fl_Widget.cxx:295
Fl_Overlay_Window
Definition: Fl_Overlay_Window.H:38
i18n_include
const char * i18n_include
Definition: fluid.cxx:703
Fl_Window_Type::add_child
void add_child(Fl_Type *, Fl_Type *)
Definition: Fl_Window_Type.cxx:384
Fl_Widget_Type::subclass
const char * subclass() const
Definition: Fl_Type.h:415
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
Fl_Window_Type::drag
int drag
Definition: Fl_Type.h:595
FL_ALIGN_WRAP
const Fl_Align FL_ALIGN_WRAP
Definition: Enumerations.H:851
show_guides
int show_guides
Definition: fluid.cxx:95
Fl_Widget_Type::write_code1
void write_code1()
Definition: Fl_Widget_Type.cxx:2101
Fl_Menu_Item::popup
const Fl_Menu_Item * popup(int X, int Y, const char *title=0, const Fl_Menu_Item *picked=0, const Fl_Menu_ *=0) const
Definition: Fl_Menu.cxx:1020
FL_ALIGN_TOP
const Fl_Align FL_ALIGN_TOP
Definition: Enumerations.H:833
Fl_Window_Type::sr
int sr
Definition: Fl_Type.h:593
draw_left_brace
static void draw_left_brace(const Fl_Widget *w)
Definition: Fl_Window_Type.cxx:635
Fl_Window_Type::sy
int sy
Definition: Fl_Type.h:593
FL_SHORTCUT
Definition: Enumerations.H:349
Fl_Window_Type::non_modal
uchar non_modal
Definition: Fl_Type.h:614
Fl_Round_Button.H
Fl_Window_Type::newdx
void newdx()
Definition: Fl_Window_Type.cxx:522
Fl_Window_Type::mx
int mx
Definition: Fl_Type.h:590
dy
uchar dy
Definition: fl_boxtype.cxx:286
Fl_Menu_Item
Definition: Fl_Menu_Item.H:112
read_word
const char * read_word(int wantbrace)
Definition: file.cxx:230
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_Window::draw
virtual void draw()
Definition: Fl_Window_shape.cxx:340
Fl_Type::name
const char * name() const
Definition: Fl_Type.h:96
Fl_Widget_Type::is_widget
virtual int is_widget() const
Definition: Fl_Widget_Type.cxx:52
Fl_Widget_Type::write_properties
virtual void write_properties()
Definition: Fl_Widget_Type.cxx:2418
y
int y
Definition: test.c:74
show_global_settings_window
void show_global_settings_window()
Definition: alignment_panel.cxx:620
Fl_Preferences
Fl_Preferences provides methods to store user settings between application starts.
Definition: Fl_Preferences.H:60
Fl_Widget_Type::read_property
virtual void read_property(const char *)
Definition: Fl_Widget_Type.cxx:2539
Fl_Window_Type::y1
int y1
Definition: Fl_Type.h:591
vertical_input
Fl_Int_Input * vertical_input
Definition: alignment_panel.cxx:426
draw_width
static void draw_width(int x, int y, int r, Fl_Align a)
Definition: Fl_Window_Type.cxx:690
fl_end_offscreen
void fl_end_offscreen()
current_widget_class
Fl_Widget_Class_Type * current_widget_class
Definition: Fl_Window_Type.cxx:1435
Fl_Widget::parent
Fl_Group * parent() const
Definition: Fl_Widget.H:254
Fl_Offscreen
CGContextRef Fl_Offscreen
Definition: mac.H:45
Fl_Window_Type::draw_overlay
void draw_overlay()
Definition: Fl_Window_Type.cxx:724
fl_create_offscreen
Fl_Offscreen fl_create_offscreen(int w, int h)
Fl::scheme_bg_
static Fl_Image * scheme_bg_
Definition: Fl.H:262
Fl_Window_Type::remove_child
void remove_child(Fl_Type *)
Definition: Fl_Window_Type.cxx:392
code_file_input
Fl_Input * code_file_input
Definition: alignment_panel.cxx:34
Y
static int Y
Definition: Fl_Tooltip.cxx:76
Fl_Type::prev
Fl_Type * prev
Definition: Fl_Type.h:71
modal_cb
void modal_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Window_Type.cxx:437
Fl_Double_Window::show
void show()
Definition: Fl_Double_Window.cxx:79
Fl_Window_Type
Definition: Fl_Type.h:584
Fl_Type::selected
char selected
Definition: Fl_Type.h:65
Fl_Window_Type::sr_max_w
int sr_max_w
Definition: Fl_Type.h:641
Fl_Window_Type::make
Fl_Type * make()
Definition: Fl_Window_Type.cxx:355
Fl_Widget_Type::open
void open()
Definition: Fl_Widget_Type.cxx:1905
use_FL_COMMAND
int use_FL_COMMAND
Definition: Fl_Window_Type.cxx:43
Fl_Window_Type::read_image
uchar * read_image(int &ww, int &hh)
Definition: Fl_Window_Type.cxx:427
Fl_Widget::resize
virtual void resize(int x, int y, int w, int h)
Definition: Fl_Widget.cxx:150
Fl_Window_Type::LEFT
Definition: Fl_Type.h:597
Fl_Widget_Type::xclass
const char * xclass
Definition: Fl_Type.h:400
Fl_Widget_Class_Type::write_code1
void write_code1()
Definition: Fl_Window_Type.cxx:1490
Fl::w
static int w()
Definition: Fl_win32.cxx:579
Fl_Window_Type::dy
int dy
Definition: Fl_Type.h:594
FL_ALIGN_RIGHT
const Fl_Align FL_ALIGN_RIGHT
Definition: Enumerations.H:841
widget_panel.h
Fl_Type::factory
Fl_Type * factory
Definition: Fl_Type.h:73
Fl_Menu_Item::do_callback
void do_callback(Fl_Widget *o) const
Definition: Fl_Menu_Item.H:384
i18n_type
int i18n_type
Definition: fluid.cxx:702
use_FL_COMMAND_button
Fl_Check_Button * use_FL_COMMAND_button
Definition: alignment_panel.cxx:38
Fl_Widget_Type::redraw
void redraw()
Definition: Fl_Widget_Type.cxx:256
show_settings_cb
void show_settings_cb(Fl_Widget *, void *)
Definition: Fl_Window_Type.cxx:234
Overlay_Window::window
Fl_Window_Type * window
Definition: Fl_Window_Type.cxx:285
trimclassname
static const char * trimclassname(const char *n)
Definition: Fl_Window_Type.cxx:1481
FL_RELEASE
Definition: Enumerations.H:244
Fl_Window_Type::read_property
virtual void read_property(const char *)
Definition: Fl_Window_Type.cxx:1388
Fl_Widget::labelsize
Fl_Fontsize labelsize() const
Definition: Fl_Widget.H:502
border_cb
void border_cb(Fl_Light_Button *i, void *v)
Definition: Fl_Window_Type.cxx:459
Fl_Window_Type::BOX
Definition: Fl_Type.h:597
fl_message.H
i18n_function_input
Fl_Input * i18n_function_input
Definition: alignment_panel.cxx:55
Fl_Align
unsigned Fl_Align
Definition: Enumerations.H:828
window_type_menu
Fl_Menu_Item window_type_menu[]
Definition: Fl_Window_Type.cxx:271
uchar
unsigned char uchar
Definition: fl_types.h:30
use_FL_COMMAND_button_cb
void use_FL_COMMAND_button_cb(Fl_Check_Button *b, void *)
Definition: Fl_Window_Type.cxx:262
FL_CTRL
#define FL_CTRL
One of the ctrl keys is down.
Definition: Enumerations.H:559
default_widget_size_cb
void default_widget_size_cb(Fl_Round_Button *b, long size)
Definition: Fl_Window_Type.cxx:112
Fl_Window_Type::modal
uchar modal
Definition: Fl_Type.h:614
Fl_Widget_Type::write_widget_code
void write_widget_code()
Definition: Fl_Widget_Type.cxx:2240
Fl_Check_Button
A button with a "checkmark" to show its status.
Definition: Fl_Check_Button.H:30
Fl_Window_Type::x1
int x1
Definition: Fl_Type.h:591
include_H_from_C_button_cb
void include_H_from_C_button_cb(Fl_Check_Button *b, void *)
Definition: Fl_Window_Type.cxx:255
redraw_overlays
void redraw_overlays()
Definition: Fl_Window_Type.cxx:1112
dx
uchar dx
Definition: fl_boxtype.cxx:286
Fl_Menu_Item.H
FL_Escape
#define FL_Escape
The escape key.
Definition: Enumerations.H:474
code_file_name
const char * code_file_name
Definition: fluid.cxx:701
i18n_file_input
Fl_Input * i18n_file_input
Definition: alignment_panel.cxx:51
Fl_Window_Type::write_code2
void write_code2()
Definition: Fl_Window_Type.cxx:1351
Fl_Type::remove
Fl_Type * remove()
Definition: Fl_Type.cxx:650
guides_toggle
Fl_Check_Button * guides_toggle
Definition: alignment_panel.cxx:430
Fl_Window_Type::bt
int bt
Definition: Fl_Type.h:592
Fl_Widget::image
Fl_Image * image()
Definition: Fl_Widget.H:514
Fl_Widget_Type::write_extra_code
void write_extra_code()
Definition: Fl_Widget_Type.cxx:2399
Fl_Group::resizable
void resizable(Fl_Widget &o)
Definition: Fl_Group.H:117
Fl::event_inside
static int event_inside(int, int, int, int)
Definition: Fl.cxx:227
Fl_Widget_Type::resizable
uchar resizable() const
Definition: Fl_Widget_Type.cxx:859
Fl_Widget_Type::write_block_close
void write_block_close()
Definition: Fl_Widget_Type.cxx:2405
Fl_Overlay_Window.H
Fl_Window_Type::write_code1
void write_code1()
Definition: Fl_Window_Type.cxx:1347
fl_rect
void fl_rect(int x, int y, int w, int h)
Definition: fl_draw.H:201