def interpret_template_panel(self, template, widg_dex): try: templates = template.templates[widg_dex] except AttributeError: templates = [] if not templates: return [lgb.create_label()] try: mason = template.mason except AttributeError: mason = self try: scroll = template.scrollable[widg_dex] except AttributeError: scroll = False try: collapse = template.collapses[widg_dex] except AttributeError: collapse = False try: lay = template.layouts[widg_dex] except AttributeError: lay = 'grid' if not lay: lay = 'grid' if scroll: panel_widget = [lgb.create_scroll_area( lgb.create_panel(templates, mason, collapses = collapse, layout = lay))] else: panel_widget = [lgb.create_panel(templates, mason, collapses = collapse, layout = lay)] try: title = template.box_labels[widg_dex] group = QtGui.QGroupBox(title = title) layout = lgb.create_vert_box(panel_widget) group.setLayout(layout) return [group] except AttributeError: return panel_widget
def set_up_widgets(self): panel = lgb.create_panel(self.widg_templates, self.mason) split = QtGui.QSplitter(QtCore.Qt.Horizontal) split.addWidget(panel) split.addWidget(lgb.central_widget_wrapper( content = self.targets_layout)) split.addWidget(lgb.central_widget_wrapper( content = self.slice_layout)) split.addWidget(lgb.central_widget_wrapper( content = lgb.create_vert_box( [self.canvas, self.toolbar]))) layout = lgb.create_horz_box([split]) self.setLayout(layout)
def set_up_widgets(self, layout = None): panel = lgb.create_panel(self.widg_templates, self.mason) button_template = lgm.interface_template_gui( widgets = ['button_set'], verbosities = [0], layout = 'horizontal', bindings = [[self.on_make, self.reject]], #labels = [['make', 'cancel']], icons = [self.button_icons], minimum_sizes = [[(100, 50), (100, 50)]]) buttons = self.mason.interpret_template(button_template) buttons.itemAt(0).widget().setFocus() if layout: layout.addWidget(panel) else: layout = lgb.create_vert_box([panel]) layout.addLayout(buttons) self.delete_layout() self.setLayout(layout)
def interpret_template_p_sp(self, template): try: mason = template.mason except AttributeError: mason = self p_sp_panel = lgb.create_panel(template.widg_templates, mason) return p_sp_panel