Switch to using a wxBufferedPaintDC, also draw/erase the focus
indicator differently to workaround double focus event problem. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -212,8 +212,10 @@ class wxGenButton(wxControl):
|
|||||||
|
|
||||||
def DrawFocusIndicator(self, dc, w, h):
|
def DrawFocusIndicator(self, dc, w, h):
|
||||||
bw = self.bezelWidth
|
bw = self.bezelWidth
|
||||||
dc.SetLogicalFunction(wxINVERT)
|
if self.hasFocus:
|
||||||
self.focusIndPen.SetColour(self.GetForegroundColour())
|
self.focusIndPen.SetColour(self.GetForegroundColour())
|
||||||
|
else:
|
||||||
|
self.focusIndPen.SetColour(self.GetBackgroundColour())
|
||||||
##self.focusIndPen.SetDashes([1,2,1,2]) # This isn't quite working the way I expected...
|
##self.focusIndPen.SetDashes([1,2,1,2]) # This isn't quite working the way I expected...
|
||||||
dc.SetPen(self.focusIndPen)
|
dc.SetPen(self.focusIndPen)
|
||||||
dc.SetBrush(wxTRANSPARENT_BRUSH)
|
dc.SetBrush(wxTRANSPARENT_BRUSH)
|
||||||
@@ -225,7 +227,7 @@ class wxGenButton(wxControl):
|
|||||||
x1 = y1 = 0
|
x1 = y1 = 0
|
||||||
x2 = width-1
|
x2 = width-1
|
||||||
y2 = height-1
|
y2 = height-1
|
||||||
dc = wxPaintDC(self)
|
dc = wxBufferedPaintDC(self)
|
||||||
if self.up:
|
if self.up:
|
||||||
dc.SetBackground(wxBrush(self.GetBackgroundColour(), wxSOLID))
|
dc.SetBackground(wxBrush(self.GetBackgroundColour(), wxSOLID))
|
||||||
else:
|
else:
|
||||||
|
Reference in New Issue
Block a user