]> git.saurik.com Git - wxWidgets.git/commitdiff
Applied patch [ 1218833 ] [wxMSW] wxListBox optimisation for XP
authorJulian Smart <julian@anthemion.co.uk>
Thu, 16 Jun 2005 15:36:48 +0000 (15:36 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 16 Jun 2005 15:36:48 +0000 (15:36 +0000)
Also removed temporary fix to hardwire listbox background colour

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34674 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/listbox.h
include/wx/msw/window.h
src/msw/listbox.cpp
src/msw/window.cpp

index 5104928429677faa8a99c6278ccc234c34ba48a1..43350ba8aaa02d542135de05d3d0a6b8131464b1 100644 (file)
@@ -151,6 +151,13 @@ protected:
 
     virtual wxSize DoGetBestSize() const;
 
+    // under XP when using "transition effect for menus and tooltips" if we
+    // return true for WM_PRINTCLIENT here then it causes noticable slowdown
+    virtual bool MSWShouldPropagatePrintChild()
+    {
+        return false;
+    }
+
 #if wxUSE_OWNER_DRAWN
     // control items
     wxListBoxItemsArray m_aItems;
index 218bd938bd7ccb02b2fe25a5c803858ac2778c46..39ba4694f7dc873430b6fa0931e669a53588edfb 100644 (file)
@@ -391,6 +391,14 @@ public:
         return false;
     }
 
+    // some controls (e.g. wxListBox) need to set the return value themselves
+    //
+    // return true to let parent handle it if we don't, false otherwise
+    virtual bool MSWShouldPropagatePrintChild()
+    {
+        return true;
+    }
+
 
     // Responds to colour changes: passes event on to children.
     void OnSysColourChanged(wxSysColourChangedEvent& event);
index ffe24da141f4f5ce0e96dfad1339a2916f6b32b2..c799cf3479f025848aab58b9bece27e74b1389f0 100644 (file)
@@ -174,10 +174,6 @@ bool wxListBox::Create(wxWindow *parent,
         return false;
     }
 
-    // Necessary to prevent scroll problems within a notebook with Windows
-    // effects enabled
-    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
-
     // initialize the contents
     for ( int i = 0; i < n; i++ )
     {
index 3c94a80359a1595033961b73cbc50d2467a416f0..315f7bdd6d7f46fd68e8b4f8c12ef3e5b021d5cf 100644 (file)
@@ -4150,6 +4150,11 @@ bool wxWindowMSW::HandlePrintClient(WXHDC hDC)
     if ( IsTopLevel() || InheritsBackgroundColour() )
         return false;
 
+    // sometimes we don't want the parent to handle it at all, instead
+    // return whatever value this window wants
+    if ( !MSWShouldPropagatePrintChild() )
+        return MSWPrintChild(hDC, (wxWindow *)this);
+
     for ( wxWindow *win = GetParent(); win; win = win->GetParent() )
     {
         if ( win->MSWPrintChild(hDC, (wxWindow *)this) )