From 93ea93ee2b424ded25358d87529b1160cdb4f80c Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 1 Nov 2022 13:30:05 +0100 Subject: Fluid support for Fl_Flex (#523) and some Fl_Flex improvements * Adding Fluid support for Fl_Flex, margins, and gap. * Fluid Fl_Flex mostly working. Fixed in Fl_Flex::set_size(). * Fluid Flex live mode works, interactive dragging works * Fluid Flex: adding check box for fixed children * Fluid Flex: visual flexibility indicator in guides. * Fluid Flex: bug in generated code. * Fix formatting * Fixing Tooltip, fixing resize issue PR #518. * Removing unused variables. Co-authored-by: Albrecht Schlosser --- fluid/Fl_Group_Type.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'fluid/Fl_Group_Type.h') diff --git a/fluid/Fl_Group_Type.h b/fluid/Fl_Group_Type.h index 581f9ce3a..3d21a44b6 100644 --- a/fluid/Fl_Group_Type.h +++ b/fluid/Fl_Group_Type.h @@ -21,6 +21,7 @@ #include #include +#include #include void group_cb(Fl_Widget *, void *); @@ -82,6 +83,38 @@ public: void copy_properties(); }; +extern const char flex_type_name[]; +extern Fl_Menu_Item flex_type_menu[]; + +class Fl_Flex_Type : public Fl_Group_Type { + Fl_Menu_Item *subtypes() {return flex_type_menu;} + int fixedSizeTableSize; + int *fixedSizeTable; + int suspend_auto_layout; +public: + Fl_Flex_Type() : fixedSizeTableSize(0), fixedSizeTable(NULL), suspend_auto_layout(0) { } + virtual const char *type_name() {return flex_type_name;} + virtual const char *alt_type_name() {return "fltk::FlexGroup";} + Fl_Widget_Type *_make() { return new Fl_Flex_Type(); } + Fl_Widget *widget(int X,int Y,int W,int H) { + Fl_Flex *g = new Fl_Flex(X,Y,W,H); Fl_Group::current(0); return g;} + int pixmapID() { return 56; } + void write_properties(); + void read_property(const char *); + Fl_Widget *enter_live_mode(int top=0); + void copy_properties(); + void postprocess_read(); + void write_code2(); + void add_child(Fl_Type*, Fl_Type*); + void move_child(Fl_Type*, Fl_Type*); + void remove_child(Fl_Type*); + int is_flex() const {return 1;} + void change_subtype_to(int n); + static int parent_is_flex(Fl_Type*); + static int size(Fl_Type*, char fixed_only=0); + static int is_fixed(Fl_Type*); +}; + extern const char table_type_name[]; class Fl_Table_Type : public Fl_Group_Type { -- cgit v1.2.3