def make_l2_widgets(self): """create 'main inputs' box plus a scroll area for the options QGroupBox(dataset inputs) QScrollArea QGroupBox(input data and options) with VBox layout elsewhere: QGroupBox(datasets list A) QGroupBox(datasets list B) QGroupBox(other_options) ... """ if show_func_seq: print '=== B ===' self.make_l2_group_box() # for general subject info self.gvars.m2_scroll = QtGui.QScrollArea() self.gvars.m2_scroll.setWidgetResizable(True) # create a containing GroupBox for everything in m2_scroll gbox = QLIB.get_styled_group_box("all options") # the layout for the 'all options' QGroupBox is vertical self.gvars.m2_vlayout = QtGui.QVBoxLayout(gbox) gbox.setLayout(self.gvars.m2_vlayout) self.gvars.m2_gbox_inputs = gbox
def make_l2_group_box(self): """create a group box with a VBox layout: GridLayout: Label(anat) QPushB(choose) LineEdit() Label(EPI) QPushB(choose) LineEdit() Label(EPI base) LineEdit() for uvars: program """ if show_func_seq: print '=== D ===' gbox = QLIB.get_styled_group_box('') layout = QtGui.QGridLayout(gbox) lposn = 0 # current line index # -------------------------------------------------- # program line label = QLIB.make_label('program', 'group ttest program run by script') blist = ['prog: %s' % prog for prog in LTT.g_prog_list] pb = QLIB.create_menu_button(gbox, "choose", blist, call_back=self.CB_gbox_PushB) line = QLIB.make_line(LTT.g_prog_list[0], self.CB_line_text) layout.addWidget(label, lposn, 0) layout.addWidget(pb, lposn, 1) layout.addWidget(line, lposn, 2) # store what we need in gvars self.gvars.PB_program = pb # for sender in CB_gbox_PushB self.gvars.Line_program = line lposn += 1 # -------------------------------------------------- # output script name label = QLIB.make_label('script name', 'name of resulting program script') line = QLIB.make_line(cb=self.CB_line_text) self.gvars.Line_script = line layout.addWidget(label, lposn, 0) layout.addWidget(line, lposn, 2) lposn += 1 # -------------------------------------------------- # dset prefix label=QLIB.make_label('dset prefix','prefix for dataset output by script') line = QLIB.make_line(cb=self.CB_line_text) self.gvars.Line_prefix = line layout.addWidget(label, lposn, 0) layout.addWidget(line, lposn, 2) lposn += 1 # -------------------------------------------------- # mask label= QLIB.make_label('mask dset','compute results only over mask') pb = QLIB.make_button("browse", tip="browse file system for mask dataset", cb=self.CB_gbox_PushB, hstr=0) line = QLIB.make_line(cb=self.CB_line_text) self.gvars.Line_mask = line self.gvars.Pushb_mask = pb layout.addWidget(label, lposn, 0) layout.addWidget(pb, lposn, 1) layout.addWidget(line, lposn, 2) lposn += 1 # -------------------------------------------------- # paired test toggle button cbox = QtGui.QCheckBox("paired test") self.connect(cbox, QtCore.SIGNAL('clicked()'), self.CB_checkbox) cbox.setStatusTip("perform a paired test") self.gvars.CB_paired = cbox layout.addWidget(cbox, lposn, 0, 1, 2) lposn += 1 # -------------------------------------------------- layout.setSpacing(QLIB.g_layout_spacing) gbox.setLayout(layout) self.gvars.gbox_program = gbox