RE: [fltk.general] Designing an Fl_Group in fluid without an Fl_Window

16 views
Skip to first unread message

MacArthur, Ian (Selex ES, UK)

unread,
Feb 26, 2015, 11:14:50 AM2/26/15
to fltkg...@googlegroups.com
> I'd like to be able to design some groups of widgets all contained in an
> Fl_Group in Fluid, but it seems that I can't do that without them all being
> in their own window.

> Is there a way around this?


This ought to pretty much Just Work.

Note that when you are designing your GUI, fluid shows the derived widget in a floating window, but that's not necessarily strictly representative of how it will be manifest in your code...

So, in fluid, you go

New->Code->Widget Class

and this pops a floating window that you design your widget in (but this need not be a floating window once your code is made.)

Now select the new widget in the fluid browser and get its properties up:

On the C++ tab, set the name to whatever's appropriate (let's say MyGroup for now), and ensure the Class field is set to Fl_Group.

Then on the GUI tab, make sure the width and height are what you want, and make sure the "Relative" toggle button is selected.


Now on your main window, drop a regular Fl_Group of the correct size, and get its properties dialog up.

On the C++ tab, set Class: to MyGroup, and on the GUI tab make sure the size and position are correct.


Rinse and repeat for additional instances of your derived group.

Have fluid generate the code; compile; test.

That ought to be about it...


I'm probably explaining this badly; here's one I made earlier...


derived_grp.fl


# data file for the Fltk User Interface Designer (fluid)
version 1.0303
header_name {.h}
code_name {.cxx}
widget_class derived_group {open
xywh {-1256 362 200 200} type Double
class Fl_Group visible position_relative
} {
Fl_Button {} {
label {A Button}
xywh {25 25 70 35}
}
}

Function {} {open
} {
Fl_Window main_win {
label Main open
xywh {-943 281 305 588} type Double visible
} {
Fl_Group dervied_1 {open
xywh {25 25 200 200} box THIN_DOWN_BOX
class derived_group
} {}
Fl_Group {} {open
xywh {25 250 200 200} box THIN_DOWN_BOX
class derived_group
} {}
Fl_Button {} {
label Quit
callback {main_win->hide();} selected
xywh {90 515 64 35}
}
}
}


Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
Reply all
Reply to author
Forward
0 new messages