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
This commit is contained in:
Michael R Sweet 2005-03-05 15:09:59 +00:00
parent 24b82a1cb0
commit 62721060db
3 changed files with 43 additions and 14 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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();
}