Create temporary wxEventLoop in wxGenericProgressDialog if needed.

wxGenericProgressDialog needs to have an active event loop in order to repaint
itself and process clicks on its buttons but it's more helpful to create a
temporary event loop if there is no currently active one instead of just
asserting. In particular, this allows to use wxProgressDialog from overridden
wxApp::OnInit().

Add temporary event loop creation and remove the now unnecessary asserts
verifying that there is an active event loop as there always will be one.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65499 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-09-10 11:44:46 +00:00
parent 79e58a409e
commit 7ad8a38ae5
2 changed files with 24 additions and 12 deletions

View File

@@ -15,6 +15,7 @@
#include "wx/dialog.h"
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxEventLoop;
class WXDLLIMPEXP_FWD_CORE wxGauge;
class WXDLLIMPEXP_FWD_CORE wxStaticText;
class WXDLLIMPEXP_FWD_CORE wxWindowDisabler;
@@ -197,6 +198,11 @@ private:
// for wxPD_APP_MODAL case
wxWindowDisabler *m_winDisabler;
// Temporary event loop created by the dialog itself if there is no
// currently active loop when it is created.
wxEventLoop *m_tempEventLoop;
DECLARE_EVENT_TABLE()
wxDECLARE_NO_COPY_CLASS(wxGenericProgressDialog);
};