diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2005-08-15 23:07:20 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2005-08-15 23:07:20 +0000 |
| commit | 78e42749634776a377eb3f0ceadea6276213ec7e (patch) | |
| tree | 7fb45a6dd35e54204d7ac7104fcc9b3cb80466a3 /fluid/Fl_Window_Type.cxx | |
| parent | 41c089f3c13261e4606d43c1682fb4b3501e6670 (diff) | |
Added support for Fl_Window::size_range() in FLUID. There are no UI elements for increment or aspect ratio.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4515 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Window_Type.cxx')
| -rw-r--r-- | fluid/Fl_Window_Type.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index 9223ae918..6ded1196f 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -1251,6 +1251,11 @@ void Fl_Window_Type::write_code2() { write_cstring(xclass); write_c(");\n"); } + if (sr_max_w || sr_max_h) { + write_c("%so->size_range(%d, %d, %d, %d);\n", indent(), sr_min_w, sr_min_h, sr_max_w, sr_max_h); + } else if (sr_min_w || sr_min_h) { + write_c("%so->size_range(%d, %d);\n", indent(), sr_min_w, sr_min_h); + } write_c("%so->end();\n", indent()); if (((Fl_Window*)o)->resizable() == o) write_c("%so->resizable(o);\n", indent()); @@ -1263,6 +1268,8 @@ void Fl_Window_Type::write_properties() { else if (non_modal) write_string("non_modal"); if (!((Fl_Window*)o)->border()) write_string("noborder"); if (xclass) {write_string("xclass"); write_word(xclass);} + if (sr_min_w || sr_min_h || sr_max_w || sr_max_h) + write_string("size_range {%d %d %d %d}", sr_min_w, sr_min_h, sr_max_w, sr_max_h); if (o->visible()) write_string("visible"); } @@ -1279,6 +1286,11 @@ void Fl_Window_Type::read_property(const char *c) { } else if (!strcmp(c,"xclass")) { storestring(read_word(),xclass); ((Fl_Window*)o)->xclass(xclass); + } else if (!strcmp(c,"size_range")) { + int mw, mh, MW, MH; + if (sscanf(read_word(),"%d %d %d %d",&mw,&mh,&MW,&MH) == 4) { + sr_min_w = mw; sr_min_h = mh; sr_max_w = MW; sr_max_h = MH; + } } else if (!strcmp(c,"xywh")) { Fl_Widget_Type::read_property(c); pasteoffset = 0; // make it not apply to contents |
