# Copyright: (c) 1999 by Total Control Software
# Licence: wxWindows license
#----------------------------------------------------------------------
+# 11/30/2003 - Jeff Grimmett (grimmtooth@softhome.net)
+#
+# o Updated for wx namespace
+# o Tested with updated demo
+#
"""
This module implements various forms of generic buttons, meaning that
else:
dc.SetPen(self.shadowPen)
for i in range(self.bezelWidth):
- dc.DrawLine((x1+i, y1), (x1+i, y2-i))
- dc.DrawLine((x1, y1+i), (x2-i, y1+i))
+ dc.DrawLine(x1+i, y1, x1+i, y2-i)
+ dc.DrawLine(x1, y1+i, x2-i, y1+i)
# draw the lower right sides
if self.up:
else:
dc.SetPen(self.highlightPen)
for i in range(self.bezelWidth):
- dc.DrawLine((x1+i, y2-i), (x2+1, y2-i))
- dc.DrawLine((x2-i, y1+i), (x2-i, y2))
+ dc.DrawLine(x1+i, y2-i, x2+1, y2-i)
+ dc.DrawLine(x2-i, y1+i, x2-i, y2)
def DrawLabel(self, dc, width, height, dw=0, dy=0):
tw, th = dc.GetTextExtent(label)
if not self.up:
dw = dy = self.labelDelta
- dc.DrawText(label, ((width-tw)/2+dw, (height-th)/2+dy))
+ dc.DrawText(label, (width-tw)/2+dw, (height-th)/2+dy)
def DrawFocusIndicator(self, dc, w, h):
dc.SetLogicalFunction(wx.INVERT)
dc.SetPen(self.focusIndPen)
dc.SetBrush(wx.TRANSPARENT_BRUSH)
- dc.DrawRectangle((bw+2,bw+2), (w-bw*2-4, h-bw*2-4))
+ dc.DrawRectangle(bw+2,bw+2, w-bw*2-4, h-bw*2-4)
dc.SetLogicalFunction(wx.COPY)
if not self.up:
dw = dy = self.labelDelta
hasMask = bmp.GetMask() != None
- dc.DrawBitmap(bmp, ((width-bw)/2+dw, (height-bh)/2+dy), hasMask)
+ dc.DrawBitmap(bmp, (width-bw)/2+dw, (height-bh)/2+dy, hasMask)
#----------------------------------------------------------------------
pos_x = (width-bw-tw)/2+dw # adjust for bitmap and text to centre
if bmp !=None:
- dc.DrawBitmap(bmp, (pos_x, (height-bh)/2+dy), hasMask) # draw bitmap if available
+ dc.DrawBitmap(bmp, pos_x, (height-bh)/2+dy, hasMask) # draw bitmap if available
pos_x = pos_x + 2 # extra spacing from bitmap
- dc.DrawText(label, (pos_x + dw+bw, (height-th)/2+dy)) # draw the text
+ dc.DrawText(label, pos_x + dw+bw, (height-th)/2+dy) # draw the text
#----------------------------------------------------------------------