Fix window resizing of common dialogs under certain rare conditions.

The modified test program test/ask.cxx showed a problem that the active
dialog window was resized when fl_message_icon() was called while it was
open, because this call makeform() which resized the window.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10806 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Albrecht Schlosser 2015-07-21 12:48:08 +00:00
parent 1763da6596
commit 6b491e3317
1 changed files with 4 additions and 1 deletions

View File

@ -73,7 +73,6 @@ static void button_cb(Fl_Widget *, long val) {
static Fl_Window *makeform() {
if (message_form) {
message_form->size(410,103);
return message_form;
}
// make sure that the dialog does not become the child of some
@ -134,6 +133,8 @@ static void resizeform() {
int x, w, h, max_w, max_h;
const int icon_size = 50;
message_form->size(410,103);
fl_font(message->labelfont(), message->labelsize());
message_w = message_h = 0;
fl_measure(message->label(), message_w, message_h);
@ -209,6 +210,7 @@ static int innards(const char* fmt, va_list ap,
avoidRecursion = 1;
makeform();
message_form->size(410,103);
char buffer[1024];
if (!strcmp(fmt,"%s")) {
message->label(va_arg(ap, const char*));
@ -469,6 +471,7 @@ Fl_Widget *fl_message_icon() {makeform(); return icon;}
static const char* input_innards(const char* fmt, va_list ap,
const char* defstr, uchar type) {
makeform();
message_form->size(410,103);
message->position(60,10);
input->type(type);
input->show();