git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3164
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// don't invalidate the whole window (resulting in a PAINT event) when the
// window is resized (currently, makes sense for wxMSW only)
// 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
*/
/*
* wxFrame/wxDialog style flags
*/
wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
wxTranslateKeyEvent(keyEvent, win, (Widget) 0, xEvent);
wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
wxTranslateKeyEvent(keyEvent, win, (Widget) 0, xEvent);
- win->ProcessEvent( keyEvent );
- return (keyEvent.GetSkipped() != TRUE);
+ return win->ProcessEvent( keyEvent );
#else
xmCascadeButtonWidgetClass, (Widget) parent,
#endif
#else
xmCascadeButtonWidgetClass, (Widget) parent,
#endif
- XmNlabelString, label_str,
+ XmNlabelString, label_str(),
XmNsubMenuId, menu,
NULL);
XmNsubMenuId, menu,
NULL);
wxApp *wxTheApp = NULL;
// FIXME why not const? and not static?
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 wxFrameClassName[] = _T("wxFrameClass");
+wxChar wxFrameClassNameNoRedraw[] = _T("wxFrameClassNR");
wxChar wxMDIFrameClassName[] = _T("wxMDIFrameClass");
wxChar wxMDIFrameClassName[] = _T("wxMDIFrameClass");
+wxChar wxMDIFrameClassNameNoRedraw[] = _T("wxMDIFrameClassNR");
wxChar wxMDIChildFrameClassName[] = _T("wxMDIChildFrameClass");
wxChar wxMDIChildFrameClassName[] = _T("wxMDIChildFrameClass");
+wxChar wxMDIChildFrameClassNameNoRedraw[] = _T("wxMDIChildFrameClassNR");
wxChar wxPanelClassName[] = _T("wxPanelClass");
wxChar wxCanvasClassName[] = _T("wxCanvasClass");
wxChar wxPanelClassName[] = _T("wxPanelClass");
wxChar wxCanvasClassName[] = _T("wxCanvasClass");
+ // 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
// the fields which are common to all classes
- wndclass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
wndclass.lpfnWndProc = (WNDPROC)wxWndProc;
wndclass.cbClsExtra = 0;
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);
wndclass.hInstance = wxhInstance;
wndclass.hIcon = (HICON) NULL;
wndclass.hCursor = ::LoadCursor((HINSTANCE)NULL, IDC_ARROW);
// Register the frame window class.
wndclass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE + 1);
// 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) )
wndclass.lpszClassName = wxFrameClassName;
if ( !RegisterClass(&wndclass) )
+ // "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
// Register the MDI frame window class.
wndclass.hbrBackground = (HBRUSH)NULL; // paint MDI frame ourselves
- wndclass.lpszClassName = wxMDIFrameClassName;
+ wndclass.lpszClassName = wxMDIFrameClassNameNoRedraw;
if ( !RegisterClass(&wndclass) )
{
if ( !RegisterClass(&wndclass) )
{
+ // "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;
// Register the MDI child frame window class.
wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wndclass.lpszClassName = wxMDIChildFrameClassName;
+ // "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;
// Register the panel window class.
wndclass.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH );
wndclass.lpszClassName = wxPanelClassName;
if ( style & WS_CHILD )
controlId = 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(""),
m_hWnd = (WXHWND)CreateWindowEx(extendedStyle,
wclass,
title ? title : _T(""),