Lots of bup fixes, API updates, etc
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -450,7 +450,7 @@ class PointSet(draw_object):
|
||||
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))
|
||||
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ class Dot(draw_object):
|
||||
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):
|
||||
@@ -513,7 +513,7 @@ 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):
|
||||
@@ -539,7 +539,7 @@ class Ellipse(draw_object):
|
||||
|
||||
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):
|
||||
@@ -564,7 +564,7 @@ class Circle(draw_object):
|
||||
|
||||
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):
|
||||
"""
|
||||
@@ -647,7 +647,7 @@ 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))
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
@@ -808,13 +808,13 @@ class FloatCanvas(wxPanel):
|
||||
|
||||
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()
|
||||
@@ -869,8 +869,8 @@ class FloatCanvas(wxPanel):
|
||||
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()
|
||||
|
||||
@@ -908,8 +908,8 @@ class FloatCanvas(wxPanel):
|
||||
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()
|
||||
|
||||
@@ -954,7 +954,7 @@ class FloatCanvas(wxPanel):
|
||||
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):
|
||||
"""
|
||||
@@ -990,7 +990,7 @@ class FloatCanvas(wxPanel):
|
||||
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()
|
||||
@@ -1005,7 +1005,7 @@ class FloatCanvas(wxPanel):
|
||||
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()
|
||||
@@ -1021,25 +1021,25 @@ class FloatCanvas(wxPanel):
|
||||
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):
|
||||
|
Reference in New Issue
Block a user