dc.SetBrush(self.Brush)
radius = int(round(self.Diameter/2))
for (x,y) in Points:
- dc.DrawEllipse((x - radius), (y - radius), self.Diameter, self.Diameter)
+ dc.DrawEllipse(((x - radius), (y - radius)), (self.Diameter, self.Diameter))
dc.SetBrush(self.Brush)
radius = int(round(self.Diameter/2))
(X,Y) = WorldToPixel((self.X,self.Y))
- dc.DrawEllipse((X - radius), (Y - radius), self.Diameter, self.Diameter)
+ dc.DrawEllipse(((X - radius), (Y - radius)), (self.Diameter, self.Diameter))
class Rectangle(draw_object):
dc.SetPen(self.Pen)
dc.SetBrush(self.Brush)
- dc.DrawRectangle(X,Y,Width,Height)
+ dc.DrawRectangle((X,Y), (Width,Height))
class Ellipse(draw_object):
def __init__(self,x,y,width,height,LineColor,LineStyle,LineWidth,FillColor,FillStyle,Foreground = 0):
dc.SetPen(self.Pen)
dc.SetBrush(self.Brush)
- dc.DrawEllipse(X,Y,Width,Height)
+ dc.DrawEllipse((X,Y), (Width,Height))
class Circle(draw_object):
def __init__(self,x,y,Diameter,LineColor,LineStyle,LineWidth,FillColor,FillStyle,Foreground = 0):
dc.SetPen(self.Pen)
dc.SetBrush(self.Brush)
- dc.DrawEllipse(X-Diameter/2,Y-Diameter/2,Diameter,Diameter)
+ dc.DrawEllipse((X-Diameter/2,Y-Diameter/2), (Diameter,Diameter))
class Text(draw_object):
"""
raise "Invalid value for Text Object Position Attribute"
self.x_shift = x_shift
self.y_shift = y_shift
- dc.DrawText(self.String, X-self.x_shift, Y-self.y_shift)
+ dc.DrawText(self.String, (X-self.x_shift, Y-self.y_shift))
#---------------------------------------------------------------------------
tb.SetToolBitmapSize((23,23))
- tb.AddTool(ID_ZOOM_IN_BUTTON, GetPlusBitmap(), isToggle=true,shortHelpString = "Zoom In")
+ tb.AddTool(ID_ZOOM_IN_BUTTON, GetPlusBitmap(), isToggle=True,shortHelpString = "Zoom In")
EVT_TOOL(self, ID_ZOOM_IN_BUTTON, self.SetMode)
- tb.AddTool(ID_ZOOM_OUT_BUTTON, GetMinusBitmap(), isToggle=true,shortHelpString = "Zoom Out")
+ tb.AddTool(ID_ZOOM_OUT_BUTTON, GetMinusBitmap(), isToggle=True,shortHelpString = "Zoom Out")
EVT_TOOL(self, ID_ZOOM_OUT_BUTTON, self.SetMode)
- tb.AddTool(ID_MOVE_MODE_BUTTON, GetHandBitmap(), isToggle=true,shortHelpString = "Move")
+ tb.AddTool(ID_MOVE_MODE_BUTTON, GetHandBitmap(), isToggle=True,shortHelpString = "Move")
EVT_TOOL(self, ID_MOVE_MODE_BUTTON, self.SetMode)
tb.AddSeparator()
dc.SetBrush(wxTRANSPARENT_BRUSH)
dc.SetLogicalFunction(wxXOR)
if self.PrevRBBox:
- dc.DrawRectangle(*self.PrevRBBox)
- dc.DrawRectangle(x_c-w/2,y_c-h/2,w,h)
+ dc.DrawRectangleXY(*self.PrevRBBox)
+ dc.DrawRectangleXY(x_c-w/2,y_c-h/2,w,h)
self.PrevRBBox = (x_c-w/2,y_c-h/2,w,h)
dc.EndDrawing()
dc.SetBrush(wxTRANSPARENT_BRUSH)
dc.SetLogicalFunction(wxXOR)
if self.PrevMoveBox:
- dc.DrawRectangle(*self.PrevMoveBox)
- dc.DrawRectangle(x_tl,y_tl,w,h)
+ dc.DrawRectangleXY(*self.PrevMoveBox)
+ dc.DrawRectangleXY(x_tl,y_tl,w,h)
self.PrevMoveBox = (x_tl,y_tl,w,h)
dc.EndDrawing()
def OnPaint(self, event):
#dc = wxBufferedPaintDC(self.DrawPanel, self._Buffer)
dc = wxPaintDC(self.DrawPanel)
- dc.DrawBitmap(self._Buffer,0,0)
+ dc.DrawBitmap(self._Buffer, (0,0))
def Draw(self):
"""
i+=1
Object._Draw(dc,self.WorldToPixel,self.ScaleFunction)
if i % self.NumBetweenBlits == 0:
- ScreenDC.Blit(0, 0, self.PanelSize[0],self.PanelSize[1], dc, 0, 0)
+ ScreenDC.Blit((0, 0), self.PanelSize, dc, (0, 0))
dc.EndDrawing()
else:
dc.Clear()
i+=1
Object._Draw(dc,self.WorldToPixel,self.ScaleFunction)
if i % self.NumBetweenBlits == 0:
- ScreenDC.Blit(0, 0, self.PanelSize[0],self.PanelSize[1], dc, 0, 0)
+ ScreenDC.Blit((0, 0), self.PanelSize, dc, (0, 0))
dc.EndDrawing()
else: # not using a Background DC
dc = wxMemoryDC()
i+=1
Object._Draw(dc,self.WorldToPixel,self.ScaleFunction)
if i % self.NumBetweenBlits == 0:
- ScreenDC.Blit(0, 0, self.PanelSize[0],self.PanelSize[1], dc, 0, 0)
+ ScreenDC.Blit((0, 0), self.PanelSize, dc, (0, 0))
dc.EndDrawing()
else:
dc.Clear()
# now refresh the screen
#ScreenDC.DrawBitmap(self._Buffer,0,0) #NOTE: uisng DrawBitmap didn't work right on MSW
- ScreenDC.Blit(0, 0, self.PanelSize[0],self.PanelSize[1], dc, 0, 0)
+ ScreenDC.Blit((0, 0), self.PanelSize, dc, (0, 0))
# If the canvas is in the middle of a zoom or move, the Rubber Band box needs to be re-drawn
if self.PrevRBBox:
ScreenDC.SetPen(wxPen('WHITE', 2,wxSHORT_DASH))
ScreenDC.SetBrush(wxTRANSPARENT_BRUSH)
ScreenDC.SetLogicalFunction(wxXOR)
- ScreenDC.DrawRectangle(*self.PrevRBBox)
+ ScreenDC.DrawRectangleXY(*self.PrevRBBox)
elif self.PrevMoveBox:
ScreenDC.SetPen(wxPen('WHITE', 1,))
ScreenDC.SetBrush(wxTRANSPARENT_BRUSH)
ScreenDC.SetLogicalFunction(wxXOR)
- ScreenDC.DrawRectangle(*self.PrevMoveBox)
+ ScreenDC.DrawRectangleXY(*self.PrevMoveBox)
if self.Debug: print "Drawing took %f seconds of CPU time"%(clock()-start)
def BBCheck(self, BB1, BB2):