Draw the stripy background on wxMac

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-06-04 00:44:42 +00:00
parent 8016d8e124
commit 78a07fd17b

View File

@@ -35,10 +35,10 @@ class wxGenStaticText(wxPyControl):
font = wxSystemSettings_GetSystemFont(wxSYS_DEFAULT_GUI_FONT)
wxPyControl.SetFont(self, font) # same here
clr = parent.GetBackgroundColour()
if not clr.Ok():
clr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_BTNFACE)
self.SetBackgroundColour(clr)
self.defBackClr = parent.GetBackgroundColour()
if not self.defBackClr.Ok():
self.defBackClr = wxSystemSettings_GetSystemColour(wxSYS_COLOUR_3DFACE)
self.SetBackgroundColour(self.defBackClr)
clr = parent.GetForegroundColour()
if not clr.Ok():
@@ -105,7 +105,14 @@ class wxGenStaticText(wxPyControl):
width, height = self.GetClientSize()
if not width or not height:
return
dc.SetBackground(wxBrush(self.GetBackgroundColour(), wxSOLID))
clr = self.GetBackgroundColour()
backBrush = wxBrush(clr, wxSOLID)
if wxPlatform == "__WXMAC__" and clr == self.defBackClr:
# if colour still the default the use the striped background on Mac
backBrush.SetMacTheme(1) # 1 == kThemeBrushDialogBackgroundActive
dc.SetBackground(backBrush)
dc.SetTextForeground(self.GetForegroundColour())
dc.Clear()
dc.SetFont(self.GetFont())