2006-10-29 17:16:03 +03:00
|
|
|
<HTML>
|
|
|
|
<HEAD>
|
|
|
|
<TITLE>Fl_Group</TITLE>
|
|
|
|
</HEAD>
|
|
|
|
<BODY>
|
2001-11-28 21:00:17 +03:00
|
|
|
<!-- NEW PAGE -->
|
1999-01-13 22:28:54 +03:00
|
|
|
<H2><A name=Fl_Group>class Fl_Group</A></H2>
|
|
|
|
<HR>
|
|
|
|
<H3>Class Hierarchy</H3>
|
|
|
|
<UL>
|
|
|
|
<PRE>
|
|
|
|
<A href=Fl_Widget.html#Fl_Widget>Fl_Widget</A>
|
1998-12-29 17:21:17 +03:00
|
|
|
|
|
1999-01-13 22:28:54 +03:00
|
|
|
+----<B>Fl_Group</B>
|
1998-12-29 17:21:17 +03:00
|
|
|
|
|
2006-10-29 17:16:03 +03:00
|
|
|
+----<A href=Fl_Browser_.html#Fl_Browser_>Fl_Browser_</A>, <A href=Fl_Color_Chooser.html#Fl_Color_Chooser>Fl_Color_Chooser</A>, <A href=Fl_Help_View.html#Fl_Help_View>Fl_Help_View</A>, <A href=Fl_Input_Choice.html#Fl_Input_Choice>Fl_Input_Choice</A>, <A href=Fl_Pack.html#Fl_Pack>Fl_Pack</A>,
|
|
|
|
<A href=Fl_Scroll.html#Fl_Scroll>Fl_Scroll</A>, <A href=Fl_Tabs.html#Fl_Tabs>Fl_Tabs</A>, <A href=Fl_Spinner.html#Fl_Spinner>Fl_Spinner</A>, <A href=Fl_Tabs.html#Fl_Tabs>Fl_Tabs</A>, <A href=Fl_Text_Display.html#Fl_Text_Display>Fl_Text_Display</A>, <A href=Fl_Tile.html#Fl_Tile>Fl_Tile</A>,
|
|
|
|
<A href=Fl_Window.html#Fl_Window>Fl_Window</A>, <A href=Fl_Wizard.html#Fl_Wizard>Fl_Wizard</A>
|
1999-01-13 22:28:54 +03:00
|
|
|
</PRE>
|
|
|
|
</UL>
|
|
|
|
<H3>Include Files</H3>
|
|
|
|
<UL>
|
|
|
|
<PRE>
|
|
|
|
#include <FL/Fl_Group.H>
|
|
|
|
</PRE>
|
|
|
|
</UL>
|
|
|
|
<H3>Description</H3>
|
2001-11-29 22:24:00 +03:00
|
|
|
The <TT>Fl_Group</TT> class is the FLTK container widget. It maintains
|
|
|
|
an array of child widgets. These children can themselves be any widget
|
1999-01-13 22:28:54 +03:00
|
|
|
including <TT>Fl_Group</TT>. The most important subclass of <TT>Fl_Group</TT>
|
2001-11-29 22:24:00 +03:00
|
|
|
is <A href=Fl_Window.html#Fl_Window><TT>Fl_Window</TT></A>, however
|
|
|
|
groups can also be used to control radio buttons or to enforce resize
|
|
|
|
behavior.
|
1999-01-13 22:28:54 +03:00
|
|
|
<H3>Methods</H3>
|
|
|
|
<CENTER>
|
2001-05-06 20:25:05 +04:00
|
|
|
<TABLE width=90% summary="Fl_Group methods.">
|
1999-01-13 22:28:54 +03:00
|
|
|
<TR><TD align=left valign=top>
|
|
|
|
<UL>
|
|
|
|
<LI><A href=#Fl_Group.Fl_Group>Fl_Group</A></LI>
|
|
|
|
<LI><A href=#Fl_Group.~Fl_Group>~Fl_Group</A></LI>
|
|
|
|
<LI><A href=#Fl_Group.add>add</A></LI>
|
2007-12-15 19:42:00 +03:00
|
|
|
<LI><A href=#Fl_Group.add_resizable>add_resizable</A></LI>
|
1999-01-13 22:28:54 +03:00
|
|
|
</UL>
|
|
|
|
</TD><TD align=left valign=top>
|
|
|
|
<UL>
|
|
|
|
<LI><A href=#Fl_Group.array>array</A></LI>
|
|
|
|
<LI><A href=#Fl_Group.begin>begin</A></LI>
|
2007-12-15 19:42:00 +03:00
|
|
|
<LI><A href=#Fl_Group.child>child</A></LI>
|
|
|
|
<LI><A href=#Fl_Group.children>children</A></LI>
|
1999-01-13 22:28:54 +03:00
|
|
|
</UL>
|
|
|
|
</TD><TD align=left valign=top>
|
|
|
|
<UL>
|
2003-04-02 00:19:35 +04:00
|
|
|
<LI><A href="#Fl_Group.clear">clear</A></LI>
|
2007-12-15 19:42:00 +03:00
|
|
|
<LI><A href="#Fl_Group.clip_children">clip_children</A></LI>
|
1999-01-13 22:28:54 +03:00
|
|
|
<LI><A href=#Fl_Group.current>current</A></LI>
|
|
|
|
</UL>
|
|
|
|
</TD><TD align=left valign=top>
|
|
|
|
<UL>
|
|
|
|
<LI><A href=#Fl_Group.end>end</A></LI>
|
|
|
|
<LI><A href=#Fl_Group.find>find</A></LI>
|
2000-04-28 22:15:26 +04:00
|
|
|
<LI><A href=#Fl_Group.init_sizes>init_sizes</A></LI>
|
1999-01-13 22:28:54 +03:00
|
|
|
</UL>
|
|
|
|
</TD><TD align=left valign=top>
|
|
|
|
<UL>
|
2000-04-28 22:15:26 +04:00
|
|
|
<LI><A href=#Fl_Group.insert>insert</A></LI>
|
1999-01-13 22:28:54 +03:00
|
|
|
<LI><A href=#Fl_Group.remove>remove</A></LI>
|
2001-10-01 00:25:36 +04:00
|
|
|
<LI><A href=#Fl_Group.resizable>resizable</A></LI>
|
1999-01-13 22:28:54 +03:00
|
|
|
</UL>
|
|
|
|
</TD></TR>
|
|
|
|
</TABLE>
|
|
|
|
</CENTER>
|
2001-11-29 22:24:00 +03:00
|
|
|
<H4><A name=Fl_Group.Fl_Group>Fl_Group::Fl_Group(int x, int y, int w,
|
1999-01-13 22:28:54 +03:00
|
|
|
int h, const char *label = 0)</A></H4>
|
2001-11-29 22:24:00 +03:00
|
|
|
Creates a new <TT>Fl_Group</TT> widget using the given position, size,
|
|
|
|
and label string. The default boxtype is <TT>FL_NO_BOX</TT>.
|
1999-01-13 22:28:54 +03:00
|
|
|
<H4><A name=Fl_Group.~Fl_Group>virtual Fl_Group::~Fl_Group()</A></H4>
|
2001-11-29 22:24:00 +03:00
|
|
|
The destructor <I>also deletes all the children</I>. This allows a
|
|
|
|
whole tree to be deleted at once, without having to keep a pointer to
|
1999-01-13 22:28:54 +03:00
|
|
|
all the children in the user code. A kludge has been done so the <TT>
|
2001-11-29 22:24:00 +03:00
|
|
|
Fl_Group</TT> and all of it's children can be automatic (local)
|
|
|
|
variables, but you must declare the <TT>Fl_Group</TT> <I>first</I>, so
|
|
|
|
that it is destroyed last.
|
1999-01-13 22:28:54 +03:00
|
|
|
<H4><A name=Fl_Group.add>void Fl_Group::add(Fl_Widget &w)
|
|
|
|
<BR> void Fl_Group::add(Fl_Widget *w)</A></H4>
|
1999-01-27 11:45:11 +03:00
|
|
|
|
1999-01-31 10:43:16 +03:00
|
|
|
The widget is removed from it's current group (if any) and then added
|
|
|
|
to the end of this group.
|
|
|
|
|
2003-04-02 00:19:35 +04:00
|
|
|
<H4><A name="Fl_Group.clear">void Fl_Group::clear()</A></H4>
|
|
|
|
|
2004-09-08 00:59:18 +04:00
|
|
|
<p>The <tt>clear()</tt> method deletes all child widgets from
|
|
|
|
memory recursively.</p>
|
|
|
|
|
|
|
|
<p>This method differs from the <a
|
|
|
|
href='#Fl_Group.remove'><tt>remove()</tt></a> method in that it
|
|
|
|
affects all child widgets and deletes them from memory.</p>
|
2003-04-02 00:19:35 +04:00
|
|
|
|
2007-12-15 19:42:00 +03:00
|
|
|
<H4><A name="Fl_Group.clip_children">void Fl_Group::clip_children(int c);<br>
|
|
|
|
int Fl_Group::clip_children();</A></H4>
|
|
|
|
|
|
|
|
The first method controls whether the group widget clips the drawing of
|
|
|
|
child widgets to its bounding box.
|
|
|
|
|
|
|
|
<p>The second method returns the current clipping mode.
|
|
|
|
|
|
|
|
<p>The default is to not clip (0) the drawing of child widgets.
|
|
|
|
|
2000-04-28 22:15:26 +04:00
|
|
|
<H4><A name="Fl_Group.init_sizes">void Fl_Group::init_sizes()</A></H4>
|
|
|
|
|
|
|
|
The <TT>Fl_Group</TT> widget keeps track of the original widget sizes and
|
|
|
|
positions when resizing occurs so that if you resize a window back to its
|
|
|
|
original size the widgets will be in the correct places. If you rearrange
|
|
|
|
the widgets in your group, call this method to register the new arrangement
|
|
|
|
with the <TT>Fl_Group</TT> that contains them.
|
|
|
|
|
1999-01-31 10:43:16 +03:00
|
|
|
<H4><A name=Fl_Group.insert>void Fl_Group::insert(Fl_Widget &w, int n)</A></H4>
|
1999-01-27 11:45:11 +03:00
|
|
|
|
|
|
|
The widget is removed from it's current group (if any) and then
|
|
|
|
inserted into this group. It is put at index <TT>n</TT> (or at the end
|
1999-01-31 10:43:16 +03:00
|
|
|
if <tt>n >= children()</tt>. This can also be used to rearrange
|
2002-05-30 16:12:44 +04:00
|
|
|
the widgets inside a group.
|
1999-01-31 10:43:16 +03:00
|
|
|
|
|
|
|
<H4>void Fl_Group::insert(Fl_Widget &w, Fl_Widget* beforethis)</H4>
|
|
|
|
|
|
|
|
This does <tt>insert(w, find(beforethis))</tt>. This will append the
|
|
|
|
widget if <tt>beforethis</tt> is not in the group.
|
1999-01-27 11:45:11 +03:00
|
|
|
|
|
|
|
<H4><A name=Fl_Group.remove>void Fl_Group::remove(Fl_Widget &w)</A></H4>
|
2004-09-08 00:59:18 +04:00
|
|
|
|
|
|
|
<p>Removes a widget from the group but does not delete it. This
|
|
|
|
method does nothing if the widget is not a child of the
|
|
|
|
group.</p>
|
|
|
|
|
|
|
|
<p>This method differs from the <a
|
|
|
|
href='#Fl_Group.clear'><tt>clear()</tt></a> method in that it
|
|
|
|
only affects a single widget and does not delete it from
|
|
|
|
memory.</p>
|
1999-01-27 11:45:11 +03:00
|
|
|
|
1999-01-31 10:43:16 +03:00
|
|
|
<H4><A name=Fl_Group.current>static Fl_Group *Fl_Group::current()
|
|
|
|
<BR> static void Fl_Group::current(Fl_Group *w)</A></H4>
|
|
|
|
<TT>current()</TT> returns the currently active group. The Fl_Widget
|
2007-05-17 19:52:15 +04:00
|
|
|
constructor automatically does <tt>current()->add(widget)</tt> if this is not null.
|
1999-01-31 10:43:16 +03:00
|
|
|
To prevent new widgets from being added to a group, call <TT>Fl_Group::current(0)</TT>.
|
1999-01-13 22:28:54 +03:00
|
|
|
<H4><A name=Fl_Group.begin>void Fl_Group::begin()</A></H4>
|
2001-11-29 22:24:00 +03:00
|
|
|
<TT>begin()</TT> sets the current group so you can build the widget
|
|
|
|
tree by just constructing the widgets. <TT>begin()</TT> is
|
|
|
|
automatically called by the constructor for Fl_Group (and thus for
|
|
|
|
Fl_Window as well). <TT>begin()</TT> <i>is exactly the same as</i> <TT>current(this)</TT>.
|
1999-01-13 22:28:54 +03:00
|
|
|
<P><I>Don't forget to <TT>end()</TT> the group or window!</I></P>
|
1999-01-27 11:45:11 +03:00
|
|
|
<H4><A name=Fl_Group.end>void Fl_Group::end()</A></H4>
|
2001-11-29 22:24:00 +03:00
|
|
|
<TT>end()</TT> <i>is exactly the same as</i> <TT>current(this->parent())</TT>. Any new widgets
|
|
|
|
added to the widget tree will be added to the parent of the group.
|
1999-01-31 10:43:16 +03:00
|
|
|
<H4><A name=Fl_Group.array>const Fl_Widget **Fl_Group::array() const</A></H4>
|
|
|
|
Returns a pointer to the array of children. <I>This pointer is only
|
|
|
|
valid until the next time a child is added or removed.</I>
|
1999-01-13 22:28:54 +03:00
|
|
|
<H4><A name=Fl_Group.child>Fl_Widget *Fl_Group::child(int n) const</A></H4>
|
1999-01-31 10:43:16 +03:00
|
|
|
Returns <tt>array()[n]</tt>. <i>No range checking is done!</i>
|
1999-01-13 22:28:54 +03:00
|
|
|
<H4><A name=Fl_Group.children>int Fl_Group::children() const</A></H4>
|
2001-11-29 22:24:00 +03:00
|
|
|
Returns how many child widgets the group has.
|
1999-01-13 22:28:54 +03:00
|
|
|
<H4><A name=Fl_Group.find>int Fl_Group::find(const Fl_Widget *w) const
|
|
|
|
<BR> int Fl_Group::find(const Fl_Widget &w) const</A></H4>
|
|
|
|
Searches the child array for the widget and returns the index. Returns <A
|
|
|
|
href=#Fl_Group.children><TT>children()</TT></A> if the widget is <TT>
|
2001-11-29 22:24:00 +03:00
|
|
|
NULL</TT> or not found.
|
2001-10-01 00:25:36 +04:00
|
|
|
<H4><A name=Fl_Group.resizable>void Fl_Group::resizable(Fl_Widget *box)
|
1999-01-13 22:28:54 +03:00
|
|
|
<BR> void Fl_Group::resizable(Fl_Widget &box)
|
|
|
|
<BR> Fl_Widget *Fl_Group::resizable() const</A></H4>
|
2001-11-29 22:24:00 +03:00
|
|
|
The resizable widget defines the resizing box for the group. When the
|
|
|
|
group is resized it calculates a new size and position for all of its
|
|
|
|
children. Widgets that are horizontally or vertically inside the
|
|
|
|
dimensions of the box are scaled to the new size. Widgets outside the
|
|
|
|
box are moved.
|
1999-01-13 22:28:54 +03:00
|
|
|
<P>In these examples the gray area is the resizable:
|
|
|
|
<BR></P>
|
2001-05-06 20:25:05 +04:00
|
|
|
<P align=center><IMG align=TOP SRC="resizebox1.gif" ALT="Resizeable groups">
|
|
|
|
<IMG align=TOP SRC="resizebox2.gif" ALT="Resizeable groups"></P>
|
2001-11-29 22:24:00 +03:00
|
|
|
<P>The resizable may be set to the group itself (this is the default
|
|
|
|
value for an <TT>Fl_Group</TT>, although <TT>NULL</TT> is the default
|
2007-10-07 13:43:10 +04:00
|
|
|
for <TT>Fl_Window</TT> and <TT>Fl_Pack</TT>), in which case all the
|
|
|
|
contents are resized.
|
2001-11-29 22:24:00 +03:00
|
|
|
If the resizable is <TT>NULL</TT> then all widgets remain a fixed size
|
1999-01-13 22:28:54 +03:00
|
|
|
and distance from the top-left corner. </P>
|
2001-11-29 22:24:00 +03:00
|
|
|
<P>It is possible to achieve any type of resize behavior by using an
|
|
|
|
invisible <TT>Fl_Box</TT> as the resizable and/or by using a hierarchy
|
1999-01-13 22:28:54 +03:00
|
|
|
of child <TT>Fl_Group</TT>'s. </P>
|
1999-01-27 11:45:11 +03:00
|
|
|
|
2001-11-29 22:24:00 +03:00
|
|
|
<H4><A name=Fl_Group.add_resizable>Fl_Group
|
1999-01-27 11:45:11 +03:00
|
|
|
&Fl_Group::add_resizable(Fl_Widget &box)</A></H4>
|
2001-11-29 22:24:00 +03:00
|
|
|
Adds a widget to the group and makes it the resizable widget.
|
2001-05-06 20:25:05 +04:00
|
|
|
</BODY></HTML>
|