Patch #1197009 [wxMSW] Proper repainting when resizing

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-05-07 19:12:23 +00:00
parent 5ba5649b59
commit 3fca879ce0

View File

@@ -1555,7 +1555,7 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
HDWP hdwp = parent && !IsTopLevel() ? (HDWP)parent->m_hDWP : NULL; HDWP hdwp = parent && !IsTopLevel() ? (HDWP)parent->m_hDWP : NULL;
#else #else
HDWP hdwp = 0; HDWP hdwp = 0;
#endif #endif
wxMoveWindowDeferred(hdwp, this, GetHwnd(), x, y, width, height); wxMoveWindowDeferred(hdwp, this, GetHwnd(), x, y, width, height);
@@ -2310,6 +2310,31 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
break; break;
#endif // !__WXWINCE__ #endif // !__WXWINCE__
case WM_WINDOWPOSCHANGED:
{
WINDOWPOS *lpPos = (WINDOWPOS *)lParam;
if ( !(lpPos->flags & SWP_NOSIZE) )
{
RECT rc;
::GetClientRect(GetHwnd(), &rc);
AutoHRGN hrgnClient(::CreateRectRgnIndirect(&rc));
AutoHRGN hrgnNew(::CreateRectRgn(lpPos->x, lpPos->y,
lpPos->cx, lpPos->cy));
AutoHRGN hrgn(::CreateRectRgn(0, 0, 0, 0));
// we need to invalidate any new exposed areas here
// to force them to repaint
if ( ::CombineRgn(hrgn, hrgnNew, hrgnClient, RGN_DIFF) != NULLREGION )
::InvalidateRgn(GetHwnd(), hrgn, TRUE);
if ( ::CombineRgn(hrgn, hrgnClient, hrgnNew, RGN_DIFF) != NULLREGION )
::InvalidateRgn(GetHwnd(), hrgn, TRUE);
}
}
break;
#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
case WM_ACTIVATEAPP: case WM_ACTIVATEAPP:
// This implicitly sends a wxEVT_ACTIVATE_APP event // This implicitly sends a wxEVT_ACTIVATE_APP event
@@ -3511,7 +3536,7 @@ bool wxWindowMSW::HandleSetCursor(WXHWND WXUNUSED(hWnd),
if ( !::GetCursorPosWinCE(&pt)) if ( !::GetCursorPosWinCE(&pt))
#else #else
if ( !::GetCursorPos(&pt) ) if ( !::GetCursorPos(&pt) )
#endif #endif
{ {
wxLogLastError(wxT("GetCursorPos")); wxLogLastError(wxT("GetCursorPos"));
} }
@@ -4144,13 +4169,13 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
numChildren ++; numChildren ++;
} }
// Protect against valid m_hDWP being overwritten // Protect against valid m_hDWP being overwritten
bool useDefer = false; bool useDefer = false;
if ( numChildren > 1 ) if ( numChildren > 1 )
{ {
if (!m_hDWP) if (!m_hDWP)
{ {
m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren); m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
if ( !m_hDWP ) if ( !m_hDWP )
{ {
@@ -4203,7 +4228,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
// may have depending on what the users EVT_SIZE handler does...) // may have depending on what the users EVT_SIZE handler does...)
HDWP hDWP = (HDWP)m_hDWP; HDWP hDWP = (HDWP)m_hDWP;
m_hDWP = NULL; m_hDWP = NULL;
// do put all child controls in place at once // do put all child controls in place at once
if ( !::EndDeferWindowPos(hDWP) ) if ( !::EndDeferWindowPos(hDWP) )
{ {