Python wx.RadioBox() Examples

The following are 30 code examples of wx.RadioBox(). 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: controlcontainer.py    From admin4 with Apache License 2.0 6 votes vote down vote up
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 
Example #2
Source File: wxglade_out.py    From PrimarySchoolMathematics with Apache License 2.0 6 votes vote down vote up
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 
Example #3
Source File: dialogs.py    From NVDARemote with GNU General Public License v2.0 6 votes vote down vote up
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) 
Example #4
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
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()) 
Example #5
Source File: outlier_frame_extraction_toolbox.py    From DeepLabCut with GNU Lesser General Public License v3.0 6 votes vote down vote up
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) 
Example #6
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, switch=0):
        text=self.text
        panel = eg.ConfigPanel(self)
        radioBox = wx.RadioBox(
            panel,
            -1,
            text.radiobox,
            choices=text.choices,
            style=wx.RA_SPECIFY_ROWS
        )
        radioBox.SetSelection(switch)
        panel.sizer.Add(radioBox, 0, wx.EXPAND)
        while panel.Affirmed():
            panel.SetResult(radioBox.GetSelection(),) 
Example #7
Source File: new_properties.py    From wxGlade with MIT License 5 votes vote down vote up
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) 
Example #8
Source File: PyOgg3.py    From wxGlade with MIT License 5 votes vote down vote up
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() ) 
Example #9
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
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()) 
Example #10
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, drive=None, action=0):
        panel = eg.ConfigPanel()
        text = self.text
        radiobox = wx.RadioBox(
            panel,
            -1,
            text.optionsLabel,
            choices=text.options,
            majorDimension=1
        )
        radiobox.SetSelection(action)
        #Assign all available cd drives to self.drives. If CdRom.drive
        #is not already set the first drive returned becomes the default.
        cdDrives = []
        letters = [letter + ':' for letter in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ']
        for driveLetter in letters:
            if GetDriveType(driveLetter) == 5:
                cdDrives.append(driveLetter)

        choice = wx.Choice(panel, -1, choices=cdDrives)
        if drive is None:
            drive = ''
        if not choice.SetStringSelection(drive):
            choice.SetSelection(0)
        mySizer = eg.HBoxSizer(
            (panel.StaticText(text.driveLabel), 0, wx.ALIGN_CENTER_VERTICAL),
            ((5, 5)),
            (choice),
        )
        panel.sizer.AddMany(
            (
                (radiobox, 0, wx.EXPAND),
                ((5, 5)),
                (mySizer, 0, wx.EXPAND | wx.ALL, 5),
            )
        )
        while panel.Affirmed():
            panel.SetResult(
                str(choice.GetStringSelection()),
                radiobox.GetSelection()
            ) 
Example #11
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, flag=False):
        panel = eg.ConfigPanel()
        text = self.text
        radioBox = wx.RadioBox(
            panel,
            -1,
            text.text,
            choices=text.choices,
            majorDimension=1
        )
        radioBox.SetSelection(int(flag))
        panel.sizer.Add(radioBox, 0, wx.EXPAND)

        while panel.Affirmed():
            panel.SetResult(bool(radioBox.GetSelection())) 
Example #12
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, enabled=True):
        panel = eg.ConfigPanel(self)
        radioBox = wx.RadioBox(
            panel,
            -1,
            self.name,
            choices = self.plugin.text.enable[self.value:self.value+2],
            style=wx.RA_SPECIFY_ROWS
        )
        radioBox.SetSelection(enabled)
        radioBox.SetMinSize((197,65))
        panel.sizer.Add(radioBox)
        while panel.Affirmed():
            panel.SetResult(radioBox.GetSelection())
#=============================================================================== 
Example #13
Source File: controlcontainer.py    From admin4 with Apache License 2.0 5 votes vote down vote up
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 
Example #14
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, switch=0):
        text=Text
        panel = eg.ConfigPanel(self)
        radioBox = wx.RadioBox(
            panel,
            -1,
            self.text.radiobox,
            choices=[self.text.AutoDJON, self.text.AutoDJOFF],
            style=wx.RA_SPECIFY_ROWS
        )
        radioBox.SetSelection(switch)
        panel.sizer.Add(radioBox, 0, wx.EXPAND)
        while panel.Affirmed():
            panel.SetResult(radioBox.GetSelection(),) 
Example #15
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, switch=0):
        text=Text
        panel = eg.ConfigPanel(self)
        radioBox = wx.RadioBox(
            panel,
            -1,
            self.text.radiobox,
            choices=[self.text.CrossfadeON, self.text.CrossfadeOFF],
            style=wx.RA_SPECIFY_ROWS
        )
        radioBox.SetSelection(switch)
        panel.sizer.Add(radioBox, 0, wx.EXPAND)
        while panel.Affirmed():
            panel.SetResult(radioBox.GetSelection(),) 
Example #16
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, data=0):
        panel = eg.ConfigPanel()
        radioBox = wx.RadioBox(
            panel,
            label=self.text.radioBoxLabel,
            choices=self.text.radioBoxOptions,
            style=wx.RA_SPECIFY_ROWS
        )
        radioBox.SetSelection(data)
        panel.sizer.Add(radioBox, 0, wx.EXPAND)
        while panel.Affirmed():
            panel.SetResult(radioBox.GetSelection()) 
Example #17
Source File: RasterProperty.py    From meerk40t with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: RasterProperty.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((359, 355))
        self.spin_speed_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "200.0", min=0.0, max=500.0)
        self.spin_power_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "1000.0", min=0.0, max=1000.0)
        self.spin_step_size = wx.SpinCtrl(self, wx.ID_ANY, "1", min=0, max=63)
        self.combo_raster_direction = wx.ComboBox(self, wx.ID_ANY, choices=[_("Top To Bottom"), _("Bottom To Top"), _("Right To Left"), _("Left To Right")], style=wx.CB_DROPDOWN)
        self.spin_overscan_set = wx.SpinCtrlDouble(self, wx.ID_ANY, "20.0", min=0.0, max=1000.0)
        self.radio_directional_raster = wx.RadioBox(self, wx.ID_ANY, _("Directional Raster"), choices=[_("Bidirectional"), _("Unidirectional")], majorDimension=2, style=wx.RA_SPECIFY_ROWS)
        self.radio_corner = wx.RadioBox(self, wx.ID_ANY, _("Start Corner"), choices=[" ", " ", " ", " "], majorDimension=2, style=wx.RA_SPECIFY_ROWS)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_speed, self.spin_speed_set)
        self.Bind(wx.EVT_TEXT, self.on_spin_speed, self.spin_speed_set)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_speed, self.spin_speed_set)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_power, self.spin_power_set)
        self.Bind(wx.EVT_TEXT, self.on_spin_power, self.spin_power_set)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_power, self.spin_power_set)
        self.Bind(wx.EVT_SPINCTRL, self.on_spin_step, self.spin_step_size)
        self.Bind(wx.EVT_TEXT, self.on_spin_step, self.spin_step_size)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_step, self.spin_step_size)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_raster_direction, self.combo_raster_direction)
        self.Bind(wx.EVT_SPINCTRLDOUBLE, self.on_spin_overscan, self.spin_overscan_set)
        self.Bind(wx.EVT_TEXT, self.on_spin_overscan, self.spin_overscan_set)
        self.Bind(wx.EVT_TEXT_ENTER, self.on_spin_overscan, self.spin_overscan_set)
        self.Bind(wx.EVT_RADIOBOX, self.on_radio_directional, self.radio_directional_raster)
        self.Bind(wx.EVT_RADIOBOX, self.on_radio_corner, self.radio_corner)
        # end wxGlade
        self.operation = None
        self.Bind(wx.EVT_CLOSE, self.on_close, self) 
Example #18
Source File: Settings.py    From meerk40t with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: Preferences.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE | wx.FRAME_TOOL_WINDOW | wx.STAY_ON_TOP
        wx.Frame.__init__(self, *args, **kwds)
        Module.__init__(self)
        self.SetSize((412, 183))

        self.checklist_options = wx.CheckListBox(self, wx.ID_ANY,
                                                 choices=[
                                                     "Invert Mouse Wheel Zoom",
                                                     "Print Shutdown",
                                                 ])

        self.radio_units = wx.RadioBox(self, wx.ID_ANY, _("Units"),
                                       choices=[_("mm"), _("cm"), _("inch"), _("mils")],
                                       majorDimension=1,
                                       style=wx.RA_SPECIFY_ROWS)

        from wxMeerK40t import supported_languages
        choices = [language_name for language_code, language_name, language_index in supported_languages]
        self.combo_language = wx.ComboBox(self, wx.ID_ANY, choices=choices, style=wx.CB_DROPDOWN)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_RADIOBOX, self.on_radio_units, self.radio_units)
        self.Bind(wx.EVT_COMBOBOX, self.on_combo_language, self.combo_language)
        self.Bind(wx.EVT_CHECKLISTBOX, self.on_checklist_settings, self.checklist_options)
        # end wxGlade
        self.Bind(wx.EVT_CLOSE, self.on_close, self) 
Example #19
Source File: settingsDialog.py    From Zulu with GNU Affero General Public License v3.0 5 votes vote down vote up
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 #20
Source File: displayDialog.py    From Zulu with GNU Affero General Public License v3.0 5 votes vote down vote up
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 #21
Source File: sct_plugin.py    From spinalcordtoolbox with MIT License 5 votes vote down vote up
def __init__(self, parent):
        super(TabPanelRegisterToTemplate, self).__init__(parent=parent, id_=wx.ID_ANY)

        # Fetch input files
        self.hbox_im = TextBox(self, label="Input image")
        self.hbox_seg = TextBox(self, label="Input segmentation")
        self.hbox_label = TextBox(self, label="Input labels")

        # Select contrast
        lbl_contrasts = ['t1', 't2']
        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_im.hbox, 0, wx.ALL, 5)
        sizer.Add(self.hbox_seg.hbox, 0, wx.ALL, 5)
        sizer.Add(self.hbox_label.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) 
Example #22
Source File: absolutespage.py    From magpy with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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)) 
Example #23
Source File: developpage.py    From magpy with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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') 
Example #24
Source File: dialogs.py    From NVDARemote with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, id, title):
		super().__init__(parent, id, title=title)
		main_sizer = wx.BoxSizer(wx.VERTICAL)
		# Translators: A checkbox in add-on options dialog to set whether remote server is started when NVDA starts.
		self.autoconnect = wx.CheckBox(self, wx.ID_ANY, label=_("Auto-connect to control server on startup"))
		self.autoconnect.Bind(wx.EVT_CHECKBOX, self.on_autoconnect)
		main_sizer.Add(self.autoconnect)
		#Translators: Whether or not to use a relay server when autoconnecting
		self.client_or_server = wx.RadioBox(self, wx.ID_ANY, choices=(_("Use Remote Control Server"), _("Host Control Server")), style=wx.RA_VERTICAL)
		self.client_or_server.Bind(wx.EVT_RADIOBOX, self.on_client_or_server)
		self.client_or_server.SetSelection(0)
		self.client_or_server.Enable(False)
		main_sizer.Add(self.client_or_server)
		choices = [_("Allow this machine to be controlled"), _("Control another machine")]
		self.connection_type = wx.RadioBox(self, wx.ID_ANY, choices=choices, style=wx.RA_VERTICAL)
		self.connection_type.SetSelection(0)
		self.connection_type.Enable(False)
		main_sizer.Add(self.connection_type)
		main_sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Host:")))
		self.host = wx.TextCtrl(self, wx.ID_ANY)
		self.host.Enable(False)
		main_sizer.Add(self.host)
		main_sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Port:")))
		self.port = wx.TextCtrl(self, wx.ID_ANY)
		self.port.Enable(False)
		main_sizer.Add(self.port)
		main_sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Key:")))
		self.key = wx.TextCtrl(self, wx.ID_ANY)
		self.key.Enable(False)
		main_sizer.Add(self.key)
		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)
		self.autoconnect.SetFocus() 
Example #25
Source File: sct_plugin.py    From spinalcordtoolbox with MIT License 5 votes vote down vote up
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) 
Example #26
Source File: sct_plugin.py    From spinalcordtoolbox with MIT License 5 votes vote down vote up
def __init__(self, parent):
        super(TabPanelSCSeg, 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) 
Example #27
Source File: sct_plugin.py    From spinalcordtoolbox with MIT License 5 votes vote down vote up
def __init__(self, parent):
        super(TabPanelVertLB, self).__init__(parent=parent, id_=wx.ID_ANY)

        # Fetch input files
        self.hbox_im = TextBox(self, label="Input image")
        self.hbox_seg = TextBox(self, label="Input segmentation")

        # Select contrast
        lbl_contrasts = ['t1', 't2']
        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_im.hbox, 0, wx.ALL, 5)
        sizer.Add(self.hbox_seg.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) 
Example #28
Source File: dialogs.py    From wxGlade with MIT License 5 votes vote down vote up
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) 
Example #29
Source File: multiple_individuals_refinement_toolbox.py    From DeepLabCut with GNU Lesser General Public License v3.0 5 votes vote down vote up
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) 
Example #30
Source File: labeling_toolbox.py    From DeepLabCut with GNU Lesser General Public License v3.0 5 votes vote down vote up
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)