Python wx.StaticBox() Examples
The following are 30
code examples of wx.StaticBox().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: Main_Dialog.py From topoflow with MIT License | 6 votes |
def Add_Plotting_Panel(self): #--------------------------------------------------- # Create a "static box" and associated sizer for # everything but the bottom buttons. Static boxes # provide a frame and a title for grouping. #--------------------------------------------------- panel = self.main_panel box = wx.StaticBox(panel, -1, "Plotting Options:") sizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.plotting_sizer = sizer #--------------------------------------- # Add run_info_sizer to the main_sizer # and then hide it #--------------------------------------- self.main_sizer.Add(sizer, 0, wx.ALL, self.vgap) self.main_sizer.Hide(sizer) #----------------------------------------------------------------
Example #2
Source File: GUI_wxPython.py From Python-GUI-Programming-Cookbook-Second-Edition with MIT License | 6 votes |
def addCheckBoxes(self): # Regular Box Sizer boxSizerH = wx.BoxSizer(wx.HORIZONTAL) chk1 = wx.CheckBox(self.panel, label='Disabled') chk1.SetValue(True) chk1.Disable() boxSizerH.Add(chk1) chk2 = wx.CheckBox(self.panel, label='UnChecked') boxSizerH.Add(chk2, flag=wx.LEFT, border=10) chk3 = wx.CheckBox(self.panel, label='Toggle') boxSizerH.Add(chk3, flag=wx.LEFT, border=10) chk3.SetValue(True) # Add Regular Box Sizer to StaticBox sizer self.statBoxSizerV.Add(boxSizerH, flag=wx.LEFT, border=10) self.statBoxSizerV.Add((0, 8)) #----------------------------------------------------------
Example #3
Source File: GUI_wxPython.py From Python-GUI-Programming-Cookbook-Second-Edition with MIT License | 6 votes |
def addStaticBoxWithLabels(self): boxSizerH = wx.BoxSizer(wx.HORIZONTAL) staticBox = wx.StaticBox( self.panel, -1, "Labels within a Frame" ) staticBoxSizerV = wx.StaticBoxSizer( staticBox, wx.VERTICAL ) boxSizerV = wx.BoxSizer( wx.VERTICAL ) staticText1 = wx.StaticText( self.panel, -1, " Choose a number:" ) boxSizerV.Add( staticText1, 0, wx.ALL) staticText2 = wx.StaticText( self.panel, -1, " Label 2") boxSizerV.Add( staticText2, 0, wx.ALL ) #------------------------------------------------------ staticBoxSizerV.Add( boxSizerV, 0, wx.ALL ) boxSizerH.Add(staticBoxSizerV) #------------------------------------------------------ boxSizerH.Add(wx.ComboBox(self.panel, size=(70, -1))) #------------------------------------------------------ boxSizerH.Add(wx.SpinCtrl(self.panel, size=(50, -1), style=wx.BORDER_RAISED)) # Add local boxSizer to main frame self.statBoxSizerV.Add( boxSizerH, 1, wx.ALL ) #----------------------------------------------------------
Example #4
Source File: Main_Dialog.py From topoflow with MIT License | 6 votes |
def Add_Preprocessing_Panel(self): #--------------------------------------------------- # Create a "static box" and associated sizer for # everything but the bottom buttons. Static boxes # provide a frame and a title for grouping. #--------------------------------------------------- panel = self.main_panel box = wx.StaticBox(panel, -1, "Preprocessing Tools:") sizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.preprocessing_sizer = sizer #--------------------------------------- # Add run_info_sizer to the main_sizer # and then hide it #--------------------------------------- self.main_sizer.Add(sizer, 0, wx.ALL, self.vgap) self.main_sizer.Hide(sizer) # Add_Preprocessing_Panel() #----------------------------------------------------------------
Example #5
Source File: wx_mpl_dynamic_graph.py From code-for-blog with The Unlicense | 6 votes |
def __init__(self, parent, ID, label, initval): wx.Panel.__init__(self, parent, ID) self.value = initval box = wx.StaticBox(self, -1, label) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.radio_auto = wx.RadioButton(self, -1, label="Auto", style=wx.RB_GROUP) self.radio_manual = wx.RadioButton(self, -1, label="Manual") self.manual_text = wx.TextCtrl(self, -1, size=(35,-1), value=str(initval), style=wx.TE_PROCESS_ENTER) self.Bind(wx.EVT_UPDATE_UI, self.on_update_manual_text, self.manual_text) self.Bind(wx.EVT_TEXT_ENTER, self.on_text_enter, self.manual_text) manual_box = wx.BoxSizer(wx.HORIZONTAL) manual_box.Add(self.radio_manual, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.Add(self.manual_text, flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(self.radio_auto, 0, wx.ALL, 10) sizer.Add(manual_box, 0, wx.ALL, 10) self.SetSizer(sizer) sizer.Fit(self)
Example #6
Source File: panel.py From admin4 with Apache License 2.0 | 6 votes |
def __init__(self, parent, label, xxx): ParamPage.__init__(self, parent, xxx) box = wx.StaticBox(self, -1, label) box.SetFont(g.labelFont()) topSizer = wx.StaticBoxSizer(box, wx.VERTICAL) sizer = wx.FlexGridSizer(len(xxx.styles), 2, 0, 1) sizer.AddGrowableCol(1) for param in xxx.styles: present = xxx.params.has_key(param) check = wx.CheckBox(self, paramIDs[param], param + ':', size = (LABEL_WIDTH,-1), name = param) check.SetValue(present) control = paramDict[param](self, name = param) control.Enable(present) sizer.AddMany([ (check, 0, wx.ALIGN_CENTER_VERTICAL), (control, 0, wx.ALIGN_CENTER_VERTICAL | wx.GROW) ]) self.checks[param] = check self.controls[param] = control topSizer.Add(sizer, 1, wx.ALL | wx.EXPAND, 3) self.SetAutoLayout(True) self.SetSizer(topSizer) topSizer.Fit(self) # Set data for a cahced page
Example #7
Source File: tydesk.py From tydesk with GNU General Public License v3.0 | 6 votes |
def InitUI(self): pnl = wx.Panel(self) vbox = wx.BoxSizer(wx.VERTICAL) sb = wx.StaticBox(pnl, label=u'请输入员工号') sbs = wx.StaticBoxSizer(sb, orient=wx.VERTICAL) self.tcCheckin = wx.TextCtrl(pnl) sbs.Add(self.tcCheckin, 0, wx.ALL|wx.EXPAND, 5) pnl.SetSizer(sbs) hbox2 = wx.BoxSizer(wx.HORIZONTAL) okButton = wx.Button(self, label=u'确认') closeButton = wx.Button(self, label=u'取消') hbox2.Add(okButton) hbox2.Add(closeButton, flag=wx.LEFT, border=5) vbox.Add(pnl, 0, wx.ALL|wx.EXPAND, 5) vbox.Add(hbox2, 0, wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, 10) self.SetSizer(vbox) self.Layout() okButton.Bind(wx.EVT_BUTTON, self.OnConfirm) closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
Example #8
Source File: GUI_wxPython.py From Python-GUI-Programming-Cookbook-Third-Edition with MIT License | 6 votes |
def addCheckBoxes(self): # Regular Box Sizer boxSizerH = wx.BoxSizer(wx.HORIZONTAL) chk1 = wx.CheckBox(self.panel, label='Disabled') chk1.SetValue(True) chk1.Disable() boxSizerH.Add(chk1) chk2 = wx.CheckBox(self.panel, label='UnChecked') boxSizerH.Add(chk2, flag=wx.LEFT, border=10) chk3 = wx.CheckBox(self.panel, label='Toggle') boxSizerH.Add(chk3, flag=wx.LEFT, border=10) chk3.SetValue(True) # Add Regular Box Sizer to StaticBox sizer self.statBoxSizerV.Add(boxSizerH, flag=wx.LEFT, border=10) self.statBoxSizerV.Add((0, 8)) #----------------------------------------------------------
Example #9
Source File: GUI_wxPython.py From Python-GUI-Programming-Cookbook-Third-Edition with MIT License | 6 votes |
def addStaticBoxWithLabels(self): boxSizerH = wx.BoxSizer(wx.HORIZONTAL) staticBox = wx.StaticBox( self.panel, -1, "Labels within a Frame" ) staticBoxSizerV = wx.StaticBoxSizer( staticBox, wx.VERTICAL ) boxSizerV = wx.BoxSizer( wx.VERTICAL ) staticText1 = wx.StaticText( self.panel, -1, " Choose a number:" ) boxSizerV.Add( staticText1, 0, wx.ALL) staticText2 = wx.StaticText( self.panel, -1, " Label 2") boxSizerV.Add( staticText2, 0, wx.ALL ) #------------------------------------------------------ staticBoxSizerV.Add( boxSizerV, 0, wx.ALL ) boxSizerH.Add(staticBoxSizerV) #------------------------------------------------------ boxSizerH.Add(wx.ComboBox(self.panel, size=(70, -1))) #------------------------------------------------------ boxSizerH.Add(wx.SpinCtrl(self.panel, size=(50, -1), style=wx.BORDER_RAISED)) # Add local boxSizer to main frame self.statBoxSizerV.Add( boxSizerH, 1, wx.ALL ) #----------------------------------------------------------
Example #10
Source File: radio_group.py From Gooey with MIT License | 6 votes |
def arrange(self, *args, **kwargs): title = getin(self.widgetInfo, ['options', 'title'], _('choose_one')) if getin(self.widgetInfo, ['options', 'show_border'], False): boxDetails = wx.StaticBox(self, -1, title) boxSizer = wx.StaticBoxSizer(boxDetails, wx.VERTICAL) else: title = wx_util.h1(self, title) title.SetForegroundColour(self._options['label_color']) boxSizer = wx.BoxSizer(wx.VERTICAL) boxSizer.AddSpacer(10) boxSizer.Add(title, 0) for btn, widget in zip(self.radioButtons, self.widgets): sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(btn,0, wx.RIGHT, 4) sizer.Add(widget, 1, wx.EXPAND) boxSizer.Add(sizer, 0, wx.ALL | wx.EXPAND, 5) self.SetSizer(boxSizer)
Example #11
Source File: new_properties.py From wxGlade with MIT License | 6 votes |
def create_editor(self, panel, sizer): self._choices = [] tooltips = self._create_tooltip_text() for box_label in self.styles.keys(): static_box = wx.StaticBox(panel, -1, box_label, style=wx.FULL_REPAINT_ON_RESIZE) box_sizer = wx.StaticBoxSizer(static_box, wx.VERTICAL) for style in self.styles[box_label]: checkbox = wx.CheckBox(panel, -1, style) if style in tooltips: compat.SetToolTip(checkbox, tooltips[style]) self._choices.append(checkbox) box_sizer.Add(checkbox) sizer.Add(box_sizer, 0, wx.ALL | wx.EXPAND, 5) self.update_display(True) for checkbox in self._choices: if checkbox is None: continue # derived classes may not use all options, e.g. obsolete ones checkbox.Bind(wx.EVT_CHECKBOX, self.on_checkbox)
Example #12
Source File: DialogUtils.py From kicad_mmccoo with Apache License 2.0 | 5 votes |
def AddLabeled(self, item, label, proportion=0, flag=wx.EXPAND|wx.ALL, border=0): # Add() above assumes wx.StaticBoxSizer is used. Remember that if deciding # not to use StaticBox here. static = wx.StaticBox(self, wx.ID_ANY, label) staticsizer = wx.StaticBoxSizer(static, wx.VERTICAL) # the default color is very lite on my linux system. # https://stackoverflow.com/a/21112377/23630 static.SetBackgroundColour((150, 150, 150)) item.Reparent(static) # do I really want to pass these arguments to both adds? staticsizer.Add(item, proportion=proportion, flag=flag, border=border) self.Add(staticsizer, proportion=proportion, flag=flag, border=border, origitem=item)
Example #13
Source File: displayDialog.py From Zulu with GNU Affero General Public License v3.0 | 5 votes |
def __init__(self, output_window, *args, **kwds): # begin wxGlade: DisplayDialog.__init__ self.parent = kwds['parent'] del kwds['parent'] kwds["style"] = wx.DEFAULT_DIALOG_STYLE self.outputwin = output_window wx.Dialog.__init__(self, *args, **kwds) self.sizer_5_staticbox = wx.StaticBox(self, -1, "Color and Font") self.radio_box_crlf = wx.RadioBox(self, -1, "newline", choices=["CRLF", "CR", "LF"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.radio_box_echo = wx.RadioBox(self, -1, "echo", choices=["off", "on"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.radio_box_unprintable = wx.RadioBox(self, -1, "unprintable", choices=["off", "on"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.button_font = wx.Button(self, -1, "font") self.button_forecolor = wx.Button(self, -1, "foreColor") self.button_backcolor = wx.Button(self, -1, "backColor") self.button_cancel = wx.Button(self, wx.ID_CANCEL, "", style=wx.BU_RIGHT|wx.BU_BOTTOM) self.button_ok = wx.Button(self, wx.ID_OK, "", style=wx.BU_RIGHT|wx.BU_BOTTOM) self.backupSettings() self.__set_properties() self.__do_layout() self.Bind(wx.EVT_RADIOBOX, self.onRadioBoxCrlf, self.radio_box_crlf) self.Bind(wx.EVT_RADIOBOX, self.onRadionBoxEcho, self.radio_box_echo) self.Bind(wx.EVT_RADIOBOX, self.onRadioBoxUnprintable, self.radio_box_unprintable) self.Bind(wx.EVT_BUTTON, self.onFont, self.button_font) self.Bind(wx.EVT_BUTTON, self.onForecolor, self.button_forecolor) self.Bind(wx.EVT_BUTTON, self.onBackcolor, self.button_backcolor) self.Bind(wx.EVT_BUTTON, self.onCancel, self.button_cancel) self.Bind(wx.EVT_BUTTON, self.onOk, self.button_ok) # end wxGlade
Example #14
Source File: EtherCATManagementEditor.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def MakeStaticBoxSizer(self, boxlabel): """ Make StaticBoxSizer @param boxlabel : label of box sizer @return sizer : the StaticBoxSizer labeled 'boxlabel' """ box = wx.StaticBox(self, -1, boxlabel) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) return sizer
Example #15
Source File: new_properties.py From wxGlade with MIT License | 5 votes |
def create_editor(self, panel, sizer): self._choices = [] # the checkboxes self._ensure_values() widget_writer = self.owner.widget_writer tooltips = self._create_tooltip_text() static_box = wx.StaticBox(panel, -1, _("Style"), style=wx.FULL_REPAINT_ON_RESIZE) box_sizer = wx.StaticBoxSizer(static_box, wx.VERTICAL) for name, flag_value in zip(self._names, self._values): if name in widget_writer.style_defs: style_def = widget_writer.style_defs[name] else: # a generic style; no description in the class config style_def = config.widget_config["generic_styles"][name] if "obsolete" in style_def or "rename_to" in style_def: self._choices.append(None) continue checkbox = wx.CheckBox(panel, -1, name) if name in tooltips: compat.SetToolTip( checkbox, tooltips[name] ) self._choices.append(checkbox) box_sizer.Add(checkbox) sizer.Add(box_sizer, 0, wx.ALL | wx.EXPAND, 5) self.update_display(True) for checkbox in self._choices: if checkbox is not None: checkbox.Bind(wx.EVT_CHECKBOX, self.on_checkbox)
Example #16
Source File: radio_box.py From wxGlade with MIT License | 5 votes |
def _create_static_box(self): sb = wx.StaticBox(self.widget, -1, self.label) sb.Bind(wx.EVT_LEFT_DOWN, self.on_set_focus) sb.Bind(wx.EVT_RIGHT_DOWN, self.popup_menu) return sb
Example #17
Source File: edit_sizers.py From wxGlade with MIT License | 5 votes |
def destroying_child_widget(self, child, index): # previously in _free_slot # required here; otherwise removal of a StaticBox of a StaticBoxSizer will cause a crash # child has been removed from self.children already, # except when a widget is re-created or a slot is just set to overlapped self.widget.Detach(child.widget)
Example #18
Source File: edit_sizers.py From wxGlade with MIT License | 5 votes |
def create_widget(self): BoxSizerBase.create_widget(self) self.widget = wxGladeStaticBoxSizer( wx.StaticBox(self.window.widget, -1, self.label), self.orient ) self.widget.Add(self._btn, 0, wx.EXPAND)
Example #19
Source File: BoxedGroup.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def __init__(self, parent, label="", *items): staticBox = wx.StaticBox(parent, -1, label) wx.StaticBoxSizer.__init__(self, staticBox, wx.VERTICAL) self.items = [] for item in items: lineSizer = wx.BoxSizer(wx.HORIZONTAL) if isinstance(item, types.StringTypes): labelCtrl = wx.StaticText(parent, -1, item) lineSizer.Add( labelCtrl, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5 ) self.items.append([labelCtrl]) elif isinstance(item, (types.ListType, types.TupleType)): lineItems = [] for subitem in item: if isinstance(subitem, types.StringTypes): subitem = wx.StaticText(parent, -1, subitem) lineSizer.Add( subitem, 0, wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5 ) else: lineSizer.Add( subitem, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5 ) lineItems.append(subitem) self.items.append(lineItems) else: lineSizer.Add(item, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) self.items.append([item]) self.Add(lineSizer, 0, wx.EXPAND)
Example #20
Source File: ControlProviderMixin.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def VStaticBoxSizer(self, label, *items): staticBox = wx.StaticBox(self, -1, label) sizer = wx.StaticBoxSizer(staticBox, wx.VERTICAL) sizer.AddMany(items) return sizer
Example #21
Source File: components.py From me-ica with GNU Lesser General Public License v2.1 | 5 votes |
def do_layout(self, parent, titles, msgs): self.panel = wx.Panel(parent) self.radio_buttons = [wx.RadioButton(self.panel, -1) for _ in titles] self.btn_names = [wx.StaticText(self.panel, label=title.title()) for title in titles] self.help_msgs = [wx.StaticText(self.panel, label=msg.title()) for msg in msgs] # box = wx.StaticBox(self.panel, -1, label=self.data['group_name']) box = wx.StaticBox(self.panel, -1, label='') vertical_container = wx.StaticBoxSizer(box, wx.VERTICAL) for button, name, help in zip(self.radio_buttons, self.btn_names, self.help_msgs): hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(button, 0, wx.ALIGN_TOP | wx.ALIGN_LEFT) hbox.Add(name, 0, wx.LEFT, 10) vertical_container.Add(hbox, 0, wx.EXPAND) vertical_container.Add(help, 1, wx.EXPAND | wx.LEFT, 25) vertical_container.AddSpacer(5) self.panel.SetSizer(vertical_container) self.panel.Bind(wx.EVT_SIZE, self.onResize) self.panel.Bind(wx.EVT_RADIOBUTTON, self.showz) return self.panel
Example #22
Source File: SettingsWindow.py From BitTorrent with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, *a, **k): SettingsPanel.__init__(self, parent, *a, **k) # widgets self.ask_checkbutton = CheckButton(self, _("Ask where to save each new download"), self.settings_window, 'ask_for_save', self.settings_window.config['ask_for_save']) self.save_static_box = wx.StaticBox(self, label=_("Move completed downloads to:")) self.save_box = ChooseDirectorySizer(self, self.settings_window.config['save_in'], setfunc = lambda v: self.settings_window.setfunc('save_in', v), editable = False, button_label = _("&Browse")) self.incoming_static_box = wx.StaticBox(self, label=_("Store unfinished downloads in:")) self.incoming_box = ChooseDirectorySizer(self, self.settings_window.config['save_incomplete_in'], setfunc = lambda v: self.settings_window.setfunc('save_incomplete_in', v), editable = False, button_label = _("B&rowse")) # sizers self.save_static_box_sizer = wx.StaticBoxSizer(self.save_static_box, wx.VERTICAL) self.save_static_box_sizer.Add(self.save_box, flag=wx.ALL|wx.GROW, border=SPACING) self.incoming_static_box_sizer = wx.StaticBoxSizer(self.incoming_static_box, wx.VERTICAL) self.incoming_static_box_sizer.Add(self.incoming_box, flag=wx.ALL|wx.GROW, border=SPACING) self.sizer.AddFirst(self.ask_checkbutton) self.sizer.Add(self.save_static_box_sizer, flag=wx.GROW) self.sizer.Add(self.incoming_static_box_sizer, flag=wx.GROW)
Example #23
Source File: SettingsWindow.py From BitTorrent with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, label, key, settings_window, speed_classes): self.key = key self.settings_window = settings_window wx.StaticBox.__init__(self, parent, label=label) self.sizer = wx.StaticBoxSizer(self, wx.VERTICAL) self.text = ElectroStaticText(parent, wx.ID_ANY, 'text') self.setfunc = lambda v : self.settings_window.setfunc(key, v) self.slider = RateSlider(parent, self.settings_window.config[key], speed_classes) self.slider.Bind(wx.EVT_SLIDER, self.OnSlider) self.LoadValue() self.sizer.Add(self.text, proportion=1, flag=wx.GROW|wx.TOP|wx.LEFT|wx.RIGHT, border=SPACING) self.sizer.Add(self.slider, proportion=1, flag=wx.GROW|wx.BOTTOM|wx.LEFT|wx.RIGHT, border=SPACING)
Example #24
Source File: tydesk.py From tydesk with GNU General Public License v3.0 | 5 votes |
def InitUI(self): pnl = wx.Panel(self) vbox = wx.BoxSizer(wx.VERTICAL) sb = wx.StaticBox(pnl, label=u'终端接入验证') sbs = wx.StaticBoxSizer(sb, orient=wx.VERTICAL) sbs.Add(wx.StaticText(pnl, -1, u'接入代码'), 0, wx.ALL|wx.EXPAND, 5) self.tcRegister = wx.TextCtrl(pnl) sbs.Add(self.tcRegister, 0, wx.ALL|wx.EXPAND, 5) sbs.Add(wx.StaticText(pnl, -1, u'接入理由(位置、使用者、分机)'), 0, wx.ALL|wx.EXPAND, 5) self.tcMemo = wx.TextCtrl(pnl) sbs.Add(self.tcMemo, 0, wx.ALL|wx.EXPAND, 5) pnl.SetSizer(sbs) hbox2 = wx.BoxSizer(wx.HORIZONTAL) okButton = wx.Button(self, label=u'确认') closeButton = wx.Button(self, label=u'取消') hbox2.Add(okButton) hbox2.Add(closeButton, flag=wx.LEFT, border=5) vbox.Add(pnl, 0, wx.ALL|wx.EXPAND, 5) vbox.Add(hbox2, 0, wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, 10) self.SetSizer(vbox) self.Layout() okButton.Bind(wx.EVT_BUTTON, self.OnEnterCode) closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
Example #25
Source File: settingsDialog.py From Zulu with GNU Affero General Public License v3.0 | 5 votes |
def __init__(self, output_window, *args, **kwds): # begin wxGlade: SerialDialog.__init__ self.serial = kwds['serial'] del kwds['serial'] kwds["style"] = wx.DEFAULT_DIALOG_STYLE self.outputwin = output_window wx.Dialog.__init__(self, *args, **kwds) self.sizer_4_staticbox = wx.StaticBox(self, -1, "port settings") self.label_port = wx.StaticText(self, -1, "port") self.combo_box_port = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.label_baudrate = wx.StaticText(self, -1, "baudrate") self.combo_box_baudrate = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.label_bytesize = wx.StaticText(self, -1, "bytesize") self.combo_box_bytesize = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.label_parity = wx.StaticText(self, -1, "parity") self.combo_box_parity = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.label_stopbits = wx.StaticText(self, -1, "stopbits") self.combo_box_stopbits = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.radio_box_rtscts = wx.RadioBox(self, -1, "RTS/CTS", choices=["off", "on"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.radio_box_xonxoff = wx.RadioBox(self, -1, "xon/xoff", choices=["off", "on"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.button_cancel = wx.Button(self, wx.ID_CANCEL, "") self.button_ok = wx.Button(self, wx.ID_OK, "", style=wx.BU_RIGHT) self.__set_properties() self.__do_layout() self.__combo_init() self.Bind(wx.EVT_BUTTON, self.onButtonOk, self.button_ok) self.Bind(wx.EVT_BUTTON, self.onButtonCancel, self.button_cancel) # end wxGlade
Example #26
Source File: optionsframe.py From youtube-dl-gui with The Unlicense | 5 votes |
def crt_staticbox(self, label): return wx.StaticBox(self, wx.ID_ANY, label)
Example #27
Source File: GUI_wxPython.py From Python-GUI-Programming-Cookbook-Third-Edition with MIT License | 5 votes |
def createManageFilesFrame(self): staticBox = wx.StaticBox( self.panel, -1, "Manage Files", size=(285, -1) ) self.statBoxSizerMgrV = wx.StaticBoxSizer(staticBox, wx.VERTICAL) #----------------------------------------------------------
Example #28
Source File: GUI_wxPython.py From Python-GUI-Programming-Cookbook-Third-Edition with MIT License | 5 votes |
def createWidgetsFrame(self): staticBox = wx.StaticBox( self.panel, -1, "Widgets Frame", size=(285, -1) ) self.statBoxSizerV = wx.StaticBoxSizer(staticBox, wx.VERTICAL) #----------------------------------------------------------
Example #29
Source File: components2.py From pyFileFixity with MIT License | 5 votes |
def do_layout(self, parent): self.panel = wx.Panel(parent) self.radio_buttons = [wx.RadioButton(self.panel, -1) for _ in self.data] self.btn_names = [wx.StaticText(self.panel, label=btn_data['display_name'].title()) for btn_data in self.data] self.help_msgs = [wx.StaticText(self.panel, label=btn_data['help'].title()) for btn_data in self.data] self.option_stings = [btn_data['commands'] for btn_data in self.data] # box = wx.StaticBox(self.panel, -1, label=self.data['group_name']) box = wx.StaticBox(self.panel, -1, label='Set Verbosity Level') vertical_container = wx.StaticBoxSizer(box, wx.VERTICAL) for button, name, help in zip(self.radio_buttons, self.btn_names, self.help_msgs): hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(button, 0, wx.ALIGN_TOP | wx.ALIGN_LEFT) hbox.Add(name, 0, wx.LEFT, 10) vertical_container.Add(hbox, 0, wx.EXPAND) vertical_container.Add(help, 1, wx.EXPAND | wx.LEFT, 25) vertical_container.AddSpacer(5) # self.panel.Bind(wx.EVT_RADIOBUTTON, self.onSetter, button) self.panel.SetSizer(vertical_container) self.panel.Bind(wx.EVT_SIZE, self.onResize) return self.panel
Example #30
Source File: components.py From pyFileFixity with MIT License | 5 votes |
def do_layout(self, parent): self.panel = wx.Panel(parent) self.radio_buttons = [wx.RadioButton(self.panel, -1) for _ in self.data] self.btn_names = [wx.StaticText(self.panel, label=btn_data['display_name'].title()) for btn_data in self.data] self.help_msgs = [wx.StaticText(self.panel, label=btn_data['help'].title()) for btn_data in self.data] self.option_stings = [btn_data['commands'] for btn_data in self.data] # box = wx.StaticBox(self.panel, -1, label=self.data['group_name']) box = wx.StaticBox(self.panel, -1, label='Set Verbosity Level') vertical_container = wx.StaticBoxSizer(box, wx.VERTICAL) for button, name, help in zip(self.radio_buttons, self.btn_names, self.help_msgs): hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(button, 0, wx.ALIGN_TOP | wx.ALIGN_LEFT) hbox.Add(name, 0, wx.LEFT, 10) vertical_container.Add(hbox, 0, wx.EXPAND) vertical_container.Add(help, 1, wx.EXPAND | wx.LEFT, 25) vertical_container.AddSpacer(5) # self.panel.Bind(wx.EVT_RADIOBUTTON, self.onSetter, button) self.panel.SetSizer(vertical_container) self.panel.Bind(wx.EVT_SIZE, self.onResize) return self.panel