]> git.saurik.com Git - wxWidgets.git/commitdiff
wxNO_FULL_REPAINT_ON_RESIZE logic for wxMSW
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 27 Jul 1999 15:15:36 +0000 (15:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 27 Jul 1999 15:15:36 +0000 (15:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/defs.h
src/motif/app.cpp
src/motif/menu.cpp
src/msw/app.cpp
src/msw/window.cpp

index 38d1da52e225c02f1cb07ac84a4a744b205f2262..302766b90a46eb212fa4a848e4a81db6402a7e78 100644 (file)
@@ -588,7 +588,7 @@ enum
 
 // don't invalidate the whole window (resulting in a PAINT event) when the
 // window is resized (currently, makes sense for wxMSW only)
-#define wxNO_FULLREPAINT_ON_RESIZE 0x00010000
+#define wxNO_FULL_REPAINT_ON_RESIZE 0x00010000
 /*
  * wxFrame/wxDialog style flags
  */
index 2e37fb6e74a4ea95394b55dcac547f5ab4bdc97e..8845b9782f03a676015d85228e9bd8c33bd8beda 100644 (file)
@@ -654,8 +654,7 @@ bool wxApp::CheckForKeyDown(WXEvent* event)
       wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
       wxTranslateKeyEvent(keyEvent, win, (Widget) 0, xEvent);
 
-      win->ProcessEvent( keyEvent );
-      return (keyEvent.GetSkipped() != TRUE);
+      return win->ProcessEvent( keyEvent );
     }
 
     return FALSE;
index cc88c9806edc430d8e4526eb367b825472a3bfe1..ed12ce6732e24f0343b8bedfcc6880987d577b20 100644 (file)
@@ -916,7 +916,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topM
 #else
             xmCascadeButtonWidgetClass, (Widget) parent,
 #endif
-            XmNlabelString, label_str,
+            XmNlabelString, label_str(),
             XmNsubMenuId, menu,
             NULL);
 
index 359863bcc2da4915d100b87dcb209066e3bdea69..35c8510c4872d2a90d8b21b30ef9ed8e0907407d 100644 (file)
@@ -108,9 +108,15 @@ MSG s_currentMsg;
 wxApp *wxTheApp = NULL;
 
 // FIXME why not const? and not static?
+
+// NB: all "NoRedraw" classes must have the same names as the "normal" classes
+//     with NR suffix - wxWindow::MSWCreate() supposes this
 wxChar wxFrameClassName[]         = _T("wxFrameClass");
+wxChar wxFrameClassNameNoRedraw[] = _T("wxFrameClassNR");
 wxChar wxMDIFrameClassName[]      = _T("wxMDIFrameClass");
+wxChar wxMDIFrameClassNameNoRedraw[] = _T("wxMDIFrameClassNR");
 wxChar wxMDIChildFrameClassName[] = _T("wxMDIChildFrameClass");
+wxChar wxMDIChildFrameClassNameNoRedraw[] = _T("wxMDIChildFrameClassNR");
 wxChar wxPanelClassName[]         = _T("wxPanelClass");
 wxChar wxCanvasClassName[]        = _T("wxCanvasClass");
 
@@ -278,11 +284,15 @@ bool wxApp::RegisterWindowClasses()
 {
     WNDCLASS wndclass;
 
+    // for each class we register one with CS_(V|H)REDRAW style and one
+    // without for windows created with wxNO_FULL_REDRAW_ON_REPAINT flag
+    static const long styleNormal = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
+    static const long styleNoRedraw = CS_DBLCLKS;
+
     // the fields which are common to all classes
-    wndclass.style         = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
     wndclass.lpfnWndProc   = (WNDPROC)wxWndProc;
     wndclass.cbClsExtra    = 0;
-    wndclass.cbWndExtra    = sizeof( DWORD ); // what is this DWORD used for?
+    wndclass.cbWndExtra    = sizeof( DWORD ); // VZ: what is this DWORD used for?
     wndclass.hInstance     = wxhInstance;
     wndclass.hIcon         = (HICON) NULL;
     wndclass.hCursor       = ::LoadCursor((HINSTANCE)NULL, IDC_ARROW);
@@ -290,9 +300,7 @@ bool wxApp::RegisterWindowClasses()
 
     // Register the frame window class.
     wndclass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
-#ifdef _MULTIPLE_INSTANCES
-    sprintf( wxFrameClassName,"wxFrameClass%d", wxhInstance );
-#endif
+    wndclass.style         = styleNormal;
     wndclass.lpszClassName = wxFrameClassName;
 
     if ( !RegisterClass(&wndclass) )
@@ -302,9 +310,20 @@ bool wxApp::RegisterWindowClasses()
         return FALSE;
     }
 
+    // "no redraw" frame
+    wndclass.lpszClassName = wxFrameClassNameNoRedraw;
+    wndclass.style         = styleNoRedraw;
+
+    if ( !RegisterClass(&wndclass) )
+    {
+        wxLogLastError("RegisterClass(no redraw frame)");
+
+        return FALSE;
+    }
+
     // Register the MDI frame window class.
     wndclass.hbrBackground = (HBRUSH)NULL; // paint MDI frame ourselves
-    wndclass.lpszClassName = wxMDIFrameClassName;
+    wndclass.lpszClassName = wxMDIFrameClassNameNoRedraw;
 
     if ( !RegisterClass(&wndclass) )
     {
@@ -313,6 +332,17 @@ bool wxApp::RegisterWindowClasses()
         return FALSE;
     }
 
+    // "no redraw" MDI frame
+    wndclass.lpszClassName = wxMDIFrameClassName;
+    wndclass.style         = styleNoRedraw;
+
+    if ( !RegisterClass(&wndclass) )
+    {
+        wxLogLastError("RegisterClass(no redraw MDI parent frame)");
+
+        return FALSE;
+    }
+
     // Register the MDI child frame window class.
     wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
     wndclass.lpszClassName = wxMDIChildFrameClassName;
@@ -324,6 +354,17 @@ bool wxApp::RegisterWindowClasses()
         return FALSE;
     }
 
+    // "no redraw" MDI child frame
+    wndclass.lpszClassName = wxMDIChildFrameClassNameNoRedraw;
+    wndclass.style         = styleNoRedraw;
+
+    if ( !RegisterClass(&wndclass) )
+    {
+        wxLogLastError("RegisterClass(no redraw MDI child)");
+
+        return FALSE;
+    }
+
     // Register the panel window class.
     wndclass.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH );
     wndclass.lpszClassName = wxPanelClassName;
index a4024565ad31b8d078e353702d6a2d80fc21c70f..e266d6478e6bb076071156d496d0cd114fcfef6f 100644 (file)
@@ -2254,6 +2254,12 @@ bool wxWindow::MSWCreate(int id,
         if ( style & WS_CHILD )
             controlId = id;
 
+        wxString className(wclass);
+        if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE )
+        {
+            className += _T("NR");
+        }
+
         m_hWnd = (WXHWND)CreateWindowEx(extendedStyle,
                                         wclass,
                                         title ? title : _T(""),