X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bc44d6257f74b7f815d4a44014717b21dc20fd5..f369c7c2841c0534424f2c184783c1a2070012cf:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index d89e8ede2c..1b66274cc1 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -185,8 +185,13 @@ bool wxDialog::Create(wxWindow *parent, #endif if ( HasFlag(wxRESIZE_BORDER) ) + { CreateGripper(); + Connect(wxEVT_CREATE, + wxWindowCreateEventHandler(wxDialog::OnWindowCreate)); + } + return true; } @@ -278,7 +283,7 @@ void wxDialog::Raise() // show dialog modally int wxDialog::ShowModal() { - wxASSERT_MSG( !IsModal(), _T("wxDialog::ShowModal() reentered?") ); + wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") ); m_endModalCalled = false; @@ -384,6 +389,11 @@ void wxDialog::DestroyGripper() { if ( m_hGripper ) { + // we used to have trouble with gripper appearing on top (and hence + // overdrawing) the other, real, dialog children -- check that this + // isn't the case automatically + wxASSERT_MSG( ::GetNextWindow((HWND)m_hGripper, GW_HWNDNEXT) == 0, + _T("Bug in wxWidgets: gripper should be at the bottom of Z-order") ); ::DestroyWindow((HWND) m_hGripper); m_hGripper = 0; } @@ -414,6 +424,19 @@ void wxDialog::ResizeGripper() SWP_NOACTIVATE); } +void wxDialog::OnWindowCreate(wxWindowCreateEvent& event) +{ + if ( m_hGripper && IsShown() && + event.GetWindow() && event.GetWindow()->GetParent() == this ) + { + // Put gripper below the newly created child window + ::SetWindowPos((HWND)m_hGripper, HWND_BOTTOM, 0, 0, 0, 0, + SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE); + } + + event.Skip(); +} + // ---------------------------------------------------------------------------- // wxWin event handlers // ----------------------------------------------------------------------------