X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8c7f5f031b3c5d7881460ae5aed3e71d067592ac..2659dad3209167f248dcae39a7ee25d2f8c91ff9:/src/msw/dialog.cpp?ds=sidebyside diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index a2505b168d..9563732e25 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -170,11 +170,10 @@ wxDEFINE_TIED_SCOPED_PTR_TYPE(wxDialogModalData); void wxDialog::Init() { m_oldFocus = (wxWindow *)NULL; - m_isShown = FALSE; - m_modalData = NULL; - + m_endModalCalled = FALSE; + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); } @@ -198,8 +197,8 @@ bool wxDialog::Create(wxWindow *parent, if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) return FALSE; - - SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); + if (!m_hasFont) + SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); return TRUE; } @@ -369,7 +368,10 @@ bool wxDialog::Show(bool show) InitDialog(); } - if ( show && IsModal() ) + // EndModal may have been called from InitDialog handler, + // which would cause an infinite loop if we didn't take it + // into account + if ( show && IsModal() && !m_endModalCalled ) { // modal dialog needs a parent window, so try to find one if ( !GetParent() ) @@ -391,6 +393,7 @@ void wxDialog::Raise() // a special version for Show(TRUE) for modal dialogs which returns return code int wxDialog::ShowModal() { + m_endModalCalled = FALSE; if ( !IsModal() ) { SetModal(TRUE); @@ -405,6 +408,7 @@ int wxDialog::ShowModal() // dialogs and should work for both of them void wxDialog::EndModal(int retCode) { + m_endModalCalled = TRUE; SetReturnCode(retCode); Show(FALSE); @@ -502,7 +506,7 @@ long wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) // creates flicker but at least doesn't show garbage on the screen rc = wxWindow::MSWWindowProc(message, wParam, lParam); processed = TRUE; - if ( !HasFlag(wxNO_FULL_REPAINT_ON_RESIZE) ) + if ( HasFlag(wxFULL_REPAINT_ON_RESIZE) ) { ::InvalidateRect(GetHwnd(), NULL, FALSE /* erase bg */); }