Python wx 模块,EVT_CHECKBOX 实例源码

我们从Python开源项目中,提取了以下28个代码示例,用于说明如何使用wx.EVT_CHECKBOX

项目:irida-miseq-uploader    作者:phac-nml    | 项目源码 | 文件源码
def __init__(self, parent=None, default_directory="", monitor_directory=False):
        wx.Panel.__init__(self, parent)
        self._sizer = wx.BoxSizer(wx.HORIZONTAL)

        directory_label = wx.StaticText(self, label="Default directory")
        directory_label.SetToolTipString("Default directory to scan for uploads")
        self._sizer.Add(directory_label, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, border=5, proportion=0)

        directory = wx.DirPickerCtrl(self, path=default_directory)
        self.Bind(wx.EVT_DIRPICKER_CHANGED, lambda evt: send_message(SettingsDialog.field_changed_topic, field_name="default_dir", field_value=directory.GetPath()))
        self._sizer.Add(directory, flag=wx.EXPAND, proportion=1)

        monitor_checkbox = wx.CheckBox(self, label="Monitor directory for new runs?")
        monitor_checkbox.SetValue(monitor_directory)
        monitor_checkbox.SetToolTipString("Monitor the default directory for when the Illumina Software indicates that the analysis is complete and ready to upload (when CompletedJobInfo.xml is written to the directory).")
        monitor_checkbox.Bind(wx.EVT_CHECKBOX, lambda evt: send_message(SettingsDialog.field_changed_topic, field_name="monitor_default_dir", field_value=str(monitor_checkbox.GetValue())))
        self._sizer.Add(monitor_checkbox, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT, border=5, proportion=0)

        self.SetSizerAndFit(self._sizer)
        self.Layout()
项目:mobileinsight-core    作者:mobile-insight    | 项目源码 | 文件源码
def __init__(self, parent, message, caption, choices=[]):
        wx.Dialog.__init__(self, parent, -1)
        self.SetTitle(caption)
        sizer = wx.BoxSizer(wx.VERTICAL)
        self.message = wx.StaticText(self, -1, message)
        self.clb = wx.CheckListBox(self, -1, choices=choices)
        self.chbox = wx.CheckBox(self, -1, 'Select all')
        self.btns = self.CreateSeparatedButtonSizer(wx.OK | wx.CANCEL)
        self.Bind(wx.EVT_CHECKBOX, self.EvtChBox, self.chbox)

        sizer.Add(self.message, 0, wx.ALL | wx.EXPAND, 5)
        sizer.Add(self.clb, 1, wx.ALL | wx.EXPAND, 5)
        sizer.Add(self.chbox, 0, wx.ALL | wx.EXPAND, 5)
        sizer.Add(self.btns, 0, wx.ALL | wx.EXPAND, 5)
        self.SetSizer(sizer)
        # self.Fit()
项目:cebl    作者:idfah    | 项目源码 | 文件源码
def initOptions(self):
        optionsSizer = wx.BoxSizer(wx.HORIZONTAL)

        self.filtTypeComboBox = wx.ComboBox(self, choices=self.flt.filtMap.keys(),
            value=self.flt.filtType, style=wx.CB_DROPDOWN)
        self.Bind(wx.EVT_COMBOBOX, self.setFiltType, self.filtTypeComboBox)
        optionsSizer.Add(self.filtTypeComboBox, proportion=1,
                flag=wx.LEFT | wx.TOP | wx.RIGHT | wx.ALIGN_CENTER, border=20)

        self.zeroPhaseCheckBox = wx.CheckBox(self, label='Zero Phase')
        self.zeroPhaseCheckBox.SetValue(self.flt.zeroPhase)
        self.Bind(wx.EVT_CHECKBOX, self.setZeroPhase, self.zeroPhaseCheckBox)
        optionsSizer.Add(self.zeroPhaseCheckBox, proportion=1,
                flag=wx.LEFT | wx.TOP | wx.ALIGN_CENTER, border=20)

        self.sizer.Add(optionsSizer, proportion=0)#, flag=wx.EXPAND)
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def __init__(self,parent):
        wx.Panel.__init__(self, parent)
        self.panelvisual = self.GetParent().GetParent().GetParent()
        self.vbox = wx.BoxSizer(wx.VERTICAL)
        self.hbox_btn = wx.BoxSizer(wx.HORIZONTAL)
        self.chkbox_enable = CheckBoxNew(self, -1, 'Enable XYZ Axes')
        self.chkbox_enable.SetToolTipNew("Enable Widget")
        if self.panelvisual.widget.GetEnabled() == 0:
            self.chkbox_enable.SetValue(False)
        else:
            self.chkbox_enable.SetValue(True)
        self.Bind(wx.EVT_CHECKBOX, self.OnChkbox, self.chkbox_enable)
        self.hbox_btn.Add(self.chkbox_enable, 1, flag=wx.CENTER)
        self.vbox.Add(self.hbox_btn, 1, flag=wx.CENTER, border=2)
        self.SetSizer(self.vbox)
        self.Fit()
        self.Show()
项目:wxpythoncookbookcode    作者:driscollis    | 项目源码 | 文件源码
def __init__(self):
        wx.Frame.__init__(self, None, wx.ID_ANY,
                          'My First Plot (to take over the world!)')

        # Add a panel so it looks the correct on all platforms
        panel = wx.Panel(self, wx.ID_ANY)

        # create some sizers
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        checkSizer = wx.BoxSizer(wx.HORIZONTAL)

        # create the widgets
        self.canvas = PlotCanvas(panel)
        self.canvas.Draw(drawBarGraph())
        toggleGrid = wx.CheckBox(panel, label="Show Grid")
        toggleGrid.Bind(wx.EVT_CHECKBOX, self.onToggleGrid)
        toggleLegend = wx.CheckBox(panel, label="Show Legend")
        toggleLegend.Bind(wx.EVT_CHECKBOX, self.onToggleLegend)

        # layout the widgets
        mainSizer.Add(self.canvas, 1, wx.EXPAND)
        checkSizer.Add(toggleGrid, 0, wx.ALL, 5)
        checkSizer.Add(toggleLegend, 0, wx.ALL, 5)
        mainSizer.Add(checkSizer)
        panel.SetSizer(mainSizer)
项目:wxpythoncookbookcode    作者:driscollis    | 项目源码 | 文件源码
def __init__(self):
        wx.Frame.__init__(self, None, wx.ID_ANY,
                          'It Looks Like a Line Graph!')

        # Add a panel so it looks the correct on all platforms
        panel = wx.Panel(self, wx.ID_ANY)

        # create some sizers
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        checkSizer = wx.BoxSizer(wx.HORIZONTAL)

        # create the widgets
        self.canvas = PlotCanvas(panel)
        self.canvas.Draw(drawLinePlot())
        toggleGrid = wx.CheckBox(panel, label="Show Grid")
        toggleGrid.Bind(wx.EVT_CHECKBOX, self.onToggleGrid)
        toggleLegend = wx.CheckBox(panel, label="Show Legend")
        toggleLegend.Bind(wx.EVT_CHECKBOX, self.onToggleLegend)

        # layout the widgets
        mainSizer.Add(self.canvas, 1, wx.EXPAND)
        checkSizer.Add(toggleGrid, 0, wx.ALL, 5)
        checkSizer.Add(toggleLegend, 0, wx.ALL, 5)
        mainSizer.Add(checkSizer)
        panel.SetSizer(mainSizer)
项目:wxpythoncookbookcode    作者:driscollis    | 项目源码 | 文件源码
def __init__(self):
        wx.Frame.__init__(self, None, wx.ID_ANY,
                          'Sin / Cos Plot')

        # Add a panel so it looks the correct on all platforms
        panel = wx.Panel(self, wx.ID_ANY)

        # create some sizers
        mainSizer = wx.BoxSizer(wx.VERTICAL)
        checkSizer = wx.BoxSizer(wx.HORIZONTAL)

        # create the widgets
        self.canvas = PlotCanvas(panel)
        self.canvas.Draw(drawSinCosWaves())
        toggleGrid = wx.CheckBox(panel, label="Show Grid")
        toggleGrid.Bind(wx.EVT_CHECKBOX, self.onToggleGrid)
        toggleLegend = wx.CheckBox(panel, label="Show Legend")
        toggleLegend.Bind(wx.EVT_CHECKBOX, self.onToggleLegend)

        # layout the widgets
        mainSizer.Add(self.canvas, 1, wx.EXPAND)
        checkSizer.Add(toggleGrid, 0, wx.ALL, 5)
        checkSizer.Add(toggleLegend, 0, wx.ALL, 5)
        mainSizer.Add(checkSizer)
        panel.SetSizer(mainSizer)
项目:cebl    作者:idfah    | 项目源码 | 文件源码
def initSigControls(self):
        """Initialize signal controls.
        """
        sigSizer = wx.BoxSizer(orient=wx.VERTICAL)

        distControlBox = widgets.ControlBox(self, label='Distribution', orient=wx.VERTICAL)

        self.distComboBox = wx.ComboBox(self, choices=list(distributions.keys()),
            value='uniform', style=wx.CB_SORT | wx.CB_READONLY)
        self.distComboBox.Bind(wx.EVT_COMBOBOX, self.setDist, self.distComboBox)
        distControlBox.Add(self.distComboBox, proportion=0, flag=wx.ALL, border=10)

        self.walkCheckBox = wx.CheckBox(self, label='Walk')
        self.walkCheckBox.Bind(wx.EVT_CHECKBOX, self.setWalk, self.walkCheckBox)
        distControlBox.Add(self.walkCheckBox, proportion=0,
                flag=wx.LEFT | wx.BOTTOM | wx.RIGHT, border=10)

        sigSizer.Add(distControlBox, proportion=0, flag=wx.ALL, border=10)

        scaleControlBox = widgets.ControlBox(self, label='Scale', orient=wx.HORIZONTAL)

        self.scaleText = wx.StaticText(self, label='%4.1f' % 1.0)
        scaleTextSizer = wx.BoxSizer(orient=wx.VERTICAL)
        scaleTextSizer.Add(self.scaleText, proportion=1, flag=wx.EXPAND)
        self.scaleSlider = wx.Slider(self, style=wx.SL_HORIZONTAL, value=10, minValue=1, maxValue=300)
        self.Bind(wx.EVT_SLIDER, self.setScale, self.scaleSlider)

        scaleControlBox.Add(scaleTextSizer, proportion=0, flag=wx.ALL, border=10)
        scaleControlBox.Add(self.scaleSlider, proportion=1, flag=wx.ALL | wx.EXPAND, border=10)

        sigSizer.Add(scaleControlBox, proportion=0,
                flag=wx.EXPAND | wx.LEFT | wx.BOTTOM | wx.RIGHT, border=10)

        self.sizer.Add(sigSizer)
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def __init__(self, parent):
        self.start_iter = None
        wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER)
        vbox = wx.BoxSizer(wx.VERTICAL)
        title = wx.StaticText(self, label="ER Mask Algorithm")
        vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.exp_amps = TextPanelObject(self, "Exp Amp: ", "",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        vbox.Add(self.exp_amps, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.chkbox_sqrt_expamps = wx.CheckBox(self, -1, 'Square Root Exp Amp', (50, 10))
        self.chkbox_sqrt_expamps.SetValue(True)
        vbox.Add(self.chkbox_sqrt_expamps, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=5)
        self.support = TextPanelObject(self,"Support: ","",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        self.support.label.SetToolTipNew("Support. If empty, previous instance will be used.")
        vbox.Add(self.support, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.mask = TextPanelObject(self,"Mask: ","",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        vbox.Add(self.mask, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.niter = SpinnerObject(self,"Iterations: ",MAX_INT,1,1,1,100,100)
        vbox.Add(self.niter, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        vbox.Add((-1, 5))
        self.chkbox = CheckBoxNew(self, -1, 'Relax Modulus Constraint', size=(200, 20))
        self.chkbox.SetToolTipNew("Do not apply modulus constraint if the change in amplitude"+os.linesep+" is within the Poisson noise.")
        self.chkbox.Bind(wx.EVT_CHECKBOX, self.OnCheck)
        vbox.Add(self.chkbox, 0,flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2)
        self.niter_relax = SpinnerObject(self,"Relax iters: ",MAX_INT,0,1,0,100,100)
        self.niter_relax.label.SetToolTipNew("Reduce the relaxtion to zero linearly over this many iterations.")
        self.niter_relax.Disable()
        vbox.Add(self.niter_relax, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.chkbox.Hide()
        self.niter_relax.Hide()
        vbox.Add((-1, 5))
        self.SetAutoLayout(True)
        self.SetSizer( vbox )
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def __init__(self, parent):
        self.start_iter = None
        wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER)
        vbox = wx.BoxSizer(wx.VERTICAL)
        title = wx.StaticText(self, label="RAAR Algorithm")
        vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.exp_amps = TextPanelObject(self, "Exp Amp: ", "",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        vbox.Add(self.exp_amps, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.chkbox_sqrt_expamps = wx.CheckBox(self, -1, 'Square Root Exp Amp', (50, 10))
        self.chkbox_sqrt_expamps.SetValue(True)
        vbox.Add(self.chkbox_sqrt_expamps, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=5)
        self.support = TextPanelObject(self,"Support: ","",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        self.support.label.SetToolTipNew("Support. If empty, previous instance will be used.")
        vbox.Add(self.support, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.mask = TextPanelObject(self,"Mask: ","",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        vbox.Add(self.mask, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.beta = SpinnerObject(self,"Beta: ",1.0,0.0,0.01,0.9,100,100)
        vbox.Add(self.beta, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.niter = SpinnerObject(self,"Iterations: ",MAX_INT,1,1,1,100,100)
        vbox.Add(self.niter, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        vbox.Add((-1, 5))
        self.chkbox = CheckBoxNew(self, -1, 'Relax Modulus Constraint', size=(200, 20))
        self.chkbox.SetToolTipNew("Do not apply modulus constraint if the change in amplitude"+os.linesep+" is within the Poisson noise.")
        self.chkbox.Bind(wx.EVT_CHECKBOX, self.OnCheck)
        vbox.Add(self.chkbox, 0,flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2)
        self.niter_relax = SpinnerObject(self,"Relax iters: ",MAX_INT,0,1,0,100,100)
        self.niter_relax.label.SetToolTipNew("Reduce the relaxtion to zero linearly over this many iterations.")
        self.niter_relax.Disable()
        vbox.Add(self.niter_relax, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.chkbox.Hide()
        self.niter_relax.Hide()
        vbox.Add((-1, 5))
        self.SetAutoLayout(True)
        self.SetSizer( vbox )
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def __init__(self, parent):
        self.start_iter = None
        wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER)
        vbox = wx.BoxSizer(wx.VERTICAL)
        title = wx.StaticText(self, label="HPR Algorithm")
        vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.exp_amps = TextPanelObject(self, "Exp Amp: ", "",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        vbox.Add(self.exp_amps, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.chkbox_sqrt_expamps = wx.CheckBox(self, -1, 'Square Root Exp Amp', (50, 10))
        self.chkbox_sqrt_expamps.SetValue(True)
        vbox.Add(self.chkbox_sqrt_expamps, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=5)
        self.support = TextPanelObject(self,"Support: ","",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        self.support.label.SetToolTipNew("Support. If empty, previous instance will be used.")
        vbox.Add(self.support, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.mask = TextPanelObject(self,"Mask: ","",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        vbox.Add(self.mask, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.beta = SpinnerObject(self,"Beta: ",1.0,0.0,0.01,0.9,100,100)
        vbox.Add(self.beta, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.niter = SpinnerObject(self,"Iterations: ",MAX_INT,1,1,1,100,100)
        vbox.Add(self.niter, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        vbox.Add((-1, 5))
        self.chkbox = CheckBoxNew(self, -1, 'Relax Modulus Constraint', size=(200, 20))
        self.chkbox.SetToolTipNew("Do not apply modulus constraint if the change in amplitude"+os.linesep+" is within the Poisson noise.")
        self.chkbox.Bind(wx.EVT_CHECKBOX, self.OnCheck)
        vbox.Add(self.chkbox, 0,flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2)
        self.niter_relax = SpinnerObject(self,"Relax iters: ",MAX_INT,0,1,0,100,100)
        self.niter_relax.label.SetToolTipNew("Reduce the relaxtion to zero linearly over this many iterations.")
        self.niter_relax.Disable()
        vbox.Add(self.niter_relax, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.chkbox.Hide()
        self.niter_relax.Hide()
        vbox.Add((-1, 5))
        self.SetAutoLayout(True)
        self.SetSizer( vbox )
项目:bonsu    作者:bonsudev    | 项目源码 | 文件源码
def __init__(self, parent):
        self.start_iter = None
        wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER)
        vbox = wx.BoxSizer(wx.VERTICAL)
        title = wx.StaticText(self, label="HIO Algorithm")
        vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.exp_amps = TextPanelObject(self, "Exp Amp: ", "",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        vbox.Add(self.exp_amps, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.chkbox_sqrt_expamps = wx.CheckBox(self, -1, 'Square Root Exp Amp', (50, 10))
        self.chkbox_sqrt_expamps.SetValue(True)
        vbox.Add(self.chkbox_sqrt_expamps, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=5)
        self.support = TextPanelObject(self,"Support: ","",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        self.support.label.SetToolTipNew("Support. If empty, previous instance will be used.")
        vbox.Add(self.support, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.mask = TextPanelObject(self,"Mask: ","",100,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*")
        vbox.Add(self.mask, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.beta = SpinnerObject(self,"Beta: ",1.0,0.0,0.01,0.9,100,100)
        vbox.Add(self.beta, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.niter = SpinnerObject(self,"Iterations: ",MAX_INT,1,1,1,100,100)
        vbox.Add(self.niter, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        vbox.Add((-1, 5))
        self.chkbox = CheckBoxNew(self, -1, 'Relax Modulus Constraint', size=(200, 20))
        self.chkbox.SetToolTipNew("Do not apply modulus constraint if the change in amplitude"+os.linesep+" is within the Poisson noise.")
        self.chkbox.Bind(wx.EVT_CHECKBOX, self.OnCheck)
        vbox.Add(self.chkbox, 0,flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2)
        self.niter_relax = SpinnerObject(self,"Relax iters: ",MAX_INT,0,1,0,100,100)
        self.niter_relax.label.SetToolTipNew("Reduce the relaxtion to zero linearly over this many iterations.")
        self.niter_relax.Disable()
        vbox.Add(self.niter_relax, 0,  flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2)
        self.chkbox.Hide()
        self.niter_relax.Hide()
        vbox.Add((-1, 5))
        self.SetAutoLayout(True)
        self.SetSizer( vbox )
项目:imagepy    作者:Image-Py    | 项目源码 | 文件源码
def add_check(self, title, key):
        box = wx.BoxSizer(wx.HORIZONTAL)
        check = wx.CheckBox(self, -1, title)
        self.ctrl_dic[key] = check
        check.Bind(wx.EVT_CHECKBOX, lambda x : self.para_changed(key))
        box.Add(check, 1, wx.ALL, 5)
        self.lst.Add(box)
项目:Jackal_Velodyne_Duke    作者:MengGuo    | 项目源码 | 文件源码
def __attach_events(self):
        wx.EVT_BUTTON(self, self.button_ok.GetId(), self.OnOK)
        wx.EVT_BUTTON(self, self.button_cancel.GetId(), self.OnCancel)
        if self.show & SHOW_TIMEOUT:
            wx.EVT_CHECKBOX(self, self.checkbox_timeout.GetId(), self.OnTimeout)
项目:btc-fpga-miner    作者:marsohod4you    | 项目源码 | 文件源码
def __attach_events(self):
        wx.EVT_BUTTON(self, self.button_ok.GetId(), self.OnOK)
        wx.EVT_BUTTON(self, self.button_cancel.GetId(), self.OnCancel)
        if self.show & SHOW_TIMEOUT:
            wx.EVT_CHECKBOX(self, self.checkbox_timeout.GetId(), self.OnTimeout)
项目:LalkaChat    作者:DeForce    | 项目源码 | 文件源码
def create_checkbox(**kwargs):
        panel = kwargs.get('panel')
        value = kwargs.get('value')
        key = kwargs.get('key')
        bind = kwargs.get('bind')

        item_sizer = wx.BoxSizer(wx.HORIZONTAL)
        style = wx.ALIGN_CENTER_VERTICAL
        item_key = MODULE_KEY.join(key)
        item_box = wx.CheckBox(panel, id=id_renew(item_key, update=True),
                               label=translate_key(item_key), style=style)
        item_box.SetValue(value)
        item_box.Bind(wx.EVT_CHECKBOX, bind)
        item_sizer.Add(item_box, 0, wx.ALIGN_LEFT)
        return {'item': item_sizer}
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def __init__(self, *args, **kwargs):
        super(EncapsulatedCheckBox, self).__init__(*args, **kwargs)    
        self.control.Bind(wx.EVT_CHECKBOX, self.on_change)
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def bind(self, handler, id):
        self._uiobj.Bind(wx.EVT_CHECKBOX, handler, id=id)
项目:steam-vr-wheel    作者:mdovgialo    | 项目源码 | 文件源码
def __init__(self):

        self.app = wx.App()
        self.window = wx.Frame(None, title="Steam Vr Wheel Configuration")
        self.pnl = wx.Panel(self.window)
        self.vbox = wx.BoxSizer(wx.VERTICAL)
        self.trigger_pre_btn_box = wx.CheckBox(self.pnl, label='Triggers pre press button')
        self.trigger_btn_box = wx.CheckBox(self.pnl, label='Triggers press button')
        self.multibutton_trackpad_box = wx.CheckBox(self.pnl, label='5 Button touchpad')
        self.multibutton_trackpad_center_haptic_box = wx.CheckBox(self.pnl,
                                                                  label='Haptic feedback for trackpad button zones')
        self.touchpad_always_updates_box = wx.CheckBox(self.pnl, label='Touchpad mapping to axis while untouched (axis move to center when released)')
        self.vertical_wheel_box = wx.CheckBox(self.pnl, label='Steering wheel is vertical')
        self.joystick_updates_only_when_grabbed_box = wx.CheckBox(self.pnl, label='Joystick moves only when grabbed (by right grip)')
        self.joystick_grabbing_switch_box = wx.CheckBox(self.pnl, label='Joystick grab is a switch')
        self.edit_mode_box = wx.CheckBox(self.pnl, label='Layout edit mode')

        self.trigger_pre_btn_box.Bind(wx.EVT_CHECKBOX, self.config_change)
        self.trigger_btn_box.Bind(wx.EVT_CHECKBOX, self.config_change)
        self.multibutton_trackpad_box.Bind(wx.EVT_CHECKBOX, self.config_change)
        self.multibutton_trackpad_center_haptic_box.Bind(wx.EVT_CHECKBOX, self.config_change)
        self.touchpad_always_updates_box.Bind(wx.EVT_CHECKBOX, self.config_change)
        self.vertical_wheel_box.Bind(wx.EVT_CHECKBOX, self.config_change)
        self.joystick_updates_only_when_grabbed_box.Bind(wx.EVT_CHECKBOX, self.config_change)
        self.joystick_grabbing_switch_box.Bind(wx.EVT_CHECKBOX, self.config_change)
        self.edit_mode_box.Bind(wx.EVT_CHECKBOX, self.config_change)

        self._config_map = dict(trigger_pre_press_button=self.trigger_pre_btn_box,
                                trigger_press_button=self.trigger_btn_box,
                                multibutton_trackpad=self.multibutton_trackpad_box,
                                multibutton_trackpad_center_haptic=self.multibutton_trackpad_center_haptic_box,
                                touchpad_always_updates=self.touchpad_always_updates_box,
                                vertical_wheel=self.vertical_wheel_box,
                                joystick_updates_only_when_grabbed=self.joystick_updates_only_when_grabbed_box,
                                joystick_grabbing_switch=self.joystick_grabbing_switch_box,
                                edit_mode=self.edit_mode_box
                                )

        self.vbox.Add(self.trigger_pre_btn_box)
        self.vbox.Add(self.trigger_btn_box)
        self.vbox.Add(self.multibutton_trackpad_box)
        self.vbox.Add(self.multibutton_trackpad_center_haptic_box)
        self.vbox.Add(self.touchpad_always_updates_box)
        self.vbox.Add(self.vertical_wheel_box)
        self.vbox.Add(self.joystick_updates_only_when_grabbed_box)
        self.vbox.Add(self.joystick_grabbing_switch_box)
        self.vbox.Add(self.edit_mode_box)

        self.pnl.SetSizer(self.vbox)
        self.read_config()
        self.window.Show(True)
项目:pyDataView    作者:edwardsmith999    | 项目源码 | 文件源码
def set_bindings(self):

        self.Bind(wx.EVT_RADIOBOX, self.handle_plottype, 
                  self.choosep.plottype_p.fieldradiobox)
        self.Bind(wx.EVT_RADIOBOX, self.handle_fieldtype, 
                  self.choosep.fieldtype_p.fieldradiobox)
        self.Bind(wx.EVT_COMBOBOX, self.handle_component, 
                  self.choosep.component_p.componentcombobox)
        self.Bind(wx.EVT_COMBOBOX, self.handle_normal, 
                  self.choosep.component_p.normalcombobox)

        self.Bind(wx.EVT_COMMAND_SCROLL_THUMBTRACK, self.handle_recslider, 
                  self.slidersp.recslider.slider)
        self.Bind(wx.EVT_COMMAND_SCROLL_THUMBTRACK, self.handle_binslider, 
                  self.slidersp.binslider.slider)
        self.Bind(wx.EVT_COMMAND_SCROLL_CHANGED, self.handle_recslider, 
                  self.slidersp.recslider.slider)
        self.Bind(wx.EVT_COMMAND_SCROLL_CHANGED, self.handle_binslider, 
                  self.slidersp.binslider.slider)
        self.Bind(wx.EVT_TEXT_ENTER, self.handle_rectxt,
                  self.slidersp.recslider.slidertext)
        self.Bind(wx.EVT_TEXT_ENTER, self.handle_bintxt,
                  self.slidersp.binslider.slidertext)

        self.Bind(wx.EVT_SPINCTRL, self.handle_recspin,
                  self.slidersp.recslider.spin)
        self.Bind(wx.EVT_SPINCTRL, self.handle_binspin,
                  self.slidersp.binslider.spin)

        self.Bind(wx.EVT_CHECKBOX, self.handle_autoscale, 
                  self.choosep.autoscale_b) 
        self.Bind(wx.EVT_TEXT_ENTER, self.handle_minscale, 
                  self.choosep.minpspin) 
        self.Bind(wx.EVT_TEXT_ENTER, self.handle_maxscale, 
                  self.choosep.maxpspin) 

        self.choosep.save_b.Bind(wx.EVT_BUTTON, 
                                 lambda event: self.save_dialogue(event, 'fig.png'))
        self.choosep.save_d.Bind(wx.EVT_BUTTON, 
                                 lambda event: self.save_dialogue(event, 'data.csv'))
        self.choosep.save_s.Bind(wx.EVT_BUTTON, 
                                 lambda event: self.save_dialogue(event, 'script.py'))
项目:beremiz    作者:nucleron    | 项目源码 | 文件源码
def __init__(self, parent, controller, tagname, initial=False):
        """
        Constructor
        @param parent: Parent wx.Window of dialog for modal
        @param controller: Reference to project controller
        @param tagname: Tagname of project POU edited
        @param initial: True if step is initial (default: False)
        """
        BlockPreviewDialog.__init__(self, parent, controller, tagname,
                                    title=_('Edit Step'))

        # Init common sizers
        self._init_sizers(2, 0, 6, None, 2, 1)

        # Create label for SFC step name
        name_label = wx.StaticText(self, label=_('Name:'))
        self.LeftGridSizer.AddWindow(name_label, flag=wx.GROW)

        # Create text control for defining SFC step name
        self.StepName = wx.TextCtrl(self)
        self.Bind(wx.EVT_TEXT, self.OnNameChanged, self.StepName)
        self.LeftGridSizer.AddWindow(self.StepName, flag=wx.GROW)

        # Create label for SFC step connectors
        connectors_label = wx.StaticText(self, label=_('Connectors:'))
        self.LeftGridSizer.AddWindow(connectors_label, flag=wx.GROW)

        # Create check boxes for defining connectors available on SFC step
        self.ConnectorsCheckBox = {}
        for name, label in [("input", _("Input")),
                            ("output", _("Output")),
                            ("action", _("Action"))]:
            check_box = wx.CheckBox(self, label=label)
            if name == "output" or (name == "input" and not initial):
                check_box.SetValue(True)
            self.Bind(wx.EVT_CHECKBOX, self.OnConnectorsChanged, check_box)
            self.LeftGridSizer.AddWindow(check_box, flag=wx.GROW)
            self.ConnectorsCheckBox[name] = check_box

        # Add preview panel and associated label to sizers
        self.RightGridSizer.AddWindow(self.PreviewLabel, flag=wx.GROW)
        self.RightGridSizer.AddWindow(self.Preview, flag=wx.GROW)

        # Add buttons sizer to sizers
        self.MainSizer.AddSizer(
            self.ButtonSizer, border=20,
            flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)

        # Save flag that indicates that step is initial
        self.Initial = initial

        # Set default name for step
        self.StepName.ChangeValue(controller.GenerateNewName(
               tagname, None, "Step%d", 0))

        self.Fit()

        # Step name text control is default control having keyboard focus
        self.StepName.SetFocus()
项目:smartschool    作者:asifkodur    | 项目源码 | 文件源码
def __init__(self, *args, **kwds):
        # begin wxGlade: sampoorna_win.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0)
        self.login_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_login = wx.Panel(self.login_pane, wx.ID_ANY)
        self.label_1 = wx.StaticText(self.panel_login, wx.ID_ANY, _("Warning: Always backup your database before you proceed to avoid potential data loss !!!"))
        self.label_2 = wx.StaticText(self.panel_login, wx.ID_ANY, _("This software does not save Sampoorna credentials. It is used for one time login"))
        self.panel_1 = wx.Panel(self.panel_login, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.TAB_TRAVERSAL)
        self.label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Sampoorna Username"))
        self.text_ctrl_user = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.NO_BORDER)
        self.label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Sampoorna Password"))
        self.text_ctrl_passw = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PASSWORD | wx.NO_BORDER)
        self.button_next = wx.Button(self.panel_login, wx.ID_ANY, _("Next >>"))
        self.standard_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_3 = wx.Panel(self.standard_pane, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.STATIC_BORDER | wx.TAB_TRAVERSAL)
        self.checkbox_8 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("8 Standard"))
        self.checkbox_9 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("9 Standard"))
        self.checkbox_10 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("10 Standard"))
        self.button_next_copy_copy = wx.Button(self.standard_pane, wx.ID_ANY, _("<<Previous"))
        self.button_next_copy = wx.Button(self.standard_pane, wx.ID_ANY, _("Proceed >>"))
        self.report_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_2 = wx.Panel(self.report_pane, wx.ID_ANY)
        self.label_7 = wx.StaticText(self.panel_2, wx.ID_ANY, _("Progress"))
        self.progresss_total = wx.TextCtrl(self.panel_2, wx.ID_ANY, "")
        self.progress_each = wx.TextCtrl(self.panel_2, wx.ID_ANY, "")
        self.label_satus = wx.StaticText(self.panel_2, wx.ID_ANY, _("Status"))
        self.text_ctrl_1 = wx.TextCtrl(self.panel_2, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL | wx.NO_BORDER)
        self.button_finished = wx.Button(self.panel_2, wx.ID_ANY, _("Finished"))

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TEXT_ENTER, self.on_password_enter, self.text_ctrl_passw)
        self.Bind(wx.EVT_BUTTON, self.on_next, self.button_next)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_8)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_9)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_10)
        self.Bind(wx.EVT_BUTTON, self.on_previous, self.button_next_copy_copy)
        self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_next_copy)
        self.Bind(wx.EVT_BUTTON, self.on_finished, self.button_finished)
        # end wxGlade
项目:smartschool    作者:asifkodur    | 项目源码 | 文件源码
def __init__(self, *args, **kwds):
        # begin wxGlade: sampoorna_win.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0)
        self.login_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_login = wx.Panel(self.login_pane, wx.ID_ANY)
        self.label_1 = wx.StaticText(self.panel_login, wx.ID_ANY, _("Warning: Always backup your database before you proceed to avoid potential data loss !!!"))
        self.label_2 = wx.StaticText(self.panel_login, wx.ID_ANY, _("This software does not save Sampoorna credentials. It is used for one time login"))
        self.panel_1 = wx.Panel(self.panel_login, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.TAB_TRAVERSAL)
        self.label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Sampoorna Username"))
        self.text_ctrl_user = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.NO_BORDER)
        self.label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, _("Sampoorna Password"))
        self.text_ctrl_passw = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PASSWORD | wx.NO_BORDER)
        self.button_next = wx.Button(self.panel_login, wx.ID_ANY, _("Next >>"))
        self.standard_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_3 = wx.Panel(self.standard_pane, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.STATIC_BORDER | wx.TAB_TRAVERSAL)
        self.checkbox_8 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("8 Standard"))
        self.checkbox_9 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("9 Standard"))
        self.checkbox_10 = wx.CheckBox(self.panel_3, wx.ID_ANY, _("10 Standard"))
        self.button_previous = wx.Button(self.standard_pane, wx.ID_ANY, _("<<Previous"))
        self.button_proceed = wx.Button(self.standard_pane, wx.ID_ANY, _("Proceed >>"))
        self.report_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_2 = wx.Panel(self.report_pane, wx.ID_ANY)
        self.label_7 = wx.StaticText(self.panel_2, wx.ID_ANY, _("Progress"))
        self.progresss_total = wx.Gauge(self.panel_2, wx.ID_ANY, range=100)
        self.progress_each = wx.Gauge(self.panel_2, wx.ID_ANY, range=100)
        self.label_satus = wx.StaticText(self.panel_2, wx.ID_ANY, _("Status"))
        self.list_ctrl_1 = wx.ListCtrl(self.panel_2, wx.ID_ANY, style=wx.LC_REPORT | wx.LC_ALIGN_LEFT | wx.SUNKEN_BORDER | wx.NO_BORDER)
        self.button_finished = wx.Button(self.panel_2, wx.ID_ANY, _("Finished"))

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TEXT, self.on_user_pass_text, self.text_ctrl_passw)
        self.Bind(wx.EVT_TEXT, self.on_user_pass_text, self.text_ctrl_user)
        self.Bind(wx.EVT_BUTTON, self.on_next, self.button_next)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_8)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_9)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_10)
        self.Bind(wx.EVT_BUTTON, self.on_previous, self.button_previous)
        self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_proceed)
        self.Bind(wx.EVT_BUTTON, self.on_finished, self.button_finished)

        # create a pubsub receiver
        Publisher().subscribe(self.updateDisplay, "update")
        # end wxGlade
项目:smartschool    作者:asifkodur    | 项目源码 | 文件源码
def __init__(self, *args, **kwds):
        # begin wxGlade: consolidated_report.__init__
        kwds["style"] = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX  | wx.FRAME_FLOAT_ON_PARENT 
        wx.Dialog.__init__(self, *args, **kwds)
        self.panel_1 = wx.Panel(self, -1)
        self.combo_box_1 = wx.ComboBox(self.panel_1, -1, choices=[], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY)
        self.combo_box_2 = wx.ComboBox(self.panel_1, -1, choices=["Select Standard", "8", "9", "10"], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY)
        self.combo_box_3 = wx.ComboBox(self.panel_1, -1, choices=["Select Division"], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY)
        self.combo_box_4 = wx.ComboBox(self.panel_1, -1, choices=["Select Term","Term1","Term2","Annual"], style=wx.CB_DROPDOWN | wx.CB_SIMPLE | wx.CB_DROPDOWN | wx.CB_READONLY)
        self.label_1 = wx.StaticText(self.panel_1, -1, "Select What to Include")
        self.checkbox_1 = wx.CheckBox(self.panel_1, -1, "CE")
        self.checkbox_2 = wx.CheckBox(self.panel_1, -1, "TE")
        self.checkbox_3 = wx.CheckBox(self.panel_1, -1, "Total")
        self.checkbox_4 = wx.CheckBox(self.panel_1, -1, "Grade")
        self.checkbox_5 = wx.CheckBox(self.panel_1, -1, "CE Total")
        self.checkbox_6 = wx.CheckBox(self.panel_1, -1, "TE Total")
        self.checkbox_7 = wx.CheckBox(self.panel_1, -1, "Grand Total")

        allLoc = ['Select All']
        list2=['I Language','Malayalam','English','Hindi','S.S','Physics','Biology','Chemistry','Maths','IT']
        self.check_list_box_1 = wx.CheckListBox(self.panel_1, -1, (60, 50), (30,30), allLoc)
        self.check_list_box_2 = wx.CheckListBox(self.panel_1, -1, (60, 50), wx.DefaultSize, list2)
        self.button_1 = wx.Button(self.panel_1, -1, "Close")
        self.button_2 = wx.Button(self.panel_1, -1, "Proceed")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_COMBOBOX, self.oncombo_year, self.combo_box_1)
        self.Bind(wx.EVT_COMBOBOX, self.oncombo_class, self.combo_box_2)
        self.Bind(wx.EVT_COMBOBOX, self.oncombo_div, self.combo_box_3)
        self.Bind(wx.EVT_COMBOBOX, self.oncombo_term, self.combo_box_4)

        self.Bind(wx.EVT_CHECKLISTBOX, self.on_check, self.check_list_box_1)
        self.Bind(wx.EVT_CHECKLISTBOX, self.on_check_2, self.check_list_box_2)
        self.Bind(wx.EVT_BUTTON, self.on_close, self.button_1)
        self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_2)

        self.Bind(wx.EVT_CHECKBOX, self.on_check_ce, self.checkbox_1)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_te, self.checkbox_2)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_tota, self.checkbox_3)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_grade, self.checkbox_4)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_ce_total, self.checkbox_5)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_te_total, self.checkbox_6)
        self.Bind(wx.EVT_CHECKBOX, self.on_check_grand, self.checkbox_7)
        self.checkedItems=()
        self.checkedItems_2=[0,1,2,3]
        self.DB=db_operations()

        self.Selected_Index=[]
        self.YEAR=''
        self.CLASS=''
        self.DIV=''
        self.TERM=''

        self.load_year()
        # end wxGlade
项目:smartschool    作者:asifkodur    | 项目源码 | 文件源码
def __init__(self, *args, **kwds):
        # begin wxGlade: sampoorna_win.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0)
        self.login_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_login = wx.Panel(self.login_pane, wx.ID_ANY)
        self.label_1 = wx.StaticText(self.panel_login, wx.ID_ANY, ("Warning: Always backup your database before you proceed to avoid potential data loss !!!"))
        self.label_2 = wx.StaticText(self.panel_login, wx.ID_ANY, ("This software does not save Sampoorna credentials. It is used for one time login"))
        self.panel_1 = wx.Panel(self.panel_login, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.TAB_TRAVERSAL)
        self.label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Sampoorna Username"))
        self.text_ctrl_user = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.NO_BORDER)
        self.label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Sampoorna Password"))
        self.text_ctrl_passw = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PASSWORD | wx.NO_BORDER)
        self.button_next = wx.Button(self.panel_login, wx.ID_ANY, ("Next >>"))
        self.standard_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_3 = wx.Panel(self.standard_pane, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.STATIC_BORDER | wx.TAB_TRAVERSAL)
        self.checkbox_8 = wx.CheckBox(self.panel_3, wx.ID_ANY, ("8 Standard"))
        self.checkbox_9 = wx.CheckBox(self.panel_3, wx.ID_ANY, ("9 Standard"))
        self.checkbox_10 = wx.CheckBox(self.panel_3, wx.ID_ANY, ("10 Standard"))
        self.button_previous = wx.Button(self.standard_pane, wx.ID_ANY, ("<<Previous"))
        self.button_proceed = wx.Button(self.standard_pane, wx.ID_ANY, ("Proceed >>"))
        self.report_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_2 = wx.Panel(self.report_pane, wx.ID_ANY)
        self.label_7 = wx.StaticText(self.panel_2, wx.ID_ANY, ("Progress"))
        self.progresss_total = wx.Gauge(self.panel_2, wx.ID_ANY, range=100)
        self.label_progress_perc =  wx.StaticText(self.panel_2, wx.ID_ANY, (""))
        self.label_satus = wx.StaticText(self.panel_2, wx.ID_ANY, ("Status"))
        #self.list_ctrl_1 = wx.ListCtrl(self.panel_2, wx.ID_ANY, style=wx.LC_REPORT | wx.LC_ALIGN_LEFT | wx.SUNKEN_BORDER | wx.NO_BORDER)
        self.text_ctrl_report = wx.TextCtrl(self.panel_2, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL | wx.NO_BORDER)

        self.button_finished = wx.Button(self.panel_2, wx.ID_ANY, ("Abort"))

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TEXT, self.on_user_pass_text, self.text_ctrl_passw)
        self.Bind(wx.EVT_TEXT, self.on_user_pass_text, self.text_ctrl_user)
        self.Bind(wx.EVT_BUTTON, self.on_next, self.button_next)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_8)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_9)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_10)
        self.Bind(wx.EVT_BUTTON, self.on_previous, self.button_previous)
        self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_proceed)
        self.Bind(wx.EVT_BUTTON, self.on_finished, self.button_finished)

        # create a pubsub receiver
        Publisher().subscribe(self.update_display, "update")
        Publisher().subscribe(self.final_report, "report")
        Publisher().subscribe(self.update_progress_bar, "progress_bar")
        Publisher().subscribe(self.update_current_class, "change_class")

        # end wxGlade
项目:smartschool    作者:asifkodur    | 项目源码 | 文件源码
def __init__(self, *args, **kwds):
        # begin wxGlade: sampoorna_win.__init__
        kwds["style"] = wx.CAPTION | wx.CLOSE_BOX |  wx.MAXIMIZE | wx.MAXIMIZE_BOX | wx.SYSTEM_MENU | wx.RESIZE_BORDER | wx.CLIP_CHILDREN
        wx.Dialog.__init__(self, *args, **kwds)
        self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=0)
        self.login_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_login = wx.Panel(self.login_pane, wx.ID_ANY)
        self.label_1 = wx.StaticText(self.panel_login, wx.ID_ANY, ("Warning: Always backup your database before you proceed to avoid potential data loss !!!"))
        self.label_2 = wx.StaticText(self.panel_login, wx.ID_ANY, ("This software does not save Sampoorna username or password. It is used for one time login"))
        self.panel_1 = wx.Panel(self.panel_login, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.TAB_TRAVERSAL)
        self.label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Sampoorna Username"))
        self.text_ctrl_user = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.NO_BORDER)
        self.label_4 = wx.StaticText(self.panel_1, wx.ID_ANY, ("Sampoorna Password"))
        self.text_ctrl_passw = wx.TextCtrl(self.panel_1, wx.ID_ANY, "", style=wx.TE_PROCESS_ENTER | wx.TE_PASSWORD | wx.NO_BORDER)
        self.button_next = wx.Button(self.panel_login, wx.ID_ANY, ("Next >>"))
        self.standard_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_3 = wx.Panel(self.standard_pane, wx.ID_ANY, style=wx.SUNKEN_BORDER | wx.RAISED_BORDER | wx.STATIC_BORDER | wx.TAB_TRAVERSAL)
        self.checkbox_8 = wx.CheckBox(self.panel_3, wx.ID_ANY, ("8 Standard"))
        self.checkbox_9 = wx.CheckBox(self.panel_3, wx.ID_ANY, ("9 Standard"))
        self.checkbox_10 = wx.CheckBox(self.panel_3, wx.ID_ANY, ("10 Standard"))
        self.button_previous = wx.Button(self.standard_pane, wx.ID_ANY, ("<<Previous"))
        self.button_proceed = wx.Button(self.standard_pane, wx.ID_ANY, ("Proceed >>"))
        self.report_pane = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.panel_2 = wx.Panel(self.report_pane, wx.ID_ANY)
        self.label_7 = wx.StaticText(self.panel_2, wx.ID_ANY, ("Progress"))
        self.progresss_total = wx.Gauge(self.panel_2, wx.ID_ANY, range=100)
        self.progress_each =wx.StaticText(self.panel_2, wx.ID_ANY)# wx.TextCtrl(self.panel_2, wx.ID_ANY, "", style=wx.TE_READONLY)
        self.label_satus = wx.StaticText(self.panel_2, wx.ID_ANY, ("Status"))
        self.text_ctrl_report = wx.TextCtrl(self.panel_2, wx.ID_ANY, "", style=wx.TE_MULTILINE | wx.TE_READONLY | wx.HSCROLL | wx.NO_BORDER)
        self.button_finished = wx.Button(self.panel_2, wx.ID_ANY, ("Abort"))

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_TEXT, self.on_user_pass_text, self.text_ctrl_passw)
        self.Bind(wx.EVT_TEXT, self.on_user_pass_text, self.text_ctrl_user)
        self.Bind(wx.EVT_BUTTON, self.on_next, self.button_next)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_8)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_9)
        self.Bind(wx.EVT_CHECKBOX, self.on_check, self.checkbox_10)
        self.Bind(wx.EVT_BUTTON, self.on_previous, self.button_previous)
        self.Bind(wx.EVT_BUTTON, self.on_proceed, self.button_proceed)
        self.Bind(wx.EVT_BUTTON, self.on_finished, self.button_finished)
        # end wxGlade


        # create a pubsub receiver
        Publisher().subscribe(self.update_display, "update")
        Publisher().subscribe(self.final_report, "report")
        Publisher().subscribe(self.update_progress_bar, "progress_bar")
        Publisher().subscribe(self.update_current_class, "change_class")
项目:BigBrotherBot-For-UrT43    作者:ptitbigorneau    | 项目源码 | 文件源码
def SetupToolBar(self):
        """Create the toolbar for common actions"""
        tb = self.CreateToolBar(self.TBFLAGS)
        tsize = (24, 24)
        tb.ToolBitmapSize = tsize
        open_bmp = wx.ArtProvider.GetBitmap(wx.ART_FILE_OPEN, wx.ART_TOOLBAR,
                                            tsize)
        tb.AddLabelTool(ID_OPEN, "Open", open_bmp, shortHelp="Open",
                        longHelp="Open a (c)Profile trace file")
        tb.AddSeparator()
#        self.Bind(wx.EVT_TOOL, self.OnOpenFile, id=ID_OPEN)
        self.rootViewTool = tb.AddLabelTool(
            ID_ROOT_VIEW, _("Root View"),
            wx.ArtProvider.GetBitmap(wx.ART_GO_HOME, wx.ART_TOOLBAR, tsize),
            shortHelp=_("Display the root of the current view tree (home view)")
        )
        self.rootViewTool = tb.AddLabelTool(
            ID_BACK_VIEW, _("Back"),
            wx.ArtProvider.GetBitmap(wx.ART_GO_BACK, wx.ART_TOOLBAR, tsize),
            shortHelp=_("Back to the previously activated node in the call tree")
        )
        self.upViewTool = tb.AddLabelTool(
            ID_UP_VIEW, _("Up"),
            wx.ArtProvider.GetBitmap(wx.ART_GO_UP, wx.ART_TOOLBAR, tsize),
            shortHelp=_("Go one level up the call tree (highest-percentage parent)")
        )
        tb.AddSeparator()
        # TODO: figure out why the control is sizing the label incorrectly on Linux
        self.percentageViewTool = wx.CheckBox(tb, -1, _("Percent    "))
        self.percentageViewTool.SetToolTip(wx.ToolTip(
            _("Toggle display of percentages in list views")))
        tb.AddControl(self.percentageViewTool)
        wx.EVT_CHECKBOX(self.percentageViewTool,
                        self.percentageViewTool.GetId(), self.OnPercentageView)

        self.packageViewTool = wx.CheckBox(tb, -1, _("File View    "))
        self.packageViewTool.SetToolTip(wx.ToolTip(
            _("Switch between call-hierarchy and package/module/function hierarchy")))
        tb.AddControl(self.packageViewTool)
        wx.EVT_CHECKBOX(self.packageViewTool, self.packageViewTool.GetId(),
                        self.OnPackageView)
        tb.Realize()
项目:GRIPy    作者:giruenf    | 项目源码 | 文件源码
def __init__(self, data_index_uid, display, is_range, min_idx, max_idx, *args, **kwargs):
        super(DimensionPanel, self).__init__(*args, **kwargs)
        self.SetSize(300, 50)
        #
        self.data_index_uid = data_index_uid
        OM =  ObjectManager(self)
        obj = OM.get(data_index_uid)
        #
        main_sizer = wx.StaticBoxSizer(wx.VERTICAL, self, obj.name)
        #
        self.top_panel = wx.Panel(self)
        self.top_sizer = wx.BoxSizer(wx.HORIZONTAL)
        #
        self.check_display = wx.CheckBox(self.top_panel, -1, label='Display')  
        self.check_display.Bind(wx.EVT_CHECKBOX, self._on_check_display)                  
        self.top_sizer.Add(self.check_display, 1, wx.ALIGN_CENTER|wx.LEFT, 30)
        #
        self.check_range = wx.CheckBox(self.top_panel, -1, label='Range')
        self.check_range.Bind(wx.EVT_CHECKBOX, self._on_check_range)   
        self.top_sizer.Add(self.check_range, 1, wx.ALIGN_CENTER|wx.RIGHT, 30)
        self.top_panel.SetSizer(self.top_sizer)
        #
        main_sizer.Add(self.top_panel, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 3)
        #
        self.label = obj.name
        self.vec = obj.data
        self.display = display
        self.is_range = is_range
        #
        self.bottom_panel = wx.Panel(self)
        self.bottom_sizer = wx.BoxSizer(wx.VERTICAL)
        self.slider = RangeSlider(self.bottom_panel)
        self.bottom_sizer.Add(self.slider, 0, wx.EXPAND)
        self.text_value = wx.StaticText(self.bottom_panel, -1)
        self.bottom_sizer.Add(self.text_value, 0, wx.ALIGN_CENTER)
        self.bottom_panel.SetSizer(self.bottom_sizer)
        #
        main_sizer.Add(self.bottom_panel, 0, wx.EXPAND)
        #
        self.slider.SetRange(0, len(self.vec)-1)
        self.min_idx = min_idx
        self.max_idx = max_idx
        #
        if self.display:
            self.set_check_display(1)
        else:
            self.set_check_display(0)
        # 
        self.Bind(wx.EVT_PAINT, self._on_paint)
        self.SetSizer(main_sizer)
        main_sizer.Layout()