當前位置: 首頁>>代碼示例>>Python>>正文


Python wx.EVT_CHECKBOX屬性代碼示例

本文整理匯總了Python中wx.EVT_CHECKBOX屬性的典型用法代碼示例。如果您正苦於以下問題:Python wx.EVT_CHECKBOX屬性的具體用法?Python wx.EVT_CHECKBOX怎麽用?Python wx.EVT_CHECKBOX使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在wx的用法示例。


在下文中一共展示了wx.EVT_CHECKBOX屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_summary_widgets

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def get_summary_widgets(self, summary_panel):
        """Return a list of summary widgets suitable for sizer.AddMany."""
        self.summary_panel = summary_panel
        self.summary_name = wx.StaticText(summary_panel, -1, self.name)
        self.summary_name.Bind(wx.EVT_LEFT_UP, self.show_this_panel)

        self.summary_status = wx.StaticText(summary_panel, -1, STR_STOPPED)
        self.summary_shares_accepted = wx.StaticText(summary_panel, -1, "0")
        self.summary_shares_invalid = wx.StaticText(summary_panel, -1, "0")
        self.summary_start = wx.Button(summary_panel, -1, self.get_start_stop_state(), style=wx.BU_EXACTFIT)
        self.summary_start.Bind(wx.EVT_BUTTON, self.toggle_mining)
        self.summary_autostart = wx.CheckBox(summary_panel, -1)
        self.summary_autostart.Bind(wx.EVT_CHECKBOX, self.toggle_autostart)
        self.summary_autostart.SetValue(self.autostart)
        return [
            (self.summary_name, 0, wx.ALIGN_CENTER_HORIZONTAL),
            (self.summary_status, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
            (self.summary_shares_accepted, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
            (self.summary_shares_invalid, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
            (self.summary_start, 0, wx.ALIGN_CENTER, 0),
            (self.summary_autostart, 0, wx.ALIGN_CENTER, 0)
        ] 
開發者ID:theRealTacoTime,項目名稱:poclbm,代碼行數:24,代碼來源:guiminer.py

示例2: BindModelProperties

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def BindModelProperties(self):
        self.btnCalibrateTilt.Bind(wx.EVT_BUTTON, self.scaniface.Calibrate)
        self.btnCalibrateExtent.Bind(wx.EVT_BUTTON, self.scaniface.CalibrateModelBBox)

        # model parameters
        self.elevInput.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.regionInput.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.zexag.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.rotate.Bind(wx.EVT_SPINCTRL, self.OnModelProperties)
        self.rotate.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.numscans.Bind(wx.EVT_SPINCTRL, self.OnModelProperties)
        self.numscans.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.interpolate.Bind(wx.EVT_CHECKBOX, self.OnModelProperties)
        self.smooth.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.resolution.Bind(wx.EVT_TEXT, self.OnModelProperties)
        self.trim_tolerance.Bind(wx.EVT_TEXT, self.OnModelProperties)
        for each in 'nsewtb':
            self.trim[each].Bind(wx.EVT_TEXT, self.OnModelProperties) 
開發者ID:tangible-landscape,項目名稱:grass-tangible-landscape,代碼行數:20,代碼來源:g.gui.tangible.py

示例3: AddSelector

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def AddSelector(self, name, binding=None):
        if (binding == None):
            binding = self.OnButton

        if (not self.singleton):
            rb = wx.CheckBox(self, label=name)
            rb.Bind(wx.EVT_CHECKBOX, binding)
        elif (len(self.boxes) == 0):
            # boxes gets updated in Add
            rb = wx.RadioButton(self.scrolled, label=name, style=wx.RB_GROUP)
            rb.Bind(wx.EVT_RADIOBUTTON, binding)
            self.SendSelectorEvent(rb)
        else:
            rb = wx.RadioButton(self.scrolled, label=name)
            rb.Bind(wx.EVT_RADIOBUTTON, binding)

        self.Add(rb) 
開發者ID:mmccoo,項目名稱:kicad_mmccoo,代碼行數:19,代碼來源:DialogUtils.py

示例4: create_editor

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def create_editor(self, panel, sizer):
        label_text = self._find_label()
        self.checkbox = wx.CheckBox(panel, -1, '', name=label_text)
        self._display_value()
        self.label_ctrl = label = self._get_label(label_text, panel, name=label_text)

        if config.preferences.use_checkboxes_workaround:
            size = self.checkbox.GetSize()
            self.checkbox.SetLabel(label_text)
            self.checkbox.SetMaxSize(size)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)
        #hsizer.Add(label, 2, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
        hsizer.Add(label, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 3)
        #hsizer.SetItemMinSize(0, config.label_initial_width, -1)
        #hsizer.AddSpacer(20)
        hsizer.Add(self.checkbox, 0, wx.ALIGN_LEFT | wx.ALL, 3)
        hsizer.AddStretchSpacer(5)
        sizer.Add(hsizer, 0, wx.EXPAND)
        self._set_tooltip(label, self.checkbox)
        self.checkbox.Bind(wx.EVT_CHECKBOX, self.on_change_val)
        self.editing = True 
開發者ID:wxGlade,項目名稱:wxGlade,代碼行數:24,代碼來源:new_properties.py

示例5: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def __init__(self, canvas, legend):
        NavigationToolbar2Wx.__init__(self, canvas)
        self._canvas = canvas
        self._legend = legend
        self._autoScale = True

        if matplotlib.__version__ >= '1.2':
            panId = self.wx_ids['Pan']
        else:
            panId = self.FindById(self._NTB2_PAN).GetId()
        self.ToggleTool(panId, True)
        self.pan()

        checkLegend = wx.CheckBox(self, label='Legend')
        checkLegend.SetValue(legend.get_visible())
        self.AddControl(checkLegend)
        self.Bind(wx.EVT_CHECKBOX, self.__on_legend, checkLegend, id)

        if wx.__version__ >= '2.9.1':
            self.AddStretchableSpace()
        else:
            self.AddSeparator()

        self._textCursor = wx.StaticText(self, style=wx.ALL | wx.ALIGN_RIGHT)
        font = self._textCursor.GetFont()
        if wx.__version__ >= '2.9.1':
            font.MakeSmaller()
        font.SetFamily(wx.FONTFAMILY_TELETYPE)
        self._textCursor.SetFont(font)
        w, _h = get_text_size(' ' * 18, font)
        self._textCursor.SetSize((w, -1))

        self.AddControl(self._textCursor)

        self.Realize() 
開發者ID:EarToEarOak,項目名稱:RF-Monitor,代碼行數:37,代碼來源:navigation_toolbar.py

示例6: addCheckBox

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def addCheckBox(self, name, parent, sizer, pad):
        cb = wx.CheckBox(parent, -1, name)
        wx.EVT_CHECKBOX(self, cb.GetId(), self.OnMisc)
        sizer.Add(cb, 0, wx.TOP, pad)
        setattr(self, name.lower() + "Cb", cb) 
開發者ID:trelby,項目名稱:trelby,代碼行數:7,代碼來源:headersdlg.py

示例7: addCheckBox

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def addCheckBox(self, name, prefix, parent, sizer, pad):
        cb = wx.CheckBox(parent, -1, name)
        wx.EVT_CHECKBOX(self, cb.GetId(), self.OnStyleCb)
        sizer.Add(cb, 0, wx.TOP, pad)
        setattr(self, prefix + name + "Cb", cb) 
開發者ID:trelby,項目名稱:trelby,代碼行數:7,代碼來源:cfgdlg.py

示例8: addCb

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def addCb(self, descr, sizer, pad):
        ctrl = wx.CheckBox(self, -1, descr)
        wx.EVT_CHECKBOX(self, ctrl.GetId(), self.OnMisc)
        sizer.Add(ctrl, 0, wx.TOP, pad)

        return ctrl 
開發者ID:trelby,項目名稱:trelby,代碼行數:8,代碼來源:cfgdlg.py

示例9: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
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() 
開發者ID:NVDARemote,項目名稱:NVDARemote,代碼行數:40,代碼來源:dialogs.py

示例10: __init__

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def __init__(self, parent, sync_model):
        wx.Panel.__init__(self, parent, style=wx.RAISED_BORDER)

        headerFont = wx.Font(11.5, wx.SWISS, wx.NORMAL, wx.NORMAL)

        self.sync_model = sync_model
        self.dstc = GoSyncDriveTree(self, pos=(0,0))

        self.t1 = wx.StaticText(self, -1, "Choose the directories to sync:", pos=(0,0))
        self.t1.SetFont(headerFont)

        self.cb = wx.CheckBox(self, -1, 'Sync Everything', (10, 10))
        self.cb.SetValue(True)
        self.cb.Disable()
        self.dstc.Disable()
        self.cb.Bind(wx.EVT_CHECKBOX, self.SyncSetting)

        self.Bind(CT.EVT_TREE_ITEM_CHECKED, self.ItemChecked)

        GoSyncEventController().BindEvent(self, GOSYNC_EVENT_CALCULATE_USAGE_DONE,
                                          self.RefreshTree)
        GoSyncEventController().BindEvent(self, GOSYNC_EVENT_CALCULATE_USAGE_STARTED,
                                          self.OnUsageCalculationStarted)

        self.cb.Bind(wx.EVT_CHECKBOX, self.SyncSetting)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.t1, 0, wx.ALL)
        sizer.Add(self.cb, 0, wx.ALL)
        sizer.Add(self.dstc, 1, wx.EXPAND,2)
        self.SetSizer(sizer) 
開發者ID:hschauhan,項目名稱:gosync,代碼行數:33,代碼來源:GoSyncSelectionPage.py

示例11: create_sizer_diaginch_override

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def create_sizer_diaginch_override(self):
        self.sizer_setting_diaginch.Clear(True)
        # statbox_parent_diaginch = self.sizer_setting_diaginch.GetStaticBox()
        statbox_parent_diaginch = self
        self.cb_diaginch = wx.CheckBox(statbox_parent_diaginch, -1, "Input display sizes manually")
        self.cb_diaginch.Bind(wx.EVT_CHECKBOX, self.onCheckboxDiaginch)
        st_diaginch = wx.StaticText(
            statbox_parent_diaginch, -1,
            "Display diagonal sizes (inches):"
        )
        st_diaginch.Disable()
        self.sizer_setting_diaginch.Add(self.cb_diaginch, 0, wx.ALIGN_LEFT|wx.LEFT, 0)
        self.sizer_setting_diaginch.Add(st_diaginch, 0, wx.ALIGN_LEFT|wx.LEFT, 10)
        # diag size data for fields
        diags = [str(dsp.diagonal_size()[1]) for dsp in self.display_sys.disp_list]
        # sizer for textctrls
        tc_list_sizer_diag = wx.WrapSizer(wx.HORIZONTAL)
        self.tc_list_diaginch = self.list_of_textctrl(statbox_parent_diaginch, wpproc.NUM_DISPLAYS, fraction=2/5)
        for tc, diag in zip(self.tc_list_diaginch, diags):
            tc_list_sizer_diag.Add(tc, 0, wx.ALIGN_LEFT|wx.ALL, 5)
            tc.ChangeValue(diag)
            tc.Disable()
        self.button_diaginch_save = wx.Button(statbox_parent_diaginch, label="Save")
        self.button_diaginch_save.Bind(wx.EVT_BUTTON, self.onSaveDiagInch)
        tc_list_sizer_diag.Add(self.button_diaginch_save, 0, wx.ALL, 5)
        self.button_diaginch_save.Disable()
        self.sizer_setting_diaginch.Add(tc_list_sizer_diag, 0, wx.ALIGN_LEFT|wx.LEFT, 5)
        self.sizer_setting_adv.Layout()
        self.sizer_main.Layout()
        self.sizer_main.Fit(self.frame)
        # Check cb according to DisplaySystem 'use_user_diags'
        self.cb_diaginch.SetValue(self.display_sys.use_user_diags)
        # Update sizer content based on new cb state
        self.onCheckboxDiaginch(None) 
開發者ID:hhannine,項目名稱:superpaper,代碼行數:36,代碼來源:gui.py

示例12: _bindUI

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def _bindUI(self, field, key, section='chronolapse'):
        """
        Creates a two way binding for the UI element and the given
        section/key in the config.
        """
        logging.debug("Binding %s[%s] to %s" % (section, key, str(field)))
        if hasattr(field, 'SetValue'):


            # if field is a checkbox, treat it differently
            if hasattr(field, 'IsChecked'):
                # on checkbox events, update the config
                self.Bind(wx.EVT_CHECKBOX,
                        lambda event: self.updateConfig(
                                        {key: field.IsChecked()}, from_ui=True),
                        field)

            else:
                # on text events, update the config
                self.Bind(wx.EVT_TEXT,
                        lambda event: self.updateConfig(
                                        {key: field.GetValue()}, from_ui=True),
                        field)

            # on config changes, update the UI
            self.config.add_listener(
                section, key, lambda x: field.SetValue(x))

        elif hasattr(field, 'SetStringSelection'):

            # on Selection
            self.Bind(wx.EVT_COMBOBOX,
                    lambda event: self.updateConfig(
                            {key: field.GetStringSelection()}, from_ui=True),
                    field)

            # on config changes, update the UI
            self.config.add_listener(
                section, key, lambda x: field.SetStringSelection(str(x))) 
開發者ID:collingreen,項目名稱:chronolapse,代碼行數:41,代碼來源:chronolapse.py

示例13: crt_checkbox

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def crt_checkbox(self, label, event_handler=None):
        checkbox = wx.CheckBox(self, label=label, size=self.CHECKBOX_SIZE)

        if event_handler is not None:
            checkbox.Bind(wx.EVT_CHECKBOX, event_handler)

        return checkbox 
開發者ID:MrS0m30n3,項目名稱:youtube-dl-gui,代碼行數:9,代碼來源:optionsframe.py

示例14: _on_shutdown

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def _on_shutdown(self, event):
        """Event handler for the wx.EVT_CHECKBOX of the shutdown_checkbox."""
        self.sudo_textctrl.Enable(self.shutdown_checkbox.GetValue()) 
開發者ID:MrS0m30n3,項目名稱:youtube-dl-gui,代碼行數:5,代碼來源:optionsframe.py

示例15: _on_enable_log

# 需要導入模塊: import wx [as 別名]
# 或者: from wx import EVT_CHECKBOX [as 別名]
def _on_enable_log(self, event):
        """Event handler for the wx.EVT_CHECKBOX of the enable_log_checkbox."""
        wx.MessageBox(_("In order for the changes to take effect please restart {0}").format(__appname__),
                      _("Restart"),
                      wx.OK | wx.ICON_INFORMATION,
                      self) 
開發者ID:MrS0m30n3,項目名稱:youtube-dl-gui,代碼行數:8,代碼來源:optionsframe.py


注:本文中的wx.EVT_CHECKBOX屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。