]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/tests/test_drawrect.py
   3 ##import os; print os.getpid(); raw_input("press enter...") 
   6 class TestPanel(wx
.Panel
): 
   7     def __init__(self
, parent
): 
   8         wx
.Panel
.__init
__(self
, parent
) 
   9         self
.Bind(wx
.EVT_PAINT
, self
.OnPaint
) 
  11     def OnPaint(self
, evt
): 
  12         dc 
= wx
.GCDC(wx
.PaintDC(self
)) 
  13         #dc = wx.PaintDC(self) 
  14         r 
= wx
.Rect(64, 25, 45, 18) 
  15         dc
.SetPen(wx
.Pen("black", 1)) 
  16         dc
.SetBrush(wx
.Brush("red")) 
  17         dc
.DrawRectangleRect(r
) 
  19         dc
.SetPen(wx
.TRANSPARENT_PEN
) 
  20         #dc.SetPen(wx.Pen("light blue", 1)) 
  21         dc
.SetBrush(wx
.Brush("light blue")) 
  22         dc
.DrawRectangle(r
.x
+1, r
.y
+1, r
.width
-2, r
.height
-2) 
  24         dc
.SetPen(wx
.Pen("black", 1)) 
  25         dc
.DrawLine(r
.x
+r
.width
+02, r
.y
, 
  27         dc
.DrawLine(r
.x
+r
.width
+02, r
.y
+r
.height
-1, 
  28                     r
.x
+r
.width
+15, r
.y
+r
.height
-1)