def SetAMode(self): if self.rotmode: self.rotmode = False self.GetParent().set_3dzoom_mode(False) self.Clear() self.pbutton.SetStatus('Normal') self.abutton.SetStatus('Toggled') self.pbutton.SetToggled(False) self.abutton.SetToggled(True) self._set_bitmap2(self.p0, self.iabutton) for p in self.p2: p.SetToggled(False) p.SetStatus('Normal') for b in self.p0: self.AddButtonOrS(b) for b in self.p2: self.AddButtonOrS(b) self.AddSpacer() for b in self.p3: self.AddButtonOrS(b) self.DoLayout() self.ptype = 'amode' self.GetParent()._show_cursor = False sc = wxStockCursor(wx.CURSOR_DEFAULT) self.GetParent().canvas.SetCursor(sc)
def SetInsertMode(self, btask, btnl): for p in self.p2: if p != btnl: p.SetToggled(False) p = btnl sc = wxStockCursor(wx.CURSOR_WAIT) self.GetParent().canvas.SetCursor(p.custom_cursor)
def ExitInsertMode(self): # print 'exiting insert mode' sc = wxStockCursor(wx.CURSOR_DEFAULT) self.GetParent().canvas.SetCursor(sc) self.mode = '' self.SetAMode() self._set_bitmap2(self.p2, -1) self.ptype = 'pmode'
def SetCursor(self): if self.rotmode: self.rotmode = False self.GetParent().set_3dzoom_mode(False) self.Clear() self._set_bitmap2(self.p1, 3) self._set_toggle(3) for b in self.p0: self.AddButtonOrS(b) for b in self.p1: self.AddButtonOrS(b) self.AddSpacer() for b in self.p3: self.AddButtonOrS(b) self.DoLayout() self.mode = 'cursor' self.GetParent()._show_cursor = True sc = wxStockCursor(wx.CURSOR_DEFAULT) self.GetParent().canvas.SetCursor(sc) self.GetParent().exit_layout_mode() # just in case...
def SetSelect(self, skip_sc = False): if self.rotmode: self.rotmode = False self.GetParent().set_3dzoom_mode(False) self.Clear() self._set_bitmap2(self.p1, 0) self._set_toggle(0) for b in self.p0: self.AddButtonOrS(b) for b in self.p1: self.AddButtonOrS(b) self.AddSpacer() for b in self.p3: self.AddButtonOrS(b) self.DoLayout() self.mode = '' self.GetParent()._show_cursor = False if not skip_sc: sc = wxStockCursor(wx.CURSOR_DEFAULT) self.GetParent().canvas.SetCursor(sc)
def SetSelect(self, skip_sc=False): if self.rotmode: self.rotmode = False self.GetParent().set_3dzoom_mode(False) self.Clear() self._set_bitmap2(self.p1, 0) self._set_toggle(0) for b in self.p0: self.AddButtonOrS(b) for b in self.p1: self.AddButtonOrS(b) self.AddSpacer() for b in self.p3: self.AddButtonOrS(b) self.DoLayout() self.mode = '' self.GetParent()._show_cursor = False if not skip_sc: sc = wxStockCursor(wx.CURSOR_DEFAULT) self.GetParent().canvas.SetCursor(sc)