diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-03-28 04:23:32 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-03-28 04:23:32 +0000 |
| commit | 2abfda36ab9e32bbd8c93ab43eb006fe6778146a (patch) | |
| tree | 1baae18ad973e0897fe6f56dd11b1a6da5fa9409 /fluid/Fl_Window_Type.cxx | |
| parent | 9f6d4ada32cff2df7bde458ce130edd4379b9c50 (diff) | |
Preliminary support for widget classes (still need to do code writing
methods...)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4196 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'fluid/Fl_Window_Type.cxx')
| -rw-r--r-- | fluid/Fl_Window_Type.cxx | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index dbd8a3a1c..7fe924488 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -1288,6 +1288,60 @@ int Fl_Window_Type::read_fdesign(const char* propname, const char* value) { return 1; } +/////////////////////////////////////////////////////////////////////// + +Fl_Widget_Class_Type Fl_Widget_Class_type; + +Fl_Type *Fl_Widget_Class_Type::make() { + Fl_Type *p = Fl_Type::current; + while (p && !p->is_decl_block()) p = p->parent; + Fl_Widget_Class_Type *myo = new Fl_Widget_Class_Type(); + myo->name("UserInterface"); + + if (!this->o) {// template widget + this->o = new Fl_Window(100,100); + Fl_Group::current(0); + } + // Set the size ranges for this window; in order to avoid opening the + // X display we use an arbitrary maximum size... + ((Fl_Window *)(this->o))->size_range(gridx, gridy, + 3072, 2048, + gridx, gridy, 0); + myo->factory = this; + myo->drag = 0; + myo->numselected = 0; + Overlay_Window *w = new Overlay_Window(100,100); + w->window = myo; + myo->o = w; + myo->add(p); + myo->modal = 0; + myo->non_modal = 0; + + return myo; +} + + +void Fl_Widget_Class_Type::write_code1() { + Fl_Widget_Type::write_code1(); +} + +void Fl_Widget_Class_Type::write_code2() { + write_extra_code(); + if (modal) write_c("%so->set_modal();\n", indent()); + else if (non_modal) write_c("%so->set_non_modal();\n", indent()); + if (!((Fl_Window*)o)->border()) write_c("%so->clear_border();\n", indent()); + if (xclass) { + write_c("%so->xclass(", indent()); + write_cstring(xclass); + write_c(");\n"); + } + write_c("%so->end();\n", indent()); + if (((Fl_Window*)o)->resizable() == o) + write_c("%so->resizable(o);\n", indent()); + write_block_close(); +} + + // // End of "$Id$". // |
