def OnButtonUp(self, wid, event): if not hasattr(self, 'lastPnts'): return #calling this before base class freezes the cursor at last pos if not self.hasData: return if event.button == 1: self.observer.InteractionOff() MarkerWindowInteractor.OnButtonUp(self, wid, event) pnts = self.get_plane_points() if pnts != self.lastPnts: UndoRegistry().push_command(self.set_plane_points, self.lastPnts) return True
def OnButtonUp(self, wid, event): """Mouse button released.""" #print "PlaneWidgetsXYZ.OnButtonUp(): event=", event if not hasattr(self, 'lastPntsXYZ'): return MarkerWindowInteractor.OnButtonUp(self, wid, event) pntsXYZ = (self.get_plane_points(self.pwX), self.get_plane_points(self.pwY), self.get_plane_points(self.pwZ)) if pntsXYZ != self.lastPntsXYZ: UndoRegistry().push_command(self.set_plane_points_xyz, self.lastPntsXYZ) return True