mirror of
https://github.com/fltk/fltk.git
synced 2026-05-27 02:46:34 +08:00
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:
+4
-1
@@ -73,7 +73,6 @@ static void button_cb(Fl_Widget *, long val) {
|
|||||||
|
|
||||||
static Fl_Window *makeform() {
|
static Fl_Window *makeform() {
|
||||||
if (message_form) {
|
if (message_form) {
|
||||||
message_form->size(410,103);
|
|
||||||
return message_form;
|
return message_form;
|
||||||
}
|
}
|
||||||
// make sure that the dialog does not become the child of some
|
// 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;
|
int x, w, h, max_w, max_h;
|
||||||
const int icon_size = 50;
|
const int icon_size = 50;
|
||||||
|
|
||||||
|
message_form->size(410,103);
|
||||||
|
|
||||||
fl_font(message->labelfont(), message->labelsize());
|
fl_font(message->labelfont(), message->labelsize());
|
||||||
message_w = message_h = 0;
|
message_w = message_h = 0;
|
||||||
fl_measure(message->label(), message_w, message_h);
|
fl_measure(message->label(), message_w, message_h);
|
||||||
@@ -209,6 +210,7 @@ static int innards(const char* fmt, va_list ap,
|
|||||||
avoidRecursion = 1;
|
avoidRecursion = 1;
|
||||||
|
|
||||||
makeform();
|
makeform();
|
||||||
|
message_form->size(410,103);
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
if (!strcmp(fmt,"%s")) {
|
if (!strcmp(fmt,"%s")) {
|
||||||
message->label(va_arg(ap, const char*));
|
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,
|
static const char* input_innards(const char* fmt, va_list ap,
|
||||||
const char* defstr, uchar type) {
|
const char* defstr, uchar type) {
|
||||||
makeform();
|
makeform();
|
||||||
|
message_form->size(410,103);
|
||||||
message->position(60,10);
|
message->position(60,10);
|
||||||
input->type(type);
|
input->type(type);
|
||||||
input->show();
|
input->show();
|
||||||
|
|||||||
Reference in New Issue
Block a user