41
41
_dc.SetClippingRect(rect)
44
#calculate text extents
45
paint_message = self.GetPaintMessage()
47
tw, th = self.GetClientSize()
48
cw, ch = tw-MARGIN,th-MARGIN
49
font_size = FONT_SIZE+1
50
while (tw >= cw or th >= ch) and font_size > 5:
52
font = wx.Font(font_size,wx.FONTFAMILY_SWISS,
53
wx.FONTSTYLE_NORMAL, wx.FONTSTYLE_NORMAL)
55
tw, th = dc.GetTextExtent(paint_message)
45
62
ew, eh = paint_object.GetSize()
46
63
if self.paint_logo:
48
65
lw, lh = self._paint_logo.GetSize()
49
lx, ly = (ew-lw)/2, (eh-lh)/2
66
lx, ly = (ew-lw)/2, (eh-lh+2*thd)/2
50
67
dc.DrawBitmap(self._paint_logo, lx, ly, True)
53
70
lx, ly = ew/2, eh/2
54
71
#check if text is necessary too
55
paint_message = self.GetPaintMessage()
58
#calculate text extents
59
tw, th = self.GetClientSize()
60
cw, ch = tw-MARGIN,th-MARGIN
61
font_size = FONT_SIZE+1
62
while (tw >= cw or th >= ch) and font_size > 5:
64
font = wx.Font(font_size,wx.FONTFAMILY_SWISS,
65
wx.FONTSTYLE_NORMAL, wx.FONTSTYLE_NORMAL)
67
tw, th = dc.GetTextExtent(paint_message)
72
if not paint_message: return
68
73
#draw rounded rectangle
72
74
if self.paint_logo:
73
75
rx, ry = (ew-twd)/2,ly-2*thd