]> git.saurik.com Git - wxWidgets.git/commitdiff
Added handler for WM_PRINT to assist with offscreen drawing of widgets
authorRobin Dunn <robin@alldunn.com>
Mon, 1 Sep 2003 19:56:28 +0000 (19:56 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 1 Sep 2003 19:56:28 +0000 (19:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23353 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index e49dbd008268eda5fe67e22c7e9d751a5e4fbabc..85bce15966991835dbd4f9dfa079836daf0b21d8 100644 (file)
@@ -91,6 +91,7 @@
 
 #include "wx/textctrl.h"
 #include "wx/notebook.h"
+#include "wx/listctrl.h"
 
 #include <string.h>
 
@@ -265,7 +266,7 @@ WX_BEGIN_FLAGS( wxWindowStyle )
     WX_FLAGS_MEMBER(wxBORDER_RAISED)
     WX_FLAGS_MEMBER(wxBORDER_STATIC)
     WX_FLAGS_MEMBER(wxBORDER_NONE)
-    
+
     // old style border flags
     WX_FLAGS_MEMBER(wxSIMPLE_BORDER)
     WX_FLAGS_MEMBER(wxSUNKEN_BORDER)
@@ -2319,6 +2320,20 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
                 break;
             }
 
+        case WM_PRINT:
+            {
+                // Don't call the wx handlers in this case
+                if ( wxIsKindOf(this, wxListCtrl) )
+                    break;
+
+                if ( lParam & PRF_ERASEBKGND )
+                    HandleEraseBkgnd((WXHDC)(HDC)wParam);
+
+                wxPaintDCEx dc((wxWindow *)this, (WXHDC)wParam);
+                processed = HandlePaint();
+            }
+            break;
+
         case WM_CLOSE:
 #ifdef __WXUNIVERSAL__
             // Universal uses its own wxFrame/wxDialog, so we don't receive