本文整理汇总了Python中wx.RadioBox方法的典型用法代码示例。如果您正苦于以下问题:Python wx.RadioBox方法的具体用法?Python wx.RadioBox怎么用?Python wx.RadioBox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wx
的用法示例。
在下文中一共展示了wx.RadioBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def __init__(self, parent, id, title):
super().__init__(parent, id, title=title)
main_sizer = self.main_sizer = wx.BoxSizer(wx.VERTICAL)
self.client_or_server = wx.RadioBox(self, wx.ID_ANY, choices=(_("Client"), _("Server")), style=wx.RA_VERTICAL)
self.client_or_server.Bind(wx.EVT_RADIOBOX, self.on_client_or_server)
self.client_or_server.SetSelection(0)
main_sizer.Add(self.client_or_server)
choices = [_("Control another machine"), _("Allow this machine to be controlled")]
self.connection_type = wx.RadioBox(self, wx.ID_ANY, choices=choices, style=wx.RA_VERTICAL)
self.connection_type.SetSelection(0)
main_sizer.Add(self.connection_type)
self.container = wx.Panel(parent=self)
self.panel = ClientPanel(parent=self.container)
main_sizer.Add(self.container)
buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL)
main_sizer.Add(buttons, flag=wx.BOTTOM)
main_sizer.Fit(self)
self.SetSizer(main_sizer)
self.Center(wx.BOTH | WX_CENTER)
ok = wx.FindWindowById(wx.ID_OK, self)
ok.Bind(wx.EVT_BUTTON, self.on_ok)
示例2: addRadioButtons
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def addRadioButtons(self):
"""
Adds radio buttons for each bodypart on the right panel
"""
self.choiceBox = wx.BoxSizer(wx.VERTICAL)
names = ["Color individuals", "Color bodyparts"]
self.visualization_radiobox = wx.RadioBox(
self,
label="Select the visualization scheme",
majorDimension=1,
style=wx.RA_SPECIFY_COLS,
choices=names,
)
self.choiceBox.Add(self.visualization_radiobox, 0, wx.EXPAND | wx.ALL, 10)
self.SetSizerAndFit(self.choiceBox)
self.Layout()
return (self.choiceBox, self.visualization_radiobox)
示例3: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: MyFrame.__init__
kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.radio_box_1 = wx.RadioBox(self, wx.ID_ANY, u"运算类型选择", choices=[u"加法", u"减法", u"乘法", u"除法"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.radio_box_2 = wx.RadioBox(self, wx.ID_ANY, u"选择几步运算", choices=[u"一步", u"二步", u"三步"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.radio_box_3 = wx.RadioBox(self, wx.ID_ANY, u"题型设置", choices=[u"求结果", u"求算数项"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.button_1 = wx.Button(self, wx.ID_ANY, u"运行项及结果范围设置")
self.button_2 = wx.Button(self, wx.ID_ANY, u"运算符号设置")
self.checkbox_1 = wx.CheckBox(self, wx.ID_ANY, u"使用括号")
self.radio_box_4 = wx.RadioBox(self, wx.ID_ANY, u"加法设置", choices=[u"随机进位", u"加法进位", u"没有进位"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.radio_box_5 = wx.RadioBox(self, wx.ID_ANY, u"减法设置", choices=[u"随机退位", u"减法退位", u"没有退位"], majorDimension=1, style=wx.RA_SPECIFY_ROWS)
self.text_ctrl_16 = wx.TextCtrl(self, wx.ID_ANY, "20", style=wx.TE_CENTRE)
self.button_6 = wx.Button(self, wx.ID_ANY, u"添加口算题")
self.button_7 = wx.Button(self, wx.ID_ANY, u"清空口算题")
self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "")
self.text_ctrl_2 = wx.TextCtrl(self, wx.ID_ANY, "5", style=wx.TE_CENTRE)
self.text_ctrl_3 = wx.TextCtrl(self, wx.ID_ANY, "3", style=wx.TE_CENTRE)
self.text_ctrl_4 = wx.TextCtrl(self, wx.ID_ANY, u"小学生口算题")
self.text_ctrl_5 = wx.TextCtrl(self, wx.ID_ANY, u"姓名:__________ 日期:____月____日 时间:________ 对题:____道", style=wx.TE_LEFT)
self.button_8 = wx.Button(self, wx.ID_ANY, u"点此生成口算题打印文档")
self.__set_properties()
self.__do_layout()
# end wxGlade
示例4: _getattr
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def _getattr(self, name):
if isinstance(name, wx.Window):
ctl=name
else:
ctl=self.ctl(name)
if ctl:
if ctl.validator:
return ctl.validator.GetValue()
elif isinstance(ctl, xmlres.getControlClass("whComboBox")):
return ctl.GetKeySelection()
elif isinstance(ctl, wx.StaticText):
return ctl.GetLabel()
elif isinstance(ctl, wx.RadioBox):
return ctl.GetSelection()
else:
return ctl.GetValue()
else:
try:
return object.__getattr__(self, name)
except AttributeError as _e:
if not name.startswith('_'):
raise AttributeError("%s has no attribute '%s'" % (str(self.__class__), name))
return None
示例5: Configure
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def Configure(self, step=10.0, direction=0):
text=Text
panel = eg.ConfigPanel(self)
seekCtrl = eg.SpinNumCtrl(panel, -1, step, max=100.0, fractionWidth=1)
radioBox = wx.RadioBox(
panel,
-1,
self.text.radiobox,
choices=[self.text.btnForward, self.text.btnBackward],
style=wx.RA_SPECIFY_ROWS
)
panel.AddLabel(self.text.label)
panel.AddCtrl(seekCtrl)
radioBox.SetSelection(direction)
panel.sizer.Add(radioBox, 0, wx.EXPAND)
while panel.Affirmed():
panel.SetResult(seekCtrl.GetValue(),radioBox.GetSelection())
示例6: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def createControls(self):
self.sourceLabel = wx.StaticText(self, label="Data source:")
self.diLabel = wx.StaticText(self, label="Actions:")
self.loadDIButton = wx.Button(self,-1,"DI data",size=(160,30))
self.diSourceLabel = wx.StaticText(self, label="Source: None")
self.diTextCtrl = wx.TextCtrl(self, value="None",size=(160,40),
style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL)
self.defineVarioScalarButton = wx.Button(self,-1,"Vario/Scalar",size=(160,30))
self.VarioSourceLabel = wx.StaticText(self, label="Vario: None")
self.ScalarSourceLabel = wx.StaticText(self, label="Scalar: None")
self.varioTextCtrl = wx.TextCtrl(self, value="None",size=(160,40),
style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL)
self.defineParameterButton = wx.Button(self,-1,"Analysis parameter",size=(160,30))
self.parameterRadioBox = wx.RadioBox(self,label="parameter source",choices=self.choices, majorDimension=2, style=wx.RA_SPECIFY_COLS,size=(160,50))
#self.parameterTextCtrl = wx.TextCtrl(self, value="Default",size=(160,30),
# style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL)
self.scalarTextCtrl = wx.TextCtrl(self, value="None",size=(160,40),
style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL)
self.AnalyzeButton = wx.Button(self,-1,"Analyze",size=(160,30))
self.logLabel = wx.StaticText(self, label="Logging:")
#self.exportButton = wx.Button(self,-1,"Export...",size=(160,30))
self.ClearLogButton = wx.Button(self,-1,"Clear Log",size=(160,30))
self.SaveLogButton = wx.Button(self,-1,"Save Log",size=(160,30))
self.dilogTextCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(330,200),
style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL|wx.VSCROLL)
#self.varioExtComboBox = wx.ComboBox(self, choices=self.varioext,
# style=wx.CB_DROPDOWN, value=self.varioext[0],size=(160,-1))
#self.scalarExtComboBox = wx.ComboBox(self, choices=self.scalarext,
# style=wx.CB_DROPDOWN, value=self.scalarext[0],size=(160,-1))
示例7: createControls
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def createControls(self):
# single anaylsis
self.flagLabel = wx.StaticText(self, label="Add a flag to a single date")
self.flagsRadioBox = wx.RadioBox(self,
label="Select flag",
choices=self.choices, majorDimension=2, style=wx.RA_SPECIFY_COLS)
self.commentText = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY)
self.okButton = wx.Button(self, label='Ok')
self.closeButton = wx.Button(self, label='Close')
示例8: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def __init__(self, parent):
super(TabPanelPropSeg, self).__init__(parent=parent, id_=wx.ID_ANY)
# Fetch input file
self.hbox_filein = TextBox(self, label="Input file")
# Select contrast
lbl_contrasts = ['t1', 't2', 't2s', 'dwi']
self.rbox_contrast = wx.RadioBox(self, label='Select contrast:',
choices=lbl_contrasts,
majorDimension=1,
style=wx.RA_SPECIFY_ROWS)
# Display all options
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.hbox_filein.hbox, 0, wx.ALL, 5)
sizer.Add(self.rbox_contrast, 0, wx.ALL, 5)
# Run button
button_run = wx.Button(self, id=wx.ID_ANY, label="Run")
button_run.Bind(wx.EVT_BUTTON, self.on_button_run)
sizer.Add(button_run, 0, wx.ALL, 5)
# Add to main sizer
self.sizer_h.Add(sizer)
self.SetSizerAndFit(self.sizer_h)
示例9: addCheckBoxSlider
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def addCheckBoxSlider(self, bodyparts, fileIndex, markersize):
"""
Adds checkbox and a slider
"""
self.choiceBox = wx.BoxSizer(wx.VERTICAL)
self.slider = wx.Slider(
self,
-1,
markersize,
1,
markersize * 3,
size=(250, -1),
style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS,
)
self.slider.Enable(False)
self.checkBox = wx.CheckBox(self, id=wx.ID_ANY, label="Adjust marker size.")
self.choiceBox.Add(self.slider, 0, wx.ALL, 5)
self.choiceBox.Add(self.checkBox, 0, wx.ALL, 5)
names = ["Color individuals", "Color bodyparts"]
self.visualization_radiobox = wx.RadioBox(
self,
label="Select the visualization scheme",
majorDimension=1,
style=wx.RA_SPECIFY_COLS,
choices=names,
)
self.choiceBox.Add(self.visualization_radiobox, 0, wx.EXPAND | wx.ALL, 10)
self.SetSizerAndFit(self.choiceBox)
self.Layout()
return (self.choiceBox, self.slider, self.checkBox, self.visualization_radiobox)
示例10: addRadioButtons
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def addRadioButtons(self, bodyparts, fileIndex, markersize):
"""
Adds radio buttons for each bodypart on the right panel
"""
self.choiceBox = wx.BoxSizer(wx.VERTICAL)
choices = [l for l in bodyparts]
self.fieldradiobox = wx.RadioBox(
self,
label="Select a bodypart to label",
style=wx.RA_SPECIFY_ROWS,
choices=choices,
)
self.slider = wx.Slider(
self,
-1,
markersize,
1,
markersize * 3,
size=(250, -1),
style=wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS,
)
self.slider.Enable(False)
self.checkBox = wx.CheckBox(self, id=wx.ID_ANY, label="Adjust marker size.")
self.choiceBox.Add(self.slider, 0, wx.ALL, 5)
self.choiceBox.Add(self.checkBox, 0, wx.ALL, 5)
self.choiceBox.Add(self.fieldradiobox, 0, wx.EXPAND | wx.ALL, 10)
self.SetSizerAndFit(self.choiceBox)
self.Layout()
return (self.choiceBox, self.fieldradiobox, self.slider, self.checkBox)
示例11: _setattr
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def _setattr(self, name, value):
if isinstance(name, wx.Window):
ctl=name
else:
ctl=self.ctl(name)
if ctl:
if ctl.validator:
return ctl.validator.SetValue(value)
elif isinstance(ctl, xmlres.getControlClass("whComboBox")):
if value == None:
pass
else:
ctl.SetKeySelection(value)
elif isinstance(ctl, wx.ComboBox):
if value == None:
ctl.SetSelection(wx.NOT_FOUND)
else:
ctl.SetStringSelection(value)
if ctl.GetValue() != value:
ctl.SetValue(value)
elif isinstance(ctl, wx.StaticText):
if value == None:
ctl.SetLabel("")
else:
ctl.SetLabel(unicode(value))
elif isinstance(ctl, wx.RadioBox):
if value != None:
ctl.SetSelection(value)
else:
if value == None:
return ctl.SetValue("")
return ctl.SetValue(value)
else:
try:
return object.__setattr__(self, name, value)
except AttributeError as _e:
if not name.startswith('_'):
raise AttributeError("%s has no attribute '%s'" % (str(self.__class__), name))
return None
示例12: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def __init__(self, dlg_title, box_label, choices, options=None, defaults=None):
"""Initialise the dialog and draw the content
dlg_title: Dialog title
box_label: Label of the draw around the listed choices
choices: Choices to select one (string list)"""
pos = wx.GetMousePosition()
wx.Dialog.__init__(self, None, -1, dlg_title, pos)
szr = wx.BoxSizer(wx.VERTICAL)
self.box = wx.RadioBox( self, wx.ID_ANY, box_label, wx.DefaultPosition, wx.DefaultSize,choices.split('|'),
1, style=wx.RA_SPECIFY_COLS )
self.box.SetSelection(0)
szr.Add(self.box, 5, wx.ALL | wx.EXPAND, 10)
if options:
self.options = []
for o, option in enumerate(options):
cb = wx.CheckBox(self, -1, option)
cb.SetValue(defaults and defaults[o])
szr.Add(cb, 0, wx.ALL, 10)
self.options.append(cb)
# buttons
btnbox = wx.StdDialogButtonSizer()
btnOK = wx.Button(self, wx.ID_OK)
btnOK.SetDefault()
btnCANCEL = wx.Button(self, wx.ID_CANCEL)
btnbox.AddButton(btnOK)
btnbox.AddButton(btnCANCEL)
btnbox.Realize()
szr.Add(btnbox, 0, wx.ALL|wx.ALIGN_CENTER, 5)
self.SetAutoLayout(True)
self.SetSizer(szr)
szr.Fit(self)
示例13: create_editor
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def create_editor(self, panel, sizer):
label = self._find_label()
style = wx.RA_SPECIFY_COLS | wx.NO_BORDER | wx.CLIP_CHILDREN
self.options = wx.RadioBox(panel, -1, label, choices=self.labels, majorDimension=self.columns, style=style)
sizer.Add(self.options, 0, wx.EXPAND)
if self.tooltips:
for i,tooltip in enumerate(self.tooltips):
if tooltip:
self.options.SetItemToolTip(i, tooltip)
else:
self._set_tooltip(self.options)
self.update_display(True)
self.options.Bind(wx.EVT_RADIOBOX, self.on_radio)
示例14: __init__
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def __init__(self, *args, **kwds):
# begin wxGlade: PyOgg3_MyDialog.__init__
kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
wx.Dialog.__init__(self, *args, **kwds)
self.notebook_1 = wx.Notebook(self, wx.ID_ANY)
self.notebook_1_pane_1 = wx.Panel(self.notebook_1, wx.ID_ANY)
self.text_ctrl_1 = wx.TextCtrl(self.notebook_1_pane_1, wx.ID_ANY, "")
self.button_3 = wx.Button(self.notebook_1_pane_1, wx.ID_OPEN, "")
self.notebook_1_pane_2 = wx.Panel(self.notebook_1, wx.ID_ANY)
self.radio_box_1 = wx.RadioBox(self.notebook_1_pane_2, wx.ID_ANY, _("Sampling Rate"), choices=[_("44 kbit"), _("128 kbit")], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
self.notebook_1_pane_3 = wx.Panel(self.notebook_1, wx.ID_ANY)
self.text_ctrl_2 = wx.TextCtrl(self.notebook_1_pane_3, wx.ID_ANY, "", style=wx.TE_MULTILINE)
self.notebook_1_pane_4 = wx.Panel(self.notebook_1, wx.ID_ANY)
self.label_2 = wx.StaticText(self.notebook_1_pane_4, wx.ID_ANY, _("File name:"))
self.text_ctrl_3 = wx.TextCtrl(self.notebook_1_pane_4, wx.ID_ANY, "")
self.button_4 = wx.Button(self.notebook_1_pane_4, wx.ID_OPEN, "")
self.checkbox_1 = wx.CheckBox(self.notebook_1_pane_4, wx.ID_ANY, _("Overwrite existing file"))
self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
self.button_5 = wx.Button(self, wx.ID_CLOSE, "")
self.button_2 = wx.Button(self, wx.ID_CANCEL, "", style=wx.BU_TOP)
self.button_1 = wx.Button(self, wx.ID_OK, "", style=wx.BU_TOP)
self.__set_properties()
self.__do_layout()
self.Bind(wx.EVT_BUTTON, self.startConverting, self.button_1)
# end wxGlade
# manually added code
print( 'Dialog has been created at ', time.asctime() )
示例15: Configure
# 需要导入模块: import wx [as 别名]
# 或者: from wx import RadioBox [as 别名]
def Configure(self, action=2):
panel = eg.ConfigPanel()
radioBox = wx.RadioBox(
panel,
-1,
self.text.radioBox,
choices=self.text.actions,
style=wx.RA_SPECIFY_ROWS
)
radioBox.SetSelection(action)
panel.sizer.Add(radioBox, 0, wx.EXPAND)
while panel.Affirmed():
panel.SetResult(radioBox.GetSelection())