From f73f67bee47491d3cd61cecff323074e328c5a1e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 6 Apr 2002 22:31:07 +0000 Subject: [PATCH] refresh the dialogs after resize - this is the only way to deal with the display corruption problem git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dialog.cpp | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index d528829c9d..7fe3bd5c0f 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -405,41 +405,27 @@ long wxDialog::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) switch ( message ) { -#if 0 // now that we got owner window right it doesn't seem to be needed - case WM_ACTIVATE: - switch ( LOWORD(wParam) ) - { - case WA_ACTIVE: - case WA_CLICKACTIVE: - if ( IsModalShowing() && GetParent() ) - { - // bring the owner window to top as the standard dialog - // boxes do - if ( !::SetWindowPos - ( - GetHwndOf(GetParent()), - GetHwnd(), - 0, 0, - 0, 0, - SWP_NOACTIVATE | - SWP_NOMOVE | - SWP_NOSIZE - ) ) - { - wxLogLastError(wxT("SetWindowPos(SWP_NOACTIVATE)")); - } - } - // fall through to process it normally as well - } - break; -#endif // 0 - case WM_CLOSE: // if we can't close, tell the system that we processed the // message - otherwise it would close us processed = !Close(); break; + case WM_SIZE: + // the Windows dialogs unfortunately are not meant to be resizeable + // at all and their standard class doesn't include CS_[VH]REDRAW + // styles which means that the window is not refreshed properly + // after the resize and no amount of WS_CLIPCHILDREN/SIBLINGS can + // help with it - so we have to refresh it manually which certainly + // 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) ) + { + Refresh(); + } + break; + #ifndef __WXMICROWIN__ case WM_SETCURSOR: // we want to override the busy cursor for modal dialogs: -- 2.45.2