mirror of
https://github.com/fltk/fltk.git
synced 2026-05-28 11:25:22 +08:00
Allow any child widget to be resizable in Fl_Pack.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1875 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
CHANGES IN FLTK 1.1.0b8
|
CHANGES IN FLTK 1.1.0b8
|
||||||
|
|
||||||
|
- Fl_Pack now allows any child widget to be the
|
||||||
|
resizable() widget, not just the last one.
|
||||||
- MacOS: opaque window resizing, all events except
|
- MacOS: opaque window resizing, all events except
|
||||||
Mac menus are now handled using Carbon, window
|
Mac menus are now handled using Carbon, window
|
||||||
activation fixed, GL_SWAP_TYPE default changed to
|
activation fixed, GL_SWAP_TYPE default changed to
|
||||||
|
|||||||
+24
-4
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// "$Id: Fl_Pack.cxx,v 1.6.2.4 2001/01/22 15:13:40 easysw Exp $"
|
// "$Id: Fl_Pack.cxx,v 1.6.2.4.2.1 2001/12/19 15:49:39 easysw Exp $"
|
||||||
//
|
//
|
||||||
// Packing widget for the Fast Light Tool Kit (FLTK).
|
// Packing widget for the Fast Light Tool Kit (FLTK).
|
||||||
//
|
//
|
||||||
@@ -44,10 +44,30 @@ void Fl_Pack::draw() {
|
|||||||
int ty = y()+Fl::box_dy(box());
|
int ty = y()+Fl::box_dy(box());
|
||||||
int tw = w()-Fl::box_dw(box());
|
int tw = w()-Fl::box_dw(box());
|
||||||
int th = h()-Fl::box_dh(box());
|
int th = h()-Fl::box_dh(box());
|
||||||
|
int rw, rh;
|
||||||
int current_position = horizontal() ? tx : ty;
|
int current_position = horizontal() ? tx : ty;
|
||||||
int maximum_position = current_position;
|
int maximum_position = current_position;
|
||||||
uchar d = damage();
|
uchar d = damage();
|
||||||
Fl_Widget*const* a = array();
|
Fl_Widget*const* a = array();
|
||||||
|
if (horizontal()) {
|
||||||
|
rw = -spacing_;
|
||||||
|
rh = th;
|
||||||
|
|
||||||
|
for (int i = children(); i--;)
|
||||||
|
if (child(i)->visible()) {
|
||||||
|
if (child(i) != this->resizable()) rw += child(i)->w();
|
||||||
|
rw += spacing_;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
rw = tw;
|
||||||
|
rh = -spacing_;
|
||||||
|
|
||||||
|
for (int i = children(); i--;)
|
||||||
|
if (child(i)->visible()) {
|
||||||
|
if (child(i) != this->resizable()) rh += child(i)->h();
|
||||||
|
rh += spacing_;
|
||||||
|
}
|
||||||
|
}
|
||||||
for (int i = children(); i--;) {
|
for (int i = children(); i--;) {
|
||||||
Fl_Widget* o = *a++;
|
Fl_Widget* o = *a++;
|
||||||
if (o->visible()) {
|
if (o->visible()) {
|
||||||
@@ -66,9 +86,9 @@ void Fl_Pack::draw() {
|
|||||||
// Last child, if resizable, takes all remaining room
|
// Last child, if resizable, takes all remaining room
|
||||||
if(i == 0 && o == this->resizable()) {
|
if(i == 0 && o == this->resizable()) {
|
||||||
if(horizontal())
|
if(horizontal())
|
||||||
W = this->w() - Fl::box_dw(box()) - maximum_position;
|
W = tw - rw;
|
||||||
else
|
else
|
||||||
H = this->h() - Fl::box_dh(box()) - maximum_position;
|
H = th - rh;
|
||||||
}
|
}
|
||||||
if (spacing_ && current_position>maximum_position &&
|
if (spacing_ && current_position>maximum_position &&
|
||||||
(X != o->x() || Y != o->y() || d&FL_DAMAGE_ALL)) {
|
(X != o->x() || Y != o->y() || d&FL_DAMAGE_ALL)) {
|
||||||
@@ -112,5 +132,5 @@ void Fl_Pack::draw() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of "$Id: Fl_Pack.cxx,v 1.6.2.4 2001/01/22 15:13:40 easysw Exp $".
|
// End of "$Id: Fl_Pack.cxx,v 1.6.2.4.2.1 2001/12/19 15:49:39 easysw Exp $".
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user