def OnTool(self, event): """Tool selected -> untoggles previusly selected tool in toolbar""" Debug.msg(3, "VDigitToolbar.OnTool(): id = %s" % event.GetId()) # set cursor self.MapWindow.SetNamedCursor('cross') self.MapWindow.mouse['box'] = 'point' self.MapWindow.mouse['use'] = 'pointer' aId = self.action.get('id', -1) BaseToolbar.OnTool(self, event) # clear tmp canvas if self.action['id'] != aId or aId == -1: self.MapWindow.polycoords = [] self.MapWindow.ClearLines(pdc=self.MapWindow.pdcTmp) if self.digit and \ len(self.MapWindow.digit.GetDisplay().GetSelected()) > 0: # cancel action self.MapWindow.OnMiddleDown(None) # set no action if self.action['id'] == -1: self.action = {'desc': '', 'type': '', 'id': -1} # set focus self.MapWindow.SetFocus()
def OnTool(self, event): """Tool selected -> untoggles previusly selected tool in toolbar""" Debug.msg(3, "VDigitToolbar.OnTool(): id = %s" % event.GetId()) # set cursor self.MapWindow.SetNamedCursor("cross") self.MapWindow.mouse["box"] = "point" self.MapWindow.mouse["use"] = "pointer" aId = self.action.get("id", -1) BaseToolbar.OnTool(self, event) # clear tmp canvas if self.action["id"] != aId or aId == -1: self.MapWindow.polycoords = [] self.MapWindow.ClearLines(pdc=self.MapWindow.pdcTmp) if self.digit and len(self.MapWindow.digit.GetDisplay().GetSelected()) > 0: # cancel action self.MapWindow.OnMiddleDown(None) # set no action if self.action["id"] == -1: self.action = {"desc": "", "type": "", "id": -1} # set focus self.MapWindow.SetFocus()
def OnTool(self, event): """!Tool selected -> untoggles previusly selected tool in toolbar""" # set cursor cursor = self.parent.cursors["cross"] self.MapWindow.SetCursor(cursor) # pointer self.parent.OnPointer(None) aId = self.action.get("id", -1) BaseToolbar.OnTool(self, event) # clear tmp canvas if self.action["id"] != aId or aId == -1: self.MapWindow.polycoords = [] self.MapWindow.ClearLines(pdc=self.MapWindow.pdcTmp) # if self.digit and \ # len(self.MapWindow.digit.GetDisplay().GetSelected()) > 0: # # cancel action # self.MapWindow.OnMiddleDown(None) # # set no action if self.action["id"] == -1: self.action = {"desc": "", "type": "", "id": -1} # set focus self.MapWindow.SetFocus()