def apply(self, event=None): if self.applying: return self.applying = True self.item_selected() self.applying = False Base.apply( self, event)
def apply(self, event=None): self.fix() if self.aguidata.get('adjust_digits', False): value = self.floatspin.GetValue() f = prettify_float(value) precision = len(f) - f.find('.') - 1 if precision > self.floatspin.GetDigits(): self.floatspin.SetDigits(precision) Base.apply(self, event) self.floatspin.GetTextCtrl().SetSelection(0, 0)
def apply(self, event=None): self.fix() if self.aguidata.get('adjust_digits', False): value = self.floatspin.GetValue() f = prettify_float(value) precision = len(f) - f.find('.') - 1 if precision > self.floatspin.GetDigits(): self.floatspin.SetDigits(precision) Base.apply(self, event) self.floatspin.GetTextCtrl().SetSelection(0,0)
def item_selected(self, event=None): if self.allow_typing and \ self.listctrl.GetStringValue() != self.control.Value: self.data = self.control.Value self.text = self.control.Value else: self.data = self.listctrl.GetSelectedData() self.text = self.listctrl.GetStringValue() if not self.applying: Base.apply( self) if self.callback: self.callback(self.text, self.data) self.set_tooltip()
def lost_focus(self, event=None): if self.allow_typing and \ self.listctrl.GetStringValue() != self.control.Value: self.data = self.control.Value self.text = self.control.Value elif not self.listctrl.didSelect: try: self.control.SetValue(self.control.GetValue()) except: pass return Base.apply( self) if self.callback: self.callback(self.text, self.data) self.control.SetValue(self.control.GetValue())
def apply(self, event=None): Base.apply(self, event) self.textEntry.select_all()