DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2494
Version: 1.3-feature


This second version of simple macros for fluid also include the memory
leaks patch from a previous STR.

This version adds a $(dirty_name) macro that is the supplied widget name
without any cleanup, the resulting name used on code generation have all
"@" replaced by "_" except the first one if it is at position 0 (see
bellow) in this case it's removed.

And a new code generation option when the widget name starts with "@",
with this option instead of fluid generate code to create a new widget it
instead generate code to reuse an already existing widget (probably
existing on a base class or created elsewhere).

This option allow to have more than one Skin/Layout to the same widgets,
we create a class with all widgets that are necessary to show/edit a set
of fields with the code to mange load/validation/save/..., and we create
on fluid one or more dialogs/widget classes derived from this class, lets
suppose one for big monitors, another for pdas, another for touch screens,
...

example code with and without this option:

---------
//widget name = @dbf_id
//extra line = =o->user_data((void*)"$(dirty_name)");
  { Fl_Output* o = dbf_id;
    Fl_Group::current->add(dbf_id);
    dbf_id->resize(15, 240, 82, 26);
    dbf_id->label(_tr("ID"));
    dbf_id->labelsize(16);
    dbf_id->textsize(16);
    dbf_id->align(Fl_Align(FL_ALIGN_TOP_LEFT));
    o->user_data((void*)"@d...@id");
  } // Fl_Output* dbf_id

---------
---------
//widget name = dbf_id
//extra line = =o->user_data((void*)"$(dirty_name)");
  { Fl_Output* o = dbf_id = new Fl_Output(15, 240, 82, 26, _tr("ID"));
    dbf_id->labelsize(16);
    dbf_id->textsize(16);
    dbf_id->align(Fl_Align(FL_ALIGN_TOP_LEFT));
    o->user_data((void*)"d...@id");
  } // Fl_Output* dbf_id
---------


Link: http://www.fltk.org/str.php?L2494
Version: 1.3-feature

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to