diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 1999-01-04 19:25:40 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 1999-01-04 19:25:40 +0000 |
| commit | b95db33f2cbd30213cadd4859f567e1dae32ef47 (patch) | |
| tree | a28848521b20e06870490ebacf7bd22e3aa6dedc /src/Fl_Pack.cxx | |
| parent | ea2cbbd5530915c508e86fed9a437adb0b2149f8 (diff) | |
Lots of changes:
- Added #defines for Visual C++ to speed up compiles.
- Added FLTK.DLL project to visualc directory.
- Added editor project to visualc directory.
- Added icon() method to Fl_Window class.
- Implemented xclass() method for WIN32.
- Fixed extern declaration of fl_send_extra_move in Fl_Menu_Window.cxx.
- scandir_win32.c needed to include <stdlib.h>.
- Added fix from Bill for fl_width() bug.
- Updated fix for Fl_Input to default to FL_DOWN_BOX.
- Added visible() check for children of Fl_Pack.
- Added WinMain() function to library.
- Now show console window in debug mode.
- Fixed demo.menu and demo.cxx to work under WIN32.
git-svn-id: file:///fltk/svn/fltk/trunk@180 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Pack.cxx')
| -rw-r--r-- | src/Fl_Pack.cxx | 66 |
1 files changed, 35 insertions, 31 deletions
diff --git a/src/Fl_Pack.cxx b/src/Fl_Pack.cxx index 6ee605d6b..e5717c1c5 100644 --- a/src/Fl_Pack.cxx +++ b/src/Fl_Pack.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Pack.cxx,v 1.4 1998/10/21 14:20:16 mike Exp $" +// "$Id: Fl_Pack.cxx,v 1.5 1999/01/04 19:25:01 mike Exp $" // // Packing widget for the Fast Light Tool Kit (FLTK). // @@ -50,37 +50,40 @@ void Fl_Pack::draw() { Fl_Widget*const* a = array(); for (int i = children(); i--;) { Fl_Widget* o = *a++; - int X,Y,W,H; - if (horizontal()) { - X = current_position; - W = o->w(); - Y = ty; - H = th; - } else { - X = tx; - W = tw; - Y = current_position; - H = o->h(); + if (o->visible()) { + int X,Y,W,H; + if (horizontal()) { + X = current_position; + W = o->w(); + Y = ty; + H = th; + } else { + X = tx; + W = tw; + Y = current_position; + H = o->h(); + } + if (spacing_ && current_position>maximum_position && + (X != o->x() || Y != o->y() || d&FL_DAMAGE_ALL)) { + fl_color(color()); + if (horizontal()) + fl_rectf(maximum_position, ty, spacing_, th); + else + fl_rectf(tx, maximum_position, tw, spacing_); + } + if (X != o->x() || Y != o->y() || W != o->w() || H != o->h()) { + o->resize(X,Y,W,H); + o->clear_damage(FL_DAMAGE_ALL); + } + if (d&FL_DAMAGE_ALL) draw_child(*o); else update_child(*o); + // child's draw() can change it's size, so use new size: + current_position += (horizontal() ? o->w() : o->h()); + if (current_position > maximum_position) + maximum_position = current_position; + current_position += spacing_; } - if (spacing_ && current_position>maximum_position && - (X != o->x() || Y != o->y() || d&FL_DAMAGE_ALL)) { - fl_color(color()); - if (horizontal()) - fl_rectf(maximum_position, ty, spacing_, th); - else - fl_rectf(tx, maximum_position, tw, spacing_); - } - if (X != o->x() || Y != o->y() || W != o->w() || H != o->h()) { - o->resize(X,Y,W,H); - o->clear_damage(FL_DAMAGE_ALL); - } - if (d&FL_DAMAGE_ALL) draw_child(*o); else update_child(*o); - // child's draw() can change it's size, so use new size: - current_position += (horizontal() ? o->w() : o->h()); - if (current_position > maximum_position) - maximum_position = current_position; - current_position += spacing_; } + if (horizontal()) { if (maximum_position < tx+tw) { fl_color(color()); @@ -94,6 +97,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()) {Fl_Widget::resize(x(),y(),tw,th); d = FL_DAMAGE_ALL;} @@ -101,5 +105,5 @@ void Fl_Pack::draw() { } // -// End of "$Id: Fl_Pack.cxx,v 1.4 1998/10/21 14:20:16 mike Exp $". +// End of "$Id: Fl_Pack.cxx,v 1.5 1999/01/04 19:25:01 mike Exp $". // |
