+ self.Canvas.Draw(Force = True)
+
+ def ArrowTest(self,event=None):
+ wx.GetApp().Yield()
+ self.UnBindAllMouseEvents()
+ Canvas = self.Canvas
+
+ Canvas.ClearAll()
+ Canvas.SetProjectionFun(None)
+
+ # put in a rectangle to get a bounding box
+ Canvas.AddRectangle(0,0,20,20,LineColor = None)
+
+ # Draw some Arrows
+ Canvas.AddArrow((10,10),Length = 40, Direction = 0)
+ Canvas.AddArrow((10,10),Length = 50, Direction = 45 ,LineWidth = 2, LineColor = "Black", ArrowHeadAngle = 20)
+ Canvas.AddArrow((10,10),Length = 60, Direction = 90 ,LineWidth = 3, LineColor = "Red", ArrowHeadAngle = 30)
+ Canvas.AddArrow((10,10),Length = 70, Direction = 135,LineWidth = 4, LineColor = "Red", ArrowHeadAngle = 40)
+ Canvas.AddArrow((10,10),Length = 80, Direction = 180,LineWidth = 5, LineColor = "Blue", ArrowHeadAngle = 50)
+ Canvas.AddArrow((10,10),Length = 90, Direction = 225,LineWidth = 4, LineColor = "Blue", ArrowHeadAngle = 60)
+ Canvas.AddArrow((10,10),Length = 100,Direction = 270,LineWidth = 3, LineColor = "Green", ArrowHeadAngle = 70)
+ Canvas.AddArrow((10,10),Length = 110,Direction = 315,LineWidth = 2, LineColor = "Green", ArrowHeadAngle = 90 )
+
+ Canvas.AddText("Clickable Arrow",4,18,Position = "bc")
+ Arrow = Canvas.AddArrow((4,18), 80, Direction = 90 ,LineWidth = 3, LineColor = "Red", ArrowHeadAngle = 30)
+ Arrow.Bind(FloatCanvas.EVT_FC_LEFT_DOWN, self.ArrowClicked)
+
+ Canvas.AddText("Changable Arrow",16,4,Position = "cc")
+ self.RotArrow = Canvas.AddArrow((16,4), 80, Direction = 0 ,LineWidth = 3, LineColor = "Green", ArrowHeadAngle = 30)
+ self.RotArrow.Bind(FloatCanvas.EVT_FC_LEFT_DOWN, self.RotateArrow)
+
+
+
+ Canvas.ZoomToBB()
+
+ def ArrowClicked(self,event):
+ print "The Arrow was Clicked"
+
+ def RotateArrow(self,event):
+ print "The Changeable Arrow was Clicked"
+ ## You can do them either one at a time, or both at once
+ ## Doing them both at once prevents the arrow points from being calculated twice
+ #self.RotArrow.SetDirection(self.RotArrow.Direction + random.uniform(-90,90))
+ #self.RotArrow.SetLength(self.RotArrow.Length + random.randint(-20,20))
+ self.RotArrow.SetLengthDirection(self.RotArrow.Length + random.randint(-20,20),
+ self.RotArrow.Direction + random.uniform(-90,90) )
+