]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/tests/test_gcdcDrawEllipticArc.py
3 class Canvas(wx
.Panel
):
4 def __init__(self
, parent
):
5 wx
.Panel
.__init
__(self
, parent
)
6 self
.Bind (wx
.EVT_PAINT
, self
.OnPaint
)
7 self
.bkg_brush
= wx
.Brush((190,190,255))
10 def OnPaint(self
, evt
):
13 dc
.SetBackground(self
.bkg_brush
)
15 dc
.DrawEllipticArc(100, 200, 200, 200-self
.v_pos
, 90,270)
16 dc
.DrawLine(100, 100, 100, 300)
19 class MyFrame(wx
.Frame
):
21 wx
.Frame
.__init
__(self
, None, title
="DrawEllipticArc")
22 self
.SetSize((640,480))
23 self
.canvas
= Canvas(self
)
24 self
.slider
= wx
.Slider(self
, minValue
=0, maxValue
=100)
25 box
= wx
.BoxSizer(wx
.VERTICAL
)
26 box
.Add(self
.canvas
, 1, wx
.EXPAND
)
27 box
.Add(self
.slider
, 0, wx
.EXPAND
)
31 self
.slider
.Bind (wx
.EVT_SLIDER
, self
.OnSlide
)
33 def OnSlide(self
, evt
):
34 self
.canvas
.v_pos
= 100+self
.slider
.GetValue()
35 self
.canvas
.Refresh(False)
38 if __name__
== "__main__":