Ignore:
Timestamp:
11/14/13 15:43:58 (5 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed widget layouts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeWidgets/Classify/OWLogisticRegression.py

    r11096 r11765  
    5050        stepwiseCb = OWGUI.checkBox(box, self, "stepwiseLR", "Stepwise attribute selection") 
    5151        ibox = OWGUI.indentedBox(box, sep=OWGUI.checkButtonOffsetHint(stepwiseCb)) 
    52         addCritSpin = OWGUI.spin(ibox, self, "addCrit", 1, 50, label="Add threshold [%]", labelWidth=155, tooltip="Requested significance for adding an attribute") 
    53         remCritSpin = OWGUI.spin(ibox, self, "removeCrit", 1, 50, label="Remove threshold [%]", labelWidth=155, tooltip="Requested significance for removing an attribute") 
    54         limitAttSpin = OWGUI.checkWithSpin(ibox, self, "Limit number of attributes to ", 1, 100, "limitNumAttr", "numAttr", step=1, labelWidth=155, tooltip="Maximum number of attributes. Algorithm stops when it selects specified number of attributes.") 
    55         stepwiseCb.disables += [addCritSpin, remCritSpin, limitAttSpin] 
     52        form = QFormLayout( 
     53            spacing=8, fieldGrowthPolicy=QFormLayout.AllNonFixedFieldsGrow, 
     54            labelAlignment=Qt.AlignLeft, formAlignment=Qt.AlignLeft 
     55        ) 
     56        ibox.layout().addLayout(form) 
     57 
     58        addCritSpin = OWGUI.spin( 
     59            ibox, self, "addCrit", 1, 50, 
     60            tooltip="Requested significance for adding an attribute" 
     61        ) 
     62 
     63        addCritSpin.setSuffix(" %") 
     64 
     65        form.addRow("Add threshold", addCritSpin) 
     66 
     67        remCritSpin = OWGUI.spin( 
     68            ibox, self, "removeCrit", 1, 50, 
     69            tooltip="Requested significance for removing an attribute" 
     70        ) 
     71        remCritSpin.setSuffix(" %") 
     72 
     73        form.addRow("Remove threshold", remCritSpin) 
     74 
     75        # Need to wrap the check box in a layout to force vertical centering 
     76        limitBox = OWGUI.widgetBox(ibox, "") 
     77        limitCb = OWGUI.checkBox( 
     78            limitBox, self, "limitNumAttr", "Limit number of attributes to", 
     79        ) 
     80 
     81        limitAttSpin = OWGUI.spin( 
     82            ibox, self, "numAttr", 1, 100, 
     83            tooltip="Maximum number of attributes. Algorithm stops when it " + 
     84                    "selects specified number of attributes." 
     85        ) 
     86 
     87        limitCb.disables += [limitAttSpin] 
     88        limitCb.makeConsistent() 
     89 
     90        form.addRow(limitBox, limitAttSpin) 
     91 
     92        stepwiseCb.disables += [ibox] 
    5693        stepwiseCb.makeConsistent() 
    57          
     94 
    5895        OWGUI.separator(self.controlArea) 
    5996 
Note: See TracChangeset for help on using the changeset viewer.