]> git.saurik.com Git - wxWidgets.git/blame - wxPython/tests/test_gcdcDrawRect.py
define ATTRIBUTE_PRINTF(m,n) and not just ATTRIBUTE_PRINTF as nothing when the compil...
[wxWidgets.git] / wxPython / tests / test_gcdcDrawRect.py
CommitLineData
cbfc9df6
RD
1
2import wx
3
4CLIP = True
5
6class TestPanel(wx.Panel):
7 def __init__(self, parent, *args):
8 wx.Panel.__init__(self, parent, *args)
9 self.Bind(wx.EVT_PAINT, self.OnPaint)
10
11 def OnPaint(self, evt):
12 pdc = wx.PaintDC(self)
13 gcdc = wx.GCDC(pdc)
14
15 for dc, y in [(gcdc, 10), (pdc, 40)]:
16 r = wx.Rect(10, y, 100, 20)
17
18 dc.SetPen(wx.Pen("red", 1))
19 dc.SetBrush(wx.Brush("light blue"))
20
21 if CLIP: dc.SetClippingRect(r)
22 dc.DrawRectangleRect(r)
23 dc.DestroyClippingRegion()
24
25 r.Offset((120, 0))
26 if CLIP: dc.SetClippingRect(r)
27 dc.DrawRoundedRectangleRect(r, 8)
28 dc.DestroyClippingRegion()
29
30
31 r.Offset((120, 0))
32 if CLIP: dc.SetClippingRect(r)
33 dc.DrawEllipseRect(r)
34 dc.DestroyClippingRegion()
35
36
37app = wx.App(False)
38frm = wx.Frame(None, title="wxGCDC Drawing Rectangles")
39pnl = TestPanel(frm)
40frm.Show()
41app.MainLoop()
42
43
44