]> git.saurik.com Git - wxWidgets.git/commitdiff
Need to set background colour for wxListBox, not just wxCheckListBox,
authorJulian Smart <julian@anthemion.co.uk>
Fri, 10 Jun 2005 08:39:19 +0000 (08:39 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Fri, 10 Jun 2005 08:39:19 +0000 (08:39 +0000)
to avoid scrolling problem when Windows effects are switched on.

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

src/msw/checklst.cpp
src/msw/listbox.cpp

index f9790875b9649d727dd0e02b3f611ba025fcfd91..7c928d371bc2ffd1d8adb50507be2291c20d640b 100644 (file)
@@ -322,14 +322,8 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
                             long style,
                             const wxValidator& validator, const wxString& name)
 {
-    if (wxListBox::Create(parent, id, pos, size, n, choices,
-                             style | wxLB_OWNERDRAW, validator, name))
-    {
-        SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
-        return true;
-    }
-    else
-        return false;
+    return wxListBox::Create(parent, id, pos, size, n, choices,
+                             style | wxLB_OWNERDRAW, validator, name);
 }
 
 bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
@@ -338,14 +332,8 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id,
                             long style,
                             const wxValidator& validator, const wxString& name)
 {
-    if (wxListBox::Create(parent, id, pos, size, choices,
-                             style | wxLB_OWNERDRAW, validator, name))
-    {
-        SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
-        return true;
-    }
-    else
-        return false;
+    return wxListBox::Create(parent, id, pos, size, choices,
+                             style | wxLB_OWNERDRAW, validator, name);
 }
 
 // misc overloaded methods
index c799cf3479f025848aab58b9bece27e74b1389f0..ffe24da141f4f5ce0e96dfad1339a2916f6b32b2 100644 (file)
@@ -174,6 +174,10 @@ 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++ )
     {