summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-03-05 15:09:59 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-03-05 15:09:59 +0000
commit62721060db3886cf627c826ba37627de51be8b48 (patch)
tree420b7c711e3cc706b54445776d5ab90c72443b67
parent24b82a1cb0a3fecc0c3661ba40831b2ce74cf3a6 (diff)
Using the layout alignment controls on a menu widget would cause
FLUID to crash (STR #742) The Fl_Input_Choice documentation was not installed (STR #745) documentation/Makefile: - Add Fl_Input_Choice.html to list of doco files. fluid/align_widget.cxx: - Only do a full resize if the widget is not a menu button. - Also set modflag when making changes. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4060 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES4
-rw-r--r--documentation/Makefile1
-rw-r--r--fluid/align_widget.cxx52
3 files changed, 43 insertions, 14 deletions
diff --git a/CHANGES b/CHANGES
index ff748d2fb..321f8cf0c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
CHANGES IN FLTK 1.1.7
- - Documentation fixes (STR #648, STR #692)
+ - Documentation fixes (STR #648, STR #692, STR #745)
+ - Using the layout alignment controls on a menu widget
+ would cause FLUID to crash (STR #742)
- Added QNX bug workaround for menu handling (STR #704)
- Added Greg Ercolano's simple Fl_Input_Choice widget
which is a combination of the Fl_Input and
diff --git a/documentation/Makefile b/documentation/Makefile
index 48e90c28f..a8434510a 100644
--- a/documentation/Makefile
+++ b/documentation/Makefile
@@ -86,6 +86,7 @@ HTMLFILES = \
Fl_Image.html \
Fl_Input.html \
Fl_Input_.html \
+ Fl_Input_Choice.html \
Fl_Int_Input.html \
Fl_JPEG_Image.html \
Fl_Light_Button.html \
diff --git a/fluid/align_widget.cxx b/fluid/align_widget.cxx
index a4cd7be56..07dcc910f 100644
--- a/fluid/align_widget.cxx
+++ b/fluid/align_widget.cxx
@@ -57,13 +57,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize(left, w->y(), w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize(left, w->y(), w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -87,13 +89,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize((center2-w->w())/2, w->y(), w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -114,13 +118,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize(right-w->w(), w->y(), w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize(right-w->w(), w->y(), w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -140,13 +146,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize(w->x(), top, w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize(w->x(), top, w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -170,13 +178,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize(w->x(), (center2-w->h())/2, w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -197,13 +207,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize( w->x(), bot-w->h(), w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize( w->x(), bot-w->h(), w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -231,13 +243,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize(left+wsum+wdt*cnt/n, w->y(), w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
cnt++;
@@ -267,13 +281,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize(w->x(), top+hsum+hgt*cnt/n, w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
cnt++;
@@ -297,13 +313,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize(w->x(), w->y(), wdt, w->h());
} else {
// Otherwise, just do the widget...
w->resize(w->x(), w->y(), wdt, w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -323,13 +341,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize( w->x(), w->y(), w->w(), hgt);
} else {
// Otherwise, just do the widget...
w->resize( w->x(), w->y(), w->w(), hgt);
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -351,13 +371,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (o->selected && o->is_widget())
{
Fl_Widget *w = ((Fl_Widget_Type *)o)->o;
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize( w->x(), w->y(), wdt, hgt);
} else {
// Otherwise, just do the widget...
w->resize( w->x(), w->y(), wdt, hgt);
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -374,13 +396,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (w->window() == p) center2 = p->w();
else center2 = 2*p->x()+p->w();
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button() && !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize((center2-w->w())/2, w->y(), w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize((center2-w->w())/2, w->y(), w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}
@@ -396,13 +420,15 @@ void align_widget_cb(Fl_Widget*, long how)
if (w->window() == p) center2 = p->h();
else center2 = 2*p->y()+p->h();
- if (o->next && o->next->level > o->level && !o->next->selected) {
+ if (o->next && o->next->level > o->level && !o->next->selected &&
+ !o->is_menu_button()) {
// When resizing a group, make sure we also move the children...
((igroup *)w)->full_resize(w->x(), (center2-w->h())/2, w->w(), w->h());
} else {
// Otherwise, just do the widget...
w->resize(w->x(), (center2-w->h())/2, w->w(), w->h());
}
+ modflag=1;
w->redraw();
if (w->window()) w->window()->redraw();
}