本文整理汇总了Python中wx.StaticBoxSizer方法的典型用法代码示例。如果您正苦于以下问题:Python wx.StaticBoxSizer方法的具体用法?Python wx.StaticBoxSizer怎么用?Python wx.StaticBoxSizer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.StaticBoxSizer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addTextStyles
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
def addTextStyles(self, name, prefix, parent):
hsizer = wx.StaticBoxSizer(wx.StaticBox(parent, -1, name),
wx.HORIZONTAL)
gsizer = wx.FlexGridSizer(2, 2, 0, 10)
# wxGTK adds way more space by default than wxMSW between the
# items, have to adjust for that
pad = 0
if misc.isWindows:
pad = 5
self.addCheckBox("Caps", prefix, parent, gsizer, pad)
self.addCheckBox("Italic", prefix, parent, gsizer, pad)
self.addCheckBox("Bold", prefix, parent, gsizer, pad)
self.addCheckBox("Underlined", prefix, parent, gsizer, pad)
hsizer.Add(gsizer, 0, wx.EXPAND)
return hsizer
示例2: addStaticBoxWithLabels
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
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 )
#----------------------------------------------------------
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:23,代码来源:GUI_wxPython.py
示例3: arrange
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
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)
示例4: _build_playlist_sizer
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
def _build_playlist_sizer(self):
playlist_box_sizer = wx.StaticBoxSizer(self.playlist_box, wx.VERTICAL)
playlist_box_sizer.AddSpacer((-1, 10))
border = wx.GridBagSizer(5, 40)
border.Add(self.playlist_start_label, (0, 0), flag=wx.ALIGN_CENTER_VERTICAL)
border.Add(self.playlist_start_spinctrl, (0, 1))
border.Add(self.playlist_stop_label, (1, 0), flag=wx.ALIGN_CENTER_VERTICAL)
border.Add(self.playlist_stop_spinctrl, (1, 1))
border.Add(self.playlist_max_label, (2, 0), flag=wx.ALIGN_CENTER_VERTICAL)
border.Add(self.playlist_max_spinctrl, (2, 1))
playlist_box_sizer.Add(border, flag=wx.ALIGN_CENTER)
return playlist_box_sizer
示例5: _build_filesize_sizer
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
def _build_filesize_sizer(self):
filesize_box_sizer = wx.StaticBoxSizer(self.filesize_box, wx.VERTICAL)
border = wx.GridBagSizer(5, 20)
border.Add(self.filesize_max_label, (0, 0), (1, 2), wx.ALIGN_CENTER_HORIZONTAL)
border.Add(self.filesize_max_spinctrl, (1, 0))
border.Add(self.filesize_max_sizeunit_combobox, (1, 1))
border.Add(self.filesize_min_label, (2, 0), (1, 2), wx.ALIGN_CENTER_HORIZONTAL)
border.Add(self.filesize_min_spinctrl, (3, 0))
border.Add(self.filesize_min_sizeunit_combobox, (3, 1))
filesize_box_sizer.Add(border, flag=wx.ALIGN_CENTER)
return filesize_box_sizer
示例6: _init_sizers
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
def _init_sizers(self):
self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
self.MainSizer = wx.BoxSizer(wx.HORIZONTAL)
self.LeftGridSizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=5)
self.RightBoxSizer = wx.StaticBoxSizer(self.staticBox1, wx.VERTICAL)
self.RightBoxGridSizer = wx.FlexGridSizer(cols=2, hgap=5, rows=3, vgap=10)
self._init_coll_flexGridSizer1_Items(self.flexGridSizer1)
self._init_coll_flexGridSizer1_Growables(self.flexGridSizer1)
self._init_coll_MainSizer_Items(self.MainSizer)
self._init_coll_LeftGridSizer_Items(self.LeftGridSizer)
self._init_coll_LeftGridSizer_Growables(self.LeftGridSizer)
self._init_coll_RightBoxSizer_Items(self.RightBoxSizer)
self._init_coll_RightBoxGridSizer_Items(self.RightBoxGridSizer)
self._init_coll_RightBoxGridSizer_Growables(self.RightBoxGridSizer)
self.SetSizer(self.flexGridSizer1)
示例7: InitUI
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
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)
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
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
示例9: create_editor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
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)
示例10: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MeasurementFrame.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((400, 340))
self.SetTitle("ATV Tester")
sizer_limit = wx.BoxSizer(wx.VERTICAL)
self.panel_3 = wx.Panel(self, wx.ID_ANY)
sizer_limit.Add(self.panel_3, 1, wx.EXPAND, 0)
sizer_8 = wx.StaticBoxSizer(wx.StaticBox(self.panel_3, wx.ID_ANY, "History"), wx.VERTICAL)
self.panel_3.SetSizer(sizer_8)
self.SetSizer(sizer_limit)
self.Layout()
# end wxGlade
# end of class MeasurementFrame
示例11: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: DebugPanel.__init__
kwds["style"] = kwds.get("style", 0) | wx.TAB_TRAVERSAL
wx.Panel.__init__(self, *args, **kwds)
self.SetFont(wx.Font(12, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, 0, ""))
sizer_2 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, "sizer_2"), wx.VERTICAL)
sizer_2.Add((0, 0), 0, 0, 0)
self.SetSizer(sizer_2)
self.Layout()
# end wxGlade
# end of class DebugPanel
示例12: Add_Preprocessing_Panel
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
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()
#----------------------------------------------------------------
示例13: Add_Plotting_Panel
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
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)
#----------------------------------------------------------------
示例14: __do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
def __do_layout(self):
# begin wxGlade: SerialDialog.__do_layout
sizer_4 = wx.StaticBoxSizer(self.sizer_4_staticbox, wx.HORIZONTAL)
grid_sizer_3 = wx.FlexGridSizer(7, 2, 2, 2)
grid_sizer_3.Add(self.label_port, 0, wx.LEFT, 8)
grid_sizer_3.Add(self.combo_box_port, 0, 0, 0)
grid_sizer_3.Add(self.label_baudrate, 0, wx.LEFT, 8)
grid_sizer_3.Add(self.combo_box_baudrate, 0, 0, 0)
grid_sizer_3.Add(self.label_bytesize, 0, wx.LEFT, 8)
grid_sizer_3.Add(self.combo_box_bytesize, 0, 0, 0)
grid_sizer_3.Add(self.label_parity, 0, wx.LEFT, 8)
grid_sizer_3.Add(self.combo_box_parity, 0, 0, 0)
grid_sizer_3.Add(self.label_stopbits, 0, wx.LEFT, 8)
grid_sizer_3.Add(self.combo_box_stopbits, 0, 0, 0)
grid_sizer_3.Add(self.radio_box_rtscts, 0, wx.RIGHT|wx.TOP|wx.BOTTOM, 8)
grid_sizer_3.Add(self.radio_box_xonxoff, 0, wx.LEFT|wx.TOP|wx.BOTTOM|wx.ALIGN_RIGHT, 8)
grid_sizer_3.Add(self.button_cancel, 0, 0, 0)
grid_sizer_3.Add(self.button_ok, 0, wx.ALIGN_RIGHT, 0)
sizer_4.Add(grid_sizer_3, 1, wx.ALL|wx.EXPAND, 6)
self.SetSizer(sizer_4)
sizer_4.Fit(self)
self.Layout()
# end wxGlade
示例15: __do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBoxSizer [as 别名]
def __do_layout(self):
# begin wxGlade: DisplayDialog.__do_layout
sizer_3 = wx.BoxSizer(wx.VERTICAL)
sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
sizer_5 = wx.StaticBoxSizer(self.sizer_5_staticbox, wx.HORIZONTAL)
sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
sizer_4.Add(self.radio_box_crlf, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 10)
sizer_4.Add(self.radio_box_echo, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 10)
sizer_4.Add(self.radio_box_unprintable, 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 10)
sizer_3.Add(sizer_4, 0, wx.ALL|wx.EXPAND, 8)
sizer_5.Add(self.button_font, 0, wx.ALL|wx.EXPAND, 2)
sizer_5.Add(self.button_forecolor, 1, wx.ALL|wx.EXPAND, 2)
sizer_5.Add(self.button_backcolor, 1, wx.ALL, 2)
sizer_3.Add(sizer_5, 1, wx.EXPAND, 0)
sizer_6.Add(self.button_cancel, 0, wx.LEFT|wx.ALIGN_BOTTOM, 8)
sizer_6.Add(self.button_ok, 0, wx.LEFT|wx.ALIGN_BOTTOM, 60)
sizer_3.Add(sizer_6, 1, wx.ALL|wx.EXPAND, 5)
self.SetSizer(sizer_3)
sizer_3.Fit(self)
self.Layout()
# end wxGlade