Browse Source

Fixed typos and amended doxygen docs.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6573 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
pull/49/head
Albrecht Schlosser 17 years ago
parent
commit
c23538ef54
  1. 65
      src/Fl_Group.cxx

65
src/Fl_Group.cxx

@ -41,6 +41,7 @@ Fl_Group* Fl_Group::current_;
// Hack: A single child is stored in the pointer to the array, while // Hack: A single child is stored in the pointer to the array, while
// multiple children are stored in an allocated array: // multiple children are stored in an allocated array:
/** /**
Returns a pointer to the array of children. <I>This pointer is only 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> valid until the next time a child is added or removed.</I>
@ -50,8 +51,8 @@ Fl_Widget*const* Fl_Group::array() const {
} }
/** /**
Searches the child array for the widget and returns the index. Returns children() if the widget is Searches the child array for the widget and returns the index. Returns children()
NULL or not found. if the widget is NULL or not found.
*/ */
int Fl_Group::find(const Fl_Widget* o) const { int Fl_Group::find(const Fl_Widget* o) const {
Fl_Widget*const* a = array(); Fl_Widget*const* a = array();
@ -61,25 +62,32 @@ int Fl_Group::find(const Fl_Widget* o) const {
// Metrowerks CodeWarrior and others can't export the static // Metrowerks CodeWarrior and others can't export the static
// class member: current_, so these methods can't be inlined... // class member: current_, so these methods can't be inlined...
/** /**
Sets the current group so you can build the widget Sets the current group so you can build the widget
tree by just constructing the widgets. begin() is tree by just constructing the widgets.
automatically called by the constructor for Fl_Group (and thus for
Fl_Window as well). begin() <i>is exactly the same as</i> current(this). begin() is automatically called by the constructor for Fl_Group (and thus for
<P><I>Don't forget to end() the group or window!</I> Fl_Window as well). begin() <I>is exactly the same as</I> current(this).
<I>Don't forget to end() the group or window!</I>
*/ */
void Fl_Group::begin() {current_ = this;} void Fl_Group::begin() {current_ = this;}
/** /**
<i>Exactly the same as</i> current(this-&gt;parent()). Any new widgets <I>Exactly the same as</I> current(this->parent()). Any new widgets
added to the widget tree will be added to the parent of the group. added to the widget tree will be added to the parent of the group.
*/ */
void Fl_Group::end() {current_ = (Fl_Group*)parent();} void Fl_Group::end() {current_ = (Fl_Group*)parent();}
/** /**
Returns the currently active group. The Fl_Widget Returns the currently active group.
constructor automatically does current()-&gt;add(widget) if this is not null.
To prevent new widgets from being added to a group, call Fl_Group::current(0). The Fl_Widget constructor automatically does current()->add(widget) if this
is not null. To prevent new widgets from being added to a group, call
Fl_Group::current(0).
*/ */
Fl_Group *Fl_Group::current() {return current_;} Fl_Group *Fl_Group::current() {return current_;}
/** /**
See static Fl_Group *Fl_Group::current() See static Fl_Group *Fl_Group::current()
*/ */
@ -369,10 +377,9 @@ Fl_Group::Fl_Group(int X,int Y,int W,int H,const char *l)
} }
/** /**
The clear() method deletes all child widgets from Deletes all child widgets from memory recursively.</p>
memory recursively.</p>
<p>This method differs from the remove() method in that it This method differs from the remove() method in that it
affects all child widgets and deletes them from memory. affects all child widgets and deletes them from memory.
*/ */
void Fl_Group::clear() { void Fl_Group::clear() {
@ -406,9 +413,9 @@ Fl_Group::~Fl_Group() {
} }
/** /**
The widget is removed from it's current group (if any) and then The widget is removed from its current group (if any) and then
inserted into this group. It is put at index n (or at the end inserted into this group. It is put at index n (or at the end
if n &gt;= children(). This can also be used to rearrange if n >= children(). This can also be used to rearrange
the widgets inside a group. the widgets inside a group.
*/ */
void Fl_Group::insert(Fl_Widget &o, int index) { void Fl_Group::insert(Fl_Widget &o, int index) {
@ -441,19 +448,18 @@ void Fl_Group::insert(Fl_Widget &o, int index) {
} }
/** /**
The widget is removed from it's current group (if any) and then added The widget is removed from its current group (if any) and then added
to the end of this group. to the end of this group.
*/ */
void Fl_Group::add(Fl_Widget &o) {insert(o, children_);} void Fl_Group::add(Fl_Widget &o) {insert(o, children_);}
/** /**
Removes a widget from the group but does not delete it. This Removes a widget from the group but does not delete it.
method does nothing if the widget is not a child of the
group. This method does nothing if the widget is not a child of the group.
<p>This method differs from the clear() method in that it This method differs from the clear() method in that it only affects
only affects a single widget and does not delete it from a single widget and does not delete it from memory.
memory.
*/ */
void Fl_Group::remove(Fl_Widget &o) { void Fl_Group::remove(Fl_Widget &o) {
if (!children_) return; if (!children_) return;
@ -486,7 +492,7 @@ void Fl_Group::remove(Fl_Widget &o) {
// also uses this array! // also uses this array!
/** /**
This resets the internal array of widget sizes and positions. Resets the internal array of widget sizes and positions.
The Fl_Group widget keeps track of the original widget sizes and The Fl_Group widget keeps track of the original widget sizes and
positions when resizing occurs so that if you resize a window back to its positions when resizing occurs so that if you resize a window back to its
@ -506,7 +512,7 @@ void Fl_Group::init_sizes() {
} }
/** /**
This returns the internal array of widget sizes and positions. Returns the internal array of widget sizes and positions.
If the sizes() array does not exist, it will be allocated and filled If the sizes() array does not exist, it will be allocated and filled
with the current widget sizes and positions. with the current widget sizes and positions.
@ -515,7 +521,7 @@ void Fl_Group::init_sizes() {
special needs to rearrange the children of a Fl_Group. Fl_Tile uses special needs to rearrange the children of a Fl_Group. Fl_Tile uses
this to rearrange its widget positions. this to rearrange its widget positions.
\todo should the internal representation of the sizes() array be documented? \todo Should the internal representation of the sizes() array be documented?
*/ */
int* Fl_Group::sizes() { int* Fl_Group::sizes() {
if (!sizes_) { if (!sizes_) {
@ -549,8 +555,9 @@ int* Fl_Group::sizes() {
} }
return sizes_; return sizes_;
} }
/** /**
This resizes the Fl_Group widget and all of its children. Resizes the Fl_Group widget and all of its children.
The Fl_Group widget first resizes itself, and then it moves and resizes The Fl_Group widget first resizes itself, and then it moves and resizes
all its children according to the rules documented for all its children according to the rules documented for
@ -635,7 +642,7 @@ void Fl_Group::resize(int X, int Y, int W, int H) {
} }
/** /**
This draws all children of the group. Draws all children of the group.
This is useful, if you derived a widget from Fl_Group and want to draw a special This is useful, if you derived a widget from Fl_Group and want to draw a special
border or background. You can call draw_children() from the derived draw() method border or background. You can call draw_children() from the derived draw() method
@ -674,6 +681,7 @@ void Fl_Group::draw() {
/** /**
Draws a child only if it needs it. Draws a child only if it needs it.
This draws a child widget, if it is not clipped \em and if any damage() bits This draws a child widget, if it is not clipped \em and if any damage() bits
are set. The damage bits are cleared after drawing. are set. The damage bits are cleared after drawing.
@ -687,8 +695,9 @@ void Fl_Group::update_child(Fl_Widget& widget) const {
} }
} }
/**
Forces a child to redraw.
/** Forces a child to redraw.
This draws a child widget, if it is not clipped. This draws a child widget, if it is not clipped.
The damage bits are cleared after drawing. The damage bits are cleared after drawing.
*/ */

Loading…
Cancel
Save