本文整理汇总了Python中wx.StaticBox方法的典型用法代码示例。如果您正苦于以下问题:Python wx.StaticBox方法的具体用法?Python wx.StaticBox怎么用?Python wx.StaticBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.StaticBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addCheckBoxes
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [as 别名]
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))
#----------------------------------------------------------
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:19,代码来源:GUI_wxPython.py
示例2: addStaticBoxWithLabels
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [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 StaticBox [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: InitUI
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [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)
示例5: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [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
示例6: create_editor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [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)
示例7: Add_Preprocessing_Panel
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [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()
#----------------------------------------------------------------
示例8: Add_Plotting_Panel
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [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)
#----------------------------------------------------------------
示例9: do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [as 别名]
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
示例10: createWidgetsFrame
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [as 别名]
def createWidgetsFrame(self):
staticBox = wx.StaticBox( self.panel, -1, "Widgets Frame", size=(285, -1) )
self.statBoxSizerV = wx.StaticBoxSizer(staticBox, wx.VERTICAL)
#----------------------------------------------------------
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:7,代码来源:GUI_wxPython.py
示例11: createManageFilesFrame
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [as 别名]
def createManageFilesFrame(self):
staticBox = wx.StaticBox( self.panel, -1, "Manage Files", size=(285, -1) )
self.statBoxSizerMgrV = wx.StaticBoxSizer(staticBox, wx.VERTICAL)
#----------------------------------------------------------
开发者ID:PacktPublishing,项目名称:Python-GUI-Programming-Cookbook-Second-Edition,代码行数:7,代码来源:GUI_wxPython.py
示例12: do_layout
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [as 别名]
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
示例13: crt_staticbox
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [as 别名]
def crt_staticbox(self, label):
return wx.StaticBox(self, wx.ID_ANY, label)
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [as 别名]
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)
示例15: AddLabeled
# 需要导入模块: import wx [as 别名]
# 或者: from wx import StaticBox [as 别名]
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)