Opened 7 years ago

Closed 6 years ago

#4664 closed defect (fixed)

wxProgressDialog uses unsupported/undefined functionality

Reported by: hwiesmann Owned by:
Priority: normal Milestone:
Component: GUI-all Version:
Keywords: wxProgressDialog Cc: hwiesmann
Blocked By: Blocking:
Patch: no

Description

wxProgressDialog switches from a modeless to a modal dialog when the gauge's final value is reached and AUTO_HIDE flag is not used. According to the reply to bug #1890779 switching from modeless to modal dialogs is not supported.

Solution: if the progress dialog reaches its final value another dialog pops up to announce that the action(s) has/have finished.
BTW: this looks pretty ugly but I do not know any alternatives.

Hartwig

Change History (6)

comment:1 Changed 7 years ago by vadz

I must be missing something obvious but I wonder why isn't the dialog modal from the very beginning...

comment:2 Changed 7 years ago by hwiesmann

Because then you have to call wxDialog::ShowModal and wait till it ends. There is no way to update the gauge or the dialog's message during a call of wxDialog::ShowModal. Furthermore, if you set the flag "AUTO_HIDE" the dialog should disappear automatically (without having pressed a button).
Therefore, showing first only the dialog and react on button clicks makes perfectly sense. When the gauge has reached its final value the dialog should be converted to a modal dialog.

Hartwig

comment:3 Changed 7 years ago by vadz

I was indeed missing something obvious, thanks for pointing it out.

And this probably means that I was wrong when I closed your previous bug report too as I don't see how can we implement this behaviour otherwise. So we probably should close this bug report but fix the other one and document that ShowModal() can be called for an existing modeless dialog. Unless somebody has better idea(s)?

comment:4 Changed 7 years ago by hwiesmann

Actually, I would prefer to leave it as it is and reactivate wxDialog::SetModal(). From my point of view it makes more sense because the dialog is already shown but only the status is changed. But this is just a matter of taste.
Nevertheless, in the documentation of SetModal() is mentioned that switching from modeless to modal dialogs or vice versa does not work for all ports. But which ones??
I implemented it on Mac OSX and there it worked.

Hartwig

comment:5 Changed 7 years ago by wojdyr

  • Component set to GUI-all
  • Keywords wxProgressDialog added

comment:6 Changed 6 years ago by vadz

  • Cc vadz removed
  • Resolution set to fixed
  • Status changed from new to closed

Ok, I've documented ShowModal() as working after Show() and applied your patch from #4658 for wxMac in r54328, let's see if this creates problems for any ports.

Thanks!

Note: See TracTickets for help on using tickets.