]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/tests/test_gcdcDrawRect.py
6 class TestPanel(wx
.Panel
):
7 def __init__(self
, parent
, *args
):
8 wx
.Panel
.__init
__(self
, parent
, *args
)
9 self
.Bind(wx
.EVT_PAINT
, self
.OnPaint
)
11 def OnPaint(self
, evt
):
12 pdc
= wx
.PaintDC(self
)
15 for dc
, y
in [(gcdc
, 10), (pdc
, 40)]:
16 r
= wx
.Rect(10, y
, 100, 20)
18 dc
.SetPen(wx
.Pen("red", 1))
19 dc
.SetBrush(wx
.Brush("light blue"))
21 if CLIP
: dc
.SetClippingRect(r
)
22 dc
.DrawRectangleRect(r
)
23 dc
.DestroyClippingRegion()
26 if CLIP
: dc
.SetClippingRect(r
)
27 dc
.DrawRoundedRectangleRect(r
, 8)
28 dc
.DestroyClippingRegion()
32 if CLIP
: dc
.SetClippingRect(r
)
34 dc
.DestroyClippingRegion()
38 frm
= wx
.Frame(None, title
="wxGCDC Drawing Rectangles")