]> git.saurik.com Git - wxWidgets.git/blame - wxPython/tests/test_gcdcDrawEllipticArc.py
define ATTRIBUTE_PRINTF(m,n) and not just ATTRIBUTE_PRINTF as nothing when the compil...
[wxWidgets.git] / wxPython / tests / test_gcdcDrawEllipticArc.py
CommitLineData
cbfc9df6
RD
1import wx
2
3class 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))
8 self.v_pos = 100
9
10 def OnPaint(self, evt):
11 dc = wx.PaintDC(self)
12 dc = wx.GCDC(dc)
13 dc.SetBackground(self.bkg_brush)
14 dc.Clear()
15 dc.DrawEllipticArc(100, 200, 200, 200-self.v_pos, 90,270)
16 dc.DrawLine(100, 100, 100, 300)
17
18
19class MyFrame(wx.Frame):
20 def __init__(self):
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)
28 self.SetSizer(box)
29 self.Show()
30 self.CenterOnScreen()
31 self.slider.Bind (wx.EVT_SLIDER, self.OnSlide)
32
33 def OnSlide(self, evt):
34 self.canvas.v_pos = 100+self.slider.GetValue()
35 self.canvas.Refresh(False)
36
37
38if __name__ == "__main__":
39 app = wx.App(0)
40 frame = MyFrame()
41 app.MainLoop()