diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-03-03 17:29:00 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-03-03 17:29:00 +0100 |
| commit | 3746b8986e106aaa2b64cd2b4e38e22e7ea35bf9 (patch) | |
| tree | 2d2cd2da8e5c553979e0d9034c9b78310b9ed480 /src/Fl_Pack.cxx | |
| parent | 0d7a9e7f371b8a5f10bddae6fd8276bba283a9cf (diff) | |
Clarify documentation of Fl_Pack
Diffstat (limited to 'src/Fl_Pack.cxx')
| -rw-r--r-- | src/Fl_Pack.cxx | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/Fl_Pack.cxx b/src/Fl_Pack.cxx index 55ad2c385..2907effee 100644 --- a/src/Fl_Pack.cxx +++ b/src/Fl_Pack.cxx @@ -3,17 +3,17 @@ // // Packing widget for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2010 by Bill Spitzak and others. +// Copyright 1998-2020 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this // file is missing or damaged, see the license at: // -// http://www.fltk.org/COPYING.php +// https://www.fltk.org/COPYING.php // // Please report all bugs and problems on the following page: // -// http://www.fltk.org/str.php +// https://www.fltk.org/str.php // // Based on code by Curtis Edwards @@ -27,16 +27,26 @@ /** Creates a new Fl_Pack widget using the given position, size, - and label string. The default boxtype is FL_NO_BOX. - <P>The destructor <I>also deletes all the children</I>. This allows a + and label string. + + The default boxtype is FL_NO_BOX. + + The default type() is Fl_Pack::VERTICAL. + + 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 - all the children in the user code. A kludge has been done so the - Fl_Pack and all of it's children can be automatic (local) - variables, but you must declare the Fl_Pack<I>first</I>, so + all the children in the user code. A kludge has been done so the + Fl_Pack and all of its children can be automatic (local) + variables, but you must declare the Fl_Pack <I>first</I>, so that it is destroyed last. + + \param[in] X,Y X and Y coordinates (position) + \param[in] W,H width and height, respectively + \param[in] L label (optional) + */ -Fl_Pack::Fl_Pack(int X, int Y, int W, int H,const char *l) -: Fl_Group(X, Y, W, H, l) { +Fl_Pack::Fl_Pack(int X, int Y, int W, int H, const char *L) +: Fl_Group(X, Y, W, H, L) { resizable(0); spacing_ = 0; // type(VERTICAL); // already set like this @@ -55,7 +65,7 @@ void Fl_Pack::draw() { if (horizontal()) { rw = -spacing_; rh = th; - + for (int i = children(); i--;) if (child(i)->visible()) { if (child(i) != this->resizable()) rw += child(i)->w(); @@ -64,7 +74,7 @@ void Fl_Pack::draw() { } else { rw = tw; rh = -spacing_; - + for (int i = children(); i--;) if (child(i)->visible()) { if (child(i) != this->resizable()) rh += child(i)->h(); @@ -116,7 +126,7 @@ void Fl_Pack::draw() { current_position += spacing_; } } - + if (horizontal()) { if (maximum_position < tx+tw && box()) { fl_color(color()); @@ -130,7 +140,7 @@ void Fl_Pack::draw() { } th = maximum_position-ty; } - + tw += Fl::box_dw(box()); if (tw <= 0) tw = 1; th += Fl::box_dh(box()); if (th <= 0) th = 1; if (tw != w() || th != h()) { |
