def OnLeftClick(self, x, y, keys = 0, attachment = 0):
shape = self.GetShape()
+ print shape.__class__
canvas = shape.GetCanvas()
dc = wxClientDC(canvas)
canvas.PrepareDC(dc)
self.log = log
self.frame = frame
- self.SetBackgroundColour(wxWHITE)
+ self.SetBackgroundColour("LIGHT BLUE") #wxWHITE)
self.diagram = wxDiagram()
self.SetDiagram(self.diagram)
self.diagram.SetCanvas(self)
# for some reason, the shapes have to be moved for the line to show up...
fromShape.Move(dc, fromShape.GetX(), fromShape.GetY())
+ EVT_WINDOW_DESTROY(self, self.OnDestroy)
def MyAddShape(self, shape, x, y, pen, brush, text):
- def __del__(self):
+ def OnDestroy(self, evt):
+ # Do some cleanup
for shape in self.diagram.GetShapeList():
if shape.GetParent() == None:
shape.SetCanvas(None)
shape.Destroy()
+ self.diagram.Destroy()
+
+
+ def OnBeginDragLeft(self, x, y, keys):
+ self.log.write("OnBeginDragLeft: %s, %s, %s\n" % (x, y, keys))
+
+ def OnEndDragLeft(self, x, y, keys):
+ self.log.write("OnEndDragLeft: %s, %s, %s\n" % (x, y, keys))
#----------------------------------------------------------------------