Ejemplo n.º 1
0
 def apply(self, event=None):
     if self.applying:
         return
     self.applying = True
     self.item_selected()
     self.applying = False
     Base.apply( self, event)
Ejemplo n.º 2
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)
Ejemplo n.º 3
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)
Ejemplo n.º 4
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()
Ejemplo n.º 5
0
 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())                            
Ejemplo n.º 6
0
 def apply(self, event=None):
     Base.apply(self, event)
     self.textEntry.select_all()
Ejemplo n.º 7
0
 def apply(self, event=None):
     Base.apply(self, event)
     self.textEntry.select_all()