Changeset 7785:7ea0e04836c7 in orange


Ignore:
Timestamp:
03/30/11 13:10:35 (3 years ago)
Author:
ales_erjavec <ales.erjavec@…>
Branch:
default
Convert:
9b276d1c2903c0c5495100f1c24ae84e03a796e1
Message:

Added 'keyboardTracking' parameter to OWGUI.spin and OWGUI.doubleSpin. If True it disables 'valueChanged(...)' signals from being emited while editing the spin's line edit with the keyboard.

Location:
orange/OrangeWidgets
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Evaluate/OWTestLearners.py

    r7170 r7785  
    9797        self.controlArea.layout().setSpacing(8) 
    9898        # GUI 
    99         self.sBtns = OWGUI.radioButtonsInBox(self.controlArea, self, "resampling", box="Sampling", 
     99        self.sBtns = OWGUI.radioButtonsInBox(self.controlArea, self, "resampling",  
     100                                             box="Sampling", 
    100101                                             btnLabels=self.resamplingMethods[:1], 
    101102                                             callback=self.newsampling) 
     
    103104         
    104105        ibox = OWGUI.widgetBox(OWGUI.indentedBox(self.sBtns, sep=indent)) 
    105         OWGUI.spin(ibox, self, 'nFolds', 2, 100, step=1, label='Number of folds:', 
    106                    callback=lambda p=0: self.conditionalRecompute(p)) 
     106        OWGUI.spin(ibox, self, 'nFolds', 2, 100, step=1, 
     107                   label='Number of folds:', 
     108                   callback=lambda p=0: self.conditionalRecompute(p), 
     109                   keyboardTracking=False) 
     110         
    107111        OWGUI.separator(self.sBtns, height = 3) 
    108112         
     
    114118        OWGUI.spin(ibox, self, 'pRepeat', 1, 100, step=1, 
    115119                   label='Repeat train/test:', 
    116                    callback=lambda p=2: self.conditionalRecompute(p)) 
     120                   callback=lambda p=2: self.conditionalRecompute(p), 
     121                   keyboardTracking=False) 
    117122         
    118123        OWGUI.widgetLabel(ibox, "Relative training set size:") 
  • orange/OrangeWidgets/OWGUI.py

    r7174 r7785  
    167167         box=None, label=None, labelWidth=None, orientation=None, tooltip=None, 
    168168         callback=None, debuggingEnabled = 1, controlWidth = None, callbackOnReturn = False, 
    169          checked = "", checkCallback = None, posttext = None, alignment = Qt.AlignLeft): 
     169         checked = "", checkCallback = None, posttext = None, alignment = Qt.AlignLeft, 
     170         keyboardTracking=True): 
    170171    if box or label and not checked: 
    171172        b = widgetBox(widget, box, orientation) 
     
    188189    wa = bi.control = SpinBoxWFocusOut(min, max, step, bi) 
    189190    wa.setAlignment(alignment) 
    190     if bi.layout() is not None: bi.layout().addWidget(wa) 
     191    wa.setKeyboardTracking(keyboardTracking) # If false it wont emit valueChanged signals while editing the text 
     192    if bi.layout() is not None: 
     193        bi.layout().addWidget(wa) 
    191194    # must be defined because of the setText below 
    192195    if controlWidth: 
     
    261264         box=None, label=None, labelWidth=None, orientation=None, tooltip=None, 
    262265         callback=None, debuggingEnabled = 1, controlWidth = None, callbackOnReturn = False, 
    263          checked = "", checkCallback = None, posttext = None, addToLayout=True, alignment = Qt.AlignLeft): #widget, master, value, min, max, step=1, box=None, label=None, labelWidth=None, orientation=None, tooltip=None, callback=None, controlWidth=None): 
     266         checked = "", checkCallback = None, posttext = None, addToLayout=True, alignment = Qt.AlignLeft, 
     267         keyboardTracking=True): #widget, master, value, min, max, step=1, box=None, label=None, labelWidth=None, orientation=None, tooltip=None, callback=None, controlWidth=None): 
    264268    if box or label and not checked: 
    265269        b = widgetBox(widget, box, orientation) 
     
    282286    wa = bi.control = DoubleSpinBoxWFocusOut(min, max, step, bi) 
    283287    wa.setAlignment(alignment) 
    284     if addToLayout and bi.layout() is not None: bi.layout().addWidget(wa) 
     288    wa.setKeyboardTracking(keyboardTracking) # If false it wont emit valueChanged signals while editing the text 
     289    if addToLayout and bi.layout() is not None: 
     290        bi.layout().addWidget(wa) 
    285291    # must be defined because of the setText below 
    286292    if controlWidth: 
Note: See TracChangeset for help on using the changeset viewer.