changed wxWindow::Refresh() to refresh the window children as well (as wxGTK already did); documented this as correct behaviour

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2005-03-26 16:32:48 +00:00
parent 3601f639a5
commit d181e05329
3 changed files with 18 additions and 6 deletions

View File

@@ -36,6 +36,7 @@ wxMSW:
- Added "orient" parameter to wxMDIParentFrame::Tile() - Added "orient" parameter to wxMDIParentFrame::Tile()
- wxTextCtrl with wxTE_RICH2 style now uses RichEdit 4.1 if available - wxTextCtrl with wxTE_RICH2 style now uses RichEdit 4.1 if available
- fix handling Alt-key events in wxComboBox (reported by Joakim Roubert) - fix handling Alt-key events in wxComboBox (reported by Joakim Roubert)
- wxWindow::Refresh() refreshes the window children as well
wxGTK: wxGTK:

View File

@@ -2225,8 +2225,10 @@ or frame).
\func{virtual void}{Refresh}{\param{bool}{ eraseBackground = {\tt true}}, \param{const wxRect* }{rect \func{virtual void}{Refresh}{\param{bool}{ eraseBackground = {\tt true}}, \param{const wxRect* }{rect
= NULL}} = NULL}}
Causes an event to be generated to repaint the Causes this window, and all of its children recursively, to be repainted. Note
window. that repainting doesn't happen immediately but only during the next event loop
iteration, if you need to update the window immediately you should use
\helpref{Update}{wxwindowupdate} instead.
\wxheading{Parameters} \wxheading{Parameters}

View File

@@ -1324,18 +1324,27 @@ void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)
HWND hWnd = GetHwnd(); HWND hWnd = GetHwnd();
if ( hWnd ) if ( hWnd )
{ {
RECT mswRect;
const RECT *pRect;
if ( rect ) if ( rect )
{ {
RECT mswRect;
mswRect.left = rect->x; mswRect.left = rect->x;
mswRect.top = rect->y; mswRect.top = rect->y;
mswRect.right = rect->x + rect->width; mswRect.right = rect->x + rect->width;
mswRect.bottom = rect->y + rect->height; mswRect.bottom = rect->y + rect->height;
::InvalidateRect(hWnd, &mswRect, eraseBack); pRect = &mswRect;
} }
else else
::InvalidateRect(hWnd, NULL, eraseBack); {
pRect = NULL;
}
UINT flags = RDW_INVALIDATE | RDW_ALLCHILDREN;
if ( eraseBack )
flags |= RDW_ERASE;
::RedrawWindow(hWnd, pRect, NULL, flags);
} }
} }