]> git.saurik.com Git - wxWidgets.git/commitdiff
changed wxWindow::Refresh() to refresh the window children as well (as wxGTK already...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 26 Mar 2005 16:32:48 +0000 (16:32 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 26 Mar 2005 16:32:48 +0000 (16:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
docs/latex/wx/window.tex
src/msw/window.cpp

index 54471363aa4fbc2fd21bb4e5b7b0f4a1072fc6d2..8de5a61572438c72caab93d7f039ff58dddcc8cb 100644 (file)
@@ -36,6 +36,7 @@ wxMSW:
 - Added "orient" parameter to wxMDIParentFrame::Tile()
 - wxTextCtrl with wxTE_RICH2 style now uses RichEdit 4.1 if available
 - fix handling Alt-key events in wxComboBox (reported by Joakim Roubert)
 - Added "orient" parameter to wxMDIParentFrame::Tile()
 - wxTextCtrl with wxTE_RICH2 style now uses RichEdit 4.1 if available
 - fix handling Alt-key events in wxComboBox (reported by Joakim Roubert)
+- wxWindow::Refresh() refreshes the window children as well
 
 wxGTK:
 
 
 wxGTK:
 
index 09f2f5d37b4f925e2611b8ca5288f674d6cb53a9..d7d90fd9f23f270fbef8839b0cbef958ec27900b 100644 (file)
@@ -2225,8 +2225,10 @@ or frame).
 \func{virtual void}{Refresh}{\param{bool}{ eraseBackground = {\tt true}}, \param{const wxRect* }{rect
 = NULL}}
 
 \func{virtual void}{Refresh}{\param{bool}{ eraseBackground = {\tt true}}, \param{const wxRect* }{rect
 = NULL}}
 
-Causes an event to be generated to repaint the
-window.
+Causes this window, and all of its children recursively, to be repainted. Note
+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}
 
@@ -3490,7 +3492,7 @@ This function is currently only implemented under MSW.
 Calling this method immediately repaints the invalidated area of the window
 while this would usually only happen when the flow of control returns to the
 event loop. Notice that this function doesn't refresh the window and does
 Calling this method immediately repaints the invalidated area of the window
 while this would usually only happen when the flow of control returns to the
 event loop. Notice that this function doesn't refresh the window and does
-nothing if the window hadn't been already repainted. Use
+nothing if the window hadn't been already repainted. Use 
 \helpref{Refresh}{wxwindowrefresh} first if you want to immediately redraw the
 window unconditionally.
 
 \helpref{Refresh}{wxwindowrefresh} first if you want to immediately redraw the
 window unconditionally.
 
index a2b52faf7a3e58c2a92b571ebfd968a902d46862..a17b0401d29e15b79db3bf669dff18bf5d3f0346 100644 (file)
@@ -1324,18 +1324,27 @@ void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)
     HWND hWnd = GetHwnd();
     if ( hWnd )
     {
     HWND hWnd = GetHwnd();
     if ( hWnd )
     {
+        RECT mswRect;
+        const RECT *pRect;
         if ( rect )
         {
         if ( rect )
         {
-            RECT mswRect;
             mswRect.left = rect->x;
             mswRect.top = rect->y;
             mswRect.right = rect->x + rect->width;
             mswRect.bottom = rect->y + rect->height;
 
             mswRect.left = rect->x;
             mswRect.top = rect->y;
             mswRect.right = rect->x + rect->width;
             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);
     }
 }
 
     }
 }