Fix CustomTreeCtrl/HyperTreeList background color

CustomTreeCtrl and HyperTreeList use wx.SYS_COLOUR_LISTBOX for their
default background colors. This defaults to dank Grey on MSW/GTK/MacOS
even though the TreeCtrl and ListCtrl on all three platforms default
to a white background. Use a trick from UltimateListCtrl to take
default colors from wx.ListCtrl.

This can be seen in the demos, except that the CustomTreeCtrl demo
forces its background to wx.WHITE. With these changes forcing the
background color is no longer necessary and allows the controls to
take on the native background color for themes that change it.
This commit is contained in:
cbeytas
2019-01-07 00:12:00 -05:00
parent 72b27d7f4a
commit ac0f578a01
3 changed files with 2 additions and 4 deletions

View File

@@ -1293,8 +1293,6 @@ class CustomTreeCtrl(CT.CustomTreeCtrl):
CT.CustomTreeCtrl.__init__(self, parent, id, pos, size, style, agwStyle)
self.SetBackgroundColour(wx.WHITE)
alldata = dir(CT)
treestyles = []

View File

@@ -1052,7 +1052,7 @@ class HyperTreeListDemo(wx.Frame):
splitter.SplitVertically(self.leftpanel, panel, 300)
splitter.SetMinimumPaneSize(120)
self.leftpanel.SetBackgroundColour(wx.WHITE)
#self.leftpanel.SetBackgroundColour(wx.WHITE)
self.leftpanel.SetScrollRate(20, 20)
self.Fit()