我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用wx.CheckBox()。
def InitUI(self): #draw the pannel wx.StaticText(self, label='Select elements to download to local storage', pos=(30, 5)) self.cb_conf = wx.CheckBox(self, label='Config',pos = (80,30)) self.cb_logs = wx.CheckBox(self, label='Logs',pos = (80,55)) self.cb_cron = wx.CheckBox(self, label='Crontab',pos = (80,80)) self.cb_pics = wx.CheckBox(self, label='Photos',pos = (80,105)) self.cb_graph = wx.CheckBox(self, label='Graphs',pos = (80,130)) #right side self.cb_all = wx.CheckBox(self, label='Back up\nWhole Pigrow Folder',pos = (270,75)) #progress bar wx.StaticText(self, label='saving to; '+ localfiles_info_pnl.local_path, pos=(15, 155)) self.current_file_txt = wx.StaticText(self, label='--', pos=(30, 190)) self.current_dest_txt = wx.StaticText(self, label='--', pos=(30, 215)) #buttons self.start_download_btn = wx.Button(self, label='Download files', pos=(40, 240), size=(175, 50)) self.start_download_btn.Bind(wx.EVT_BUTTON, self.start_download_click) self.close_btn = wx.Button(self, label='Close', pos=(415, 240), size=(175, 50)) self.close_btn.Bind(wx.EVT_BUTTON, self.OnClose) ## universal controls pnl = wx.Panel(self)
def addCheckBoxes(self): # Regular Box Sizer boxSizerH = wx.BoxSizer(wx.HORIZONTAL) chk1 = wx.CheckBox(self.panel, label='Disabled') chk1.SetValue(True) chk1.Disable() boxSizerH.Add(chk1) chk2 = wx.CheckBox(self.panel, label='UnChecked') boxSizerH.Add(chk2, flag=wx.LEFT, border=10) chk3 = wx.CheckBox(self.panel, label='Toggle') boxSizerH.Add(chk3, flag=wx.LEFT, border=10) chk3.SetValue(True) # Add Regular Box Sizer to StaticBox sizer self.statBoxSizerV.Add(boxSizerH, flag=wx.LEFT, border=10) self.statBoxSizerV.Add((0, 8)) #----------------------------------------------------------
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()
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()
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)
def __init__(self, *args, **kwds): # begin wxGlade: Dialog_snapshot.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER wx.Dialog.__init__(self, *args, **kwds) self.label_1 = wx.StaticText(self, wx.ID_ANY, "Nombre:") self.nombre_snap = wx.TextCtrl(self, wx.ID_ANY, "") self.label_2 = wx.StaticText(self, wx.ID_ANY, u"Descripci\u00f3n:") self.descripcion_snap = wx.TextCtrl(self, wx.ID_ANY, "") self.checkbox_memory = wx.CheckBox(self, wx.ID_ANY, "memory") self.checkbox_quiesce = wx.CheckBox(self, wx.ID_ANY, "quiesce") self.snap_ok = wx.Button(self, wx.ID_OK, "OK") self.snap_cancel = wx.Button(self, wx.ID_CANCEL, "Cancel") self.__set_properties() self.__do_layout() # end wxGlade
def makeSettings(self, settingsSizer): # Translators: This is the static text of the Quick Profile Wizard dialog. msgIntro=_("Choose which options you want to reset to the default value for the Lambdas profile") self.introStxt=wx.StaticText(self,-1,label=msgIntro) settingsSizer.Add(self.introStxt,flag=wx.BOTTOM) # Translators: This is the label for a checkbox in the # Quick Profile Wizard dialog. self.defaultTranslationTableCheckBox=wx.CheckBox(self,wx.NewId(),label=_("Keep the LAMBDA braille table for the current language (%s)") % TABLE_NAME) self.defaultTranslationTableCheckBox.SetValue(True) settingsSizer.Add(self.defaultTranslationTableCheckBox,border=10,flag=wx.BOTTOM) # Translators: This is the label for a checkbox in the # Quick Profile Wizard dialog. self.brailleTetherToFocusCheckBox=wx.CheckBox(self,wx.NewId(),label=_("Set the braille cursor to tether the focus")) self.brailleTetherToFocusCheckBox.SetValue(True) settingsSizer.Add(self.brailleTetherToFocusCheckBox,border=10,flag=wx.BOTTOM) # Translators: This is the label for a checkbox in the # Quick Profile Wizard dialog. self.disableReadByParagraphCheckBox=wx.CheckBox(self,wx.NewId(),label=_("Disable the Braille reading by paragraph")) self.disableReadByParagraphCheckBox.SetValue(True) settingsSizer.Add(self.disableReadByParagraphCheckBox,border=10,flag=wx.BOTTOM) # Translators: This is the label for a checkbox in the # Quick Profile Wizard dialog. self.disableBrailleWordWrapCheckBox=wx.CheckBox(self,wx.NewId(),label=_("Disable word wrappping of the braille line")) self.disableBrailleWordWrapCheckBox.SetValue(True) settingsSizer.Add(self.disableBrailleWordWrapCheckBox,border=10,flag=wx.BOTTOM)
def InitUI(self): #draw the pannel wx.StaticText(self, label='Select elements to upload from local storage to pi\n\n ** Warning this will overwrite current pigrow files \n which may result in loss of data **', pos=(30, 5)) self.cb_conf = wx.CheckBox(self, label='Config',pos = (80,90)) self.cb_logs = wx.CheckBox(self, label='Logs',pos = (80,115)) self.cb_cron = wx.CheckBox(self, label='Crontab',pos = (80,140)) self.cb_pics = wx.CheckBox(self, label='Photos',pos = (80,165)) self.cb_graph = wx.CheckBox(self, label='Graphs',pos = (80,190)) #right side self.cb_all = wx.CheckBox(self, label='Restore Back up\nof whole Pigrow Folder',pos = (270,130)) #progress bar wx.StaticText(self, label='uploading from; '+ localfiles_info_pnl.local_path, pos=(15, 215)) self.current_file_txt = wx.StaticText(self, label='--', pos=(30, 245)) self.current_dest_txt = wx.StaticText(self, label='--', pos=(30, 270)) #buttons self.start_upload_btn = wx.Button(self, label='Upload files', pos=(40, 300), size=(175, 50)) self.start_upload_btn.Bind(wx.EVT_BUTTON, self.start_upload_click) self.close_btn = wx.Button(self, label='Close', pos=(415, 300), size=(175, 50)) self.close_btn.Bind(wx.EVT_BUTTON, self.OnClose) ## universal controls pnl = wx.Panel(self)
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.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) self.SetAutoLayout(True) self.SetSizer( vbox )
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 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) self.SetAutoLayout(True) self.SetSizer( vbox )
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="Phase-Only 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) self.SetAutoLayout(True) self.SetSizer( vbox )
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 with positivity constraint") 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) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self, *args, **kwds): self.settings = kwds['settings'] del kwds['settings'] # begin wxGlade: TerminalSettingsDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.checkbox_echo = wx.CheckBox(self, -1, "Local Echo") self.checkbox_unprintable = wx.CheckBox(self, -1, "Show unprintable characters") self.radio_box_newline = wx.RadioBox(self, -1, "Newline Handling", choices=["CR only", "LF only", "CR+LF"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.sizer_4_staticbox = wx.StaticBox(self, -1, "Input/Output") self.button_ok = wx.Button(self, wx.ID_OK, "") self.button_cancel = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() # end wxGlade self.__attach_events() self.checkbox_echo.SetValue(self.settings.echo) self.checkbox_unprintable.SetValue(self.settings.unprintable) self.radio_box_newline.SetSelection(self.settings.newline)
def __init__(self, *args, **kwds): self.settings = kwds['settings'] del kwds['settings'] # begin wxGlade: TerminalSettingsDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.checkbox_echo = wx.CheckBox(self, -1, "Local Echo") self.checkbox_unprintable = wx.CheckBox(self, -1, "Show unprintable characters") self.radio_box_newline = wx.RadioBox(self, -1, "Newline Handling", choices=["CR only", "LF only", "CR+LF"], majorDimension=0, style=wx.RA_SPECIFY_ROWS) self.button_ok = wx.Button(self, -1, "OK") self.button_cancel = wx.Button(self, -1, "Cancel") self.__set_properties() self.__do_layout() # end wxGlade self.__attach_events() self.checkbox_echo.SetValue(self.settings.echo) self.checkbox_unprintable.SetValue(self.settings.unprintable) self.radio_box_newline.SetSelection(self.settings.newline)
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)
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)
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)
def __init__(self, parent, name): wxskinDialog.__init__(self, parent, -1, "Phonebook import") self.SetAutoLayout(True) self.function = 0 # Main window resizer object border = wx.BoxSizer(wx.VERTICAL) label = wx.StaticText(self, -1, "Name '%s' already exists in SIM phonebook.\n\nDo you want to overwrite exisiting, duplicate or skip!?" % (name)) border.Add(label, 1, wx.ALL, 10) buttons = wx.BoxSizer(wx.HORIZONTAL) buttons.Add(wx.Button(self, ID_BUTTON_OVERWRITE, "Overwrite"), 1, wx.ALIGN_LEFT | wx.ALL, 20) buttons.Add(wx.Button(self, ID_BUTTON_COPY, "Duplicate"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) buttons.Add(wx.Button(self, ID_BUTTON_SKIP, "Skip"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) buttons.Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) border.Add(buttons, 1, wx.ALL) self.applyAll = wx.CheckBox(self, ID_CHECKBOX_APPLY_ALL, " Apply to all", wx.Point(65, 40), wx.Size(150, 20), wx.NO_BORDER) border.Add(self.applyAll, 1, wx.ALIGN_CENTER | wx.ALL) wx.EVT_BUTTON(self, ID_BUTTON_OVERWRITE, self.onOverwrite) wx.EVT_BUTTON(self, ID_BUTTON_COPY, self.onDuplicate) wx.EVT_BUTTON(self, ID_BUTTON_SKIP, self.onSkip) self.SetAutoLayout(1); self.SetSizer(border) border.Fit(self) self.Layout()
def __init__(self, parent, date, number): wxskinDialog.__init__(self, parent, -1, "SMS import") self.SetAutoLayout(False) self.function = 0 # Main window resizer object border = wx.BoxSizer(wx.VERTICAL) label = wx.StaticText(self, -1, "SMS from '%s' on '%s' already exists in SMS folder.\n\nDo you want to overwrite exisiting, duplicate or skip!?" % (number, date)) border.Add(label, 1, wx.ALL, 10) buttons = wx.BoxSizer(wx.HORIZONTAL) buttons.Add(wx.Button(self, ID_BUTTON_OVERWRITE, "Overwrite"), 1, wx.ALIGN_LEFT | wx.ALL, 20) buttons.Add(wx.Button(self, ID_BUTTON_COPY, "Duplicate"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) buttons.Add(wx.Button(self, ID_BUTTON_SKIP, "Skip"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) buttons.Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) border.Add(buttons, 1, wx.ALL) self.applyAll = wx.CheckBox(self, ID_CHECKBOX_APPLY_ALL, " Apply to all", wx.Point(65, 40), wx.Size(150, 20), wx.NO_BORDER) border.Add(self.applyAll, 1, wx.ALIGN_CENTER | wx.ALL) wx.EVT_BUTTON(self, ID_BUTTON_OVERWRITE, self.onOverwrite) wx.EVT_BUTTON(self, ID_BUTTON_COPY, self.onDuplicate) wx.EVT_BUTTON(self, ID_BUTTON_SKIP, self.onSkip) #EVT_CHECKBOX(self, ID_CHECKBOX_APPLY_ALL, self.EvtCheckBox) self.SetAutoLayout(1); self.SetSizer(border) border.Fit(self) self.Layout()
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)
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 )
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 )
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 )
def __init__(self, parent): from math import pi self.start_iter = None wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = wx.StaticText(self, label="Phase Constrained 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) self.phasemax = SpinnerObject(self,"Phase Max: ",pi,0.0,0.01,pi,100,150) vbox.Add(self.phasemax, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.phasemin = SpinnerObject(self,"Phase Min: ",0.0,-pi,0.01,-pi,100,150) vbox.Add(self.phasemin, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self, parent): self.panel = wx.ScrolledWindow.__init__(self, parent) self.SetScrollRate(5, 5) self.panelphase = self.GetParent().panelphase self.panelvisual = self.GetParent().panelvisual self.cmvbox = wx.BoxSizer(wx.VERTICAL) self.cmhbox = [] self.imglist = [] self.sellist = [] self.rb = [] self.chkb = [] array = self.panelphase.cms[0][1] dc = wx.ScreenDC() dc.SetFont(self.panelvisual.font) w,h = dc.GetTextExtent("TestString") height = h if IsNotWX4(): image = wx.EmptyImage(array.shape[0],height) else: image = wx.Image(array.shape[0],height) newarray = numpy.zeros((height, array.shape[0], 3), dtype=numpy.uint8) for i in range(self.panelphase.cms.shape[0]): self.cmhbox.append( wx.BoxSizer(wx.HORIZONTAL) ) name = self.panelphase.cms[i][0] array = self.panelphase.cms[i][1] for j in range(height): newarray[j,:,:] = numpy.uint8(255.0*array) image.SetData( newarray.tostring()) bmp = image.ConvertToBitmap() self.imglist.append(wx.StaticBitmap(self, -1, bmp)) self.rb.append( wx.RadioButton(self, -1, label=name, size=(160, height) ) ) self.cmhbox[-1].Add(self.rb[-1], 0) self.cmhbox[-1].Add((5, -1)) self.cmhbox[-1].Add(self.imglist[-1], 1, wx.EXPAND) self.chkb.append( wx.CheckBox(self, -1, 'Reverse', size=(160, height)) ) self.cmhbox[-1].Add(self.chkb[-1], 0, wx.EXPAND) self.cmvbox.Add(self.cmhbox[-1], 1, wx.EXPAND) self.SetSizer(self.cmvbox) self.Fit() self.Layout() self.Show()
def __init__(self, title, pos, size): self.threads = [] self.getsession = [] self.MAC='' self.IP='' wx.Frame.__init__(self, None, -1, title, pos, size) menuFile = wx.Menu() menuFile.Append(1, u"&??...",u"?????") menuFile.Append(3,u"&????",u"?????IP") menuFile.AppendSeparator() menuFile.Append(2,u"&Bug Report",u"???????bug?") menuBar = wx.MenuBar() menuBar.Append(menuFile, u"&??") self.SetMenuBar(menuBar) self.Bind(wx.EVT_MENU, self.OnAbout,id=1) self.Bind(wx.EVT_MENU,self.OnBugReport,id=2) hosts = self.Bind(wx.EVT_MENU,self.OnSet,id=3) self.CreateStatusBar() self.SetStatusText(u"????") panel = wx.Panel(self) self.connect = wx.Button(panel,label=u"??",pos=(240, 60),size=(80, 50)) self.disconnect = wx.Button(panel,label=u"??",pos=(330,60),size=(80,50)) self.connect.Disable() self.disconnect.Disable() self.Bind(wx.EVT_BUTTON, self.OnDisconnect,self.disconnect) self.Bind(wx.EVT_BUTTON,self.OnConnect,self.connect) self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) wx.StaticText(panel, -1, u"???:", pos=(28, 40)) self.username = wx.TextCtrl(panel, -1 ,pos=(80, 40)) self.username.SetInsertionPoint(0) self.Bind(wx.EVT_TEXT,self.Onuser,self.username) wx.StaticText(panel,-1,u"??:",pos=(242,40)) self.pwd = wx.TextCtrl(panel, -1,pos=(280,40),style=wx.TE_PASSWORD |wx.TE_PROCESS_ENTER) self.Bind(wx.EVT_TEXT,self.Onpwd,self.pwd) wx.CheckBox(panel, -1, u"????", (20, 80), (150, 20)) wx.CheckBox(panel, -1, u"????", (110, 80), (150, 20))
def __init__(self, parent): # Translators: The title of a dialog to configure advanced WinTenApps add-on options such as update checking. super(WinTenAppsConfigDialog, self).__init__(parent, title=_("Windows 10 App Essentials settings")) mainSizer = wx.BoxSizer(wx.VERTICAL) w10Helper = gui.guiHelper.BoxSizerHelper(self, orientation=wx.VERTICAL) # Translators: A checkbox to toggle automatic add-on updates. self.autoUpdateCheckbox=w10Helper.addItem(wx.CheckBox(self,label=_("Automatically check for add-on &updates"))) self.autoUpdateCheckbox.SetValue(config.conf["wintenApps"]["autoUpdateCheck"]) # Translators: The label for a setting in WinTenApps add-on settings to select automatic update interval in days. self.updateInterval=w10Helper.addLabeledControl(_("Update &interval in days"), gui.nvdaControls.SelectOnFocusSpinCtrl, min=0, max=30, initial=config.conf["wintenApps"]["updateCheckTimeInterval"]) # Translators: The label for a combo box to select update channel. labelText = _("&Add-on update channel:") self.channels=w10Helper.addLabeledControl(labelText, wx.Choice, choices=["development", "stable"]) self.updateChannels = ("dev", "stable") self.channels.SetSelection(self.updateChannels.index(config.conf["wintenApps"]["updateChannel"])) if canUpdate: # Translators: The label of a button to check for add-on updates. updateCheckButton = w10Helper.addItem(wx.Button(self, label=_("Check for add-on &update"))) updateCheckButton.Bind(wx.EVT_BUTTON, self.onUpdateCheck) w10Helper.addDialogDismissButtons(self.CreateButtonSizer(wx.OK | wx.CANCEL)) self.Bind(wx.EVT_BUTTON, self.onOk, id=wx.ID_OK) self.Bind(wx.EVT_BUTTON, self.onCancel, id=wx.ID_CANCEL) mainSizer.Add(w10Helper.sizer, border=gui.guiHelper.BORDER_FOR_DIALOGS, flag=wx.ALL) mainSizer.Fit(self) self.Sizer = mainSizer self.autoUpdateCheckbox.SetFocus() self.Center(wx.BOTH | (wx.CENTER_ON_SCREEN if hasattr(wx, "CENTER_ON_SCREEN") else 2))
def __init__(self, parent, **kwargs): wx.Panel.__init__(self, parent, **kwargs) self.parent = parent # Plot type chooser box self.plottype_p = PlotTypePanel(self) # Field type chooser box self.fieldtype_p = FieldTypePanel(self, size = (-1, 400)) # Component chooser combo box self.component_p = FieldComponentPanel(self) # Autoscale button self.autoscale_b = wx.CheckBox(self,-1,label='Autoscale') # Min and max values for autoscale self.minpspin = wx.TextCtrl(self,style=wx.TE_PROCESS_ENTER,size=(70,-1)) self.maxpspin = wx.TextCtrl(self,style=wx.TE_PROCESS_ENTER,size=(70,-1)) # Save buttons (figure, data, script) self.save_b = SaveFigurePanel(self) self.save_d = SaveDataPanel(self) self.save_s = SaveScriptPanel(self) # Sizer vbox = wx.BoxSizer(wx.VERTICAL) vbox.Add(self.plottype_p, 0,wx.EXPAND, 0) vbox.Add(self.fieldtype_p,0,wx.EXPAND, 0) vbox.Add(self.component_p,0,wx.EXPAND, 0) hbox = wx.BoxSizer(wx.HORIZONTAL) vbox.Add(hbox,0,wx.EXPAND, 0) hbox.Add(self.autoscale_b,0,wx.EXPAND, 0) hbox.Add(self.minpspin,0,wx.EXPAND, 0) hbox.Add(self.maxpspin,0,wx.EXPAND, 0) hbox = wx.BoxSizer(wx.HORIZONTAL) vbox.Add(hbox,0,wx.EXPAND, 0) #label = wx.StaticText(self, 0, 'Save', (20, 20)) #hbox.Add(label, 0,wx.EXPAND, 0) hbox.Add(self.save_b, 0,wx.EXPAND, 0) hbox.Add(self.save_d, 0,wx.EXPAND, 0) hbox.Add(self.save_s, 0,wx.EXPAND, 0) self.SetSizer(vbox)
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)
def makeSettings(self, settingsSizer): # Translators: label of a checkbox which toggles the announcement of breakpoints via speech self.announceBreakpointCheckBox=wx.CheckBox(self, wx.NewId(), label=_("&Announce breakpoints via speech")) self.announceBreakpointCheckBox.SetValue(config.conf["visualStudio"]["announceBreakpoints"]) settingsSizer.Add(self.announceBreakpointCheckBox,border=10, flag=wx.BOTTOM) # Translators: label of a checkbox which toggles the beep on breakpoints option self.beepOnBreakpointCheckBox=wx.CheckBox(self, wx.NewId(), label=_("&Beep on breakpoints")) self.beepOnBreakpointCheckBox.SetValue(config.conf["visualStudio"]["beepOnBreakpoints"]) settingsSizer.Add(self.beepOnBreakpointCheckBox,border=10, flag=wx.BOTTOM) # Translators: label of a checkbox which toggles reporting of intelliSense menu item position info self.reportIntelliSensePosInfoCheckBox=wx.CheckBox(self, wx.NewId(), label=_("&Report intelliSense menu item position information")) self.reportIntelliSensePosInfoCheckBox.SetValue(config.conf["visualStudio"]["reportIntelliSensePosInfo"]) settingsSizer.Add(self.reportIntelliSensePosInfoCheckBox,border=10, flag=wx.BOTTOM)
def __init__(self, *args, **kwds): # begin wxGlade: sampoorna_win.__init__ kwds["style"] = wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX | wx.MAXIMIZE | wx.MAXIMIZE_BOX | wx.STAY_ON_TOP | wx.SYSTEM_MENU | wx.RESIZE_BORDER | wx.CLIP_CHILDREN wx.Frame.__init__(self, *args, **kwds) self.panel_1 = wx.ScrolledWindow(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL) self.panel_warning = wx.Panel(self.panel_1, wx.ID_ANY, style=wx.RAISED_BORDER | wx.STATIC_BORDER | wx.TAB_TRAVERSAL) self.label_1 = wx.StaticText(self.panel_warning, wx.ID_ANY, _("label_1")) self.panel_login = wx.Panel(self.panel_1, wx.ID_ANY) self.bitmap_1 = wx.StaticBitmap(self.panel_login, wx.ID_ANY, wx.Bitmap("/home/ghssvythiri/Desktop/about.jpeg", wx.BITMAP_TYPE_ANY)) self.label_2 = wx.StaticText(self.panel_login, wx.ID_ANY, _("label_2")) self.text_ctrl_1 = wx.TextCtrl(self.panel_login, wx.ID_ANY, "") self.label_3 = wx.StaticText(self.panel_login, wx.ID_ANY, _("label_3")) self.text_ctrl_2 = wx.TextCtrl(self.panel_login, wx.ID_ANY, "", style=wx.TE_PASSWORD) self.button_1 = wx.Button(self.panel_login, wx.ID_ANY, _("button_1")) self.panel_class = wx.Panel(self.panel_1, wx.ID_ANY) self.checkbox_1 = wx.CheckBox(self.panel_class, wx.ID_ANY, _("checkbox_1")) self.checkbox_2 = wx.CheckBox(self.panel_class, wx.ID_ANY, _("checkbox_2")) self.checkbox_3 = wx.CheckBox(self.panel_class, wx.ID_ANY, _("checkbox_3")) self.button_2 = wx.Button(self.panel_class, wx.ID_ANY, _("button_2")) self.panel_progress = wx.Panel(self.panel_1, wx.ID_ANY) self.panel_report = wx.Panel(self.panel_1, wx.ID_ANY) self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.on_next, self.button_2) # end wxGlade
def options_event(self, e): d = wx.Dialog(None) o = self.options y = 10 components = [] for opt in o.listopt(): t = type(opt[2]) if t == type(2): #sc = wx.SpinCtrl(d, pos=(180, y), pass if t == type(True): chk = wx.CheckBox(d, pos=(180, y) , label=opt[1]) chk.SetValue(opt[2]) if opt[0] == "exprender": for i01 in range(0, self.nb.GetPageCount()): if isinstance(self.nb.GetPage(i01), BracketPage): chk.Disable() components.append((opt[0], chk)) y += 30 d.SetTitle("Options") d.SetSize((250, y+100)) d.ShowModal() for x in components: o.update(**{x[0]:x[1].GetValue()}) self.options = o
def __init__(self, *args, **kwds): # grab the serial keyword and remove it from the dict self.serial = kwds['serial'] del kwds['serial'] self.show = SHOW_ALL if 'show' in kwds: self.show = kwds.pop('show') # begin wxGlade: SerialConfigDialog.__init__ kwds["style"] = wx.DEFAULT_DIALOG_STYLE wx.Dialog.__init__(self, *args, **kwds) self.label_2 = wx.StaticText(self, -1, "Port") self.choice_port = wx.Choice(self, -1, choices=[]) self.label_1 = wx.StaticText(self, -1, "Baudrate") self.combo_box_baudrate = wx.ComboBox(self, -1, choices=[], style=wx.CB_DROPDOWN) self.sizer_1_staticbox = wx.StaticBox(self, -1, "Basics") self.panel_format = wx.Panel(self, -1) self.label_3 = wx.StaticText(self.panel_format, -1, "Data Bits") self.choice_databits = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.label_4 = wx.StaticText(self.panel_format, -1, "Stop Bits") self.choice_stopbits = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.label_5 = wx.StaticText(self.panel_format, -1, "Parity") self.choice_parity = wx.Choice(self.panel_format, -1, choices=["choice 1"]) self.sizer_format_staticbox = wx.StaticBox(self.panel_format, -1, "Data Format") self.panel_timeout = wx.Panel(self, -1) self.checkbox_timeout = wx.CheckBox(self.panel_timeout, -1, "Use Timeout") self.text_ctrl_timeout = wx.TextCtrl(self.panel_timeout, -1, "") self.label_6 = wx.StaticText(self.panel_timeout, -1, "seconds") self.sizer_timeout_staticbox = wx.StaticBox(self.panel_timeout, -1, "Timeout") self.panel_flow = wx.Panel(self, -1) self.checkbox_rtscts = wx.CheckBox(self.panel_flow, -1, "RTS/CTS") self.checkbox_xonxoff = wx.CheckBox(self.panel_flow, -1, "Xon/Xoff") self.sizer_flow_staticbox = wx.StaticBox(self.panel_flow, -1, "Flow Control") self.button_ok = wx.Button(self, wx.ID_OK, "") self.button_cancel = wx.Button(self, wx.ID_CANCEL, "") self.__set_properties() self.__do_layout() # end wxGlade # attach the event handlers self.__attach_events()
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}
def create_wxwindow(self): return self.initfn(wx.CheckBox)(self.parent, self.id, self.label, self.pos, self.size, self.style, self.validator, self.name)
def __init__(self, *args, **kwargs): self._uiobj = wx.CheckBox(*args, **kwargs) self.default = None
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)
def UIinit(self): # UI????? bkg = wx.Panel(self) # ???? self.help_info = wx.Button(bkg, -1, u'????') # ???? self.show_all_course = wx.Button(bkg, -1, u'????') self.reset_course = wx.Button(bkg, -1, u'????') self.add_course = wx.Button(bkg, -1, u'????') self.exit_program = wx.Button(bkg, -1, u'? ?') self.course_calc = wx.Button(bkg, -1, u'????') self.content = (wx.TextCtrl(bkg, style=wx.TE_MULTILINE)) # ????? self.course_name = wx.TextCtrl(bkg, -1, u'????') self.course_credit = wx.TextCtrl(bkg, -1, u'??') self.course_grade = wx.TextCtrl(bkg, -1, u'??') self.course_optional = wx.CheckBox(bkg, -1, u'??') self.course_delete = wx.TextCtrl(bkg, -1, u'????') self.course_delete_button = wx.Button(bkg, -1, u'????') self.author = wx.StaticText(bkg,-1,'Created by James') box = wx.BoxSizer(wx.VERTICAL) box.Add(self.help_info, proportion=1, flag=wx.ALL, border=2) # ??????? box.Add(self.show_all_course, proportion=1, flag=wx.ALL, border=2) box.Add(self.course_calc, proportion=1, flag=wx.ALL, border=2) box.Add(self.reset_course, proportion=1, flag=wx.ALL, border=2) box.Add(self.exit_program, proportion=1, flag=wx.ALL, border=2) info_box = wx.BoxSizer(wx.HORIZONTAL) info_box.Add(self.course_name, proportion=5, flag=wx.Centre | wx.ALL, border=2) info_box.Add(self.course_credit, proportion=2, flag=wx.Centre | wx.ALL, border=2) info_box.Add(self.course_grade, proportion=2, flag=wx.Centre | wx.ALL, border=2) info_box.Add(self.course_optional, proportion=1, flag=wx.Centre | wx.ALL, border=2) info_box.Add(self.add_course, proportion=2, flag=wx.Centre | wx.ALL, border=2) delete_box = wx.BoxSizer(wx.HORIZONTAL) delete_box.Add(self.course_delete, proportion=4, flag=wx.Centre | wx.ALL, border=2) delete_box.Add(self.course_delete_button, proportion=2, flag=wx.Centre | wx.ALL, border=2) delete_box.Add(self.author,proportion = 2,flag = wx.TOP|wx.LEFT,border=20) right_box = wx.BoxSizer(wx.VERTICAL) right_box.Add(info_box, proportion=0, flag=wx.TOP | wx.ALL, border=2) right_box.Add(delete_box, proportion=0, flag=wx.TOP | wx.ALL, border=2) right_box.Add(self.content, proportion=10, flag=wx.EXPAND | wx.ALL, border=2) vbox = wx.BoxSizer(wx.HORIZONTAL) vbox.Add(box, proportion=0, flag=wx.EXPAND | wx.ALL, border=5) vbox.Add(right_box, proportion=0, flag=wx.EXPAND | wx.ALL, border=5) bkg.SetSizer(vbox)
def initMessageArea(self): """Initialize the message log area. """ # font for messages msgFont = wx.Font(pointSize=11, family=wx.FONTFAMILY_MODERN, style=wx.FONTSTYLE_NORMAL, weight=wx.FONTWEIGHT_NORMAL, underline=False) # font for CEBL introduction message helloFont = wx.Font(pointSize=24, family=wx.FONTFAMILY_ROMAN, style=wx.FONTSTYLE_NORMAL, weight=wx.FONTWEIGHT_BOLD, underline=True) # the message log messageControlBox = widgets.ControlBox(self.scrolledPanel, label='Message Log', orient=wx.VERTICAL) self.messageArea = wx.TextCtrl(self.scrolledPanel, style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_RICH) self.messageArea.SetMinSize((150,150)) messageControlBox.Add(self.messageArea, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) # intro message self.messageArea.SetDefaultStyle( #wx.TextAttr(colText=wx.Colour('black'), font=helloFont)) # wxpython3 wx.TextAttr(font=helloFont)) self.messageArea.AppendText('Welcome to CEBL!\n\n') # setup message style self.messageArea.SetDefaultStyle(wx.TextAttr()) #self.messageArea.SetDefaultStyle(wx.TextAttr(colText=wx.Colour('black'), font=msgFont)) # wxpython3 self.messageArea.SetDefaultStyle(wx.TextAttr(font=msgFont)) # add the message area text ctrl widget as a log target self.mgr.logger.addTextCtrl(self.messageArea) messageControlSizer = wx.BoxSizer(orient=wx.HORIZONTAL) # button for saving the message log to a file self.saveMessagesButton = wx.Button(self.scrolledPanel, label='Save') messageControlSizer.Add(self.saveMessagesButton, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT, border=10) self.Bind(wx.EVT_BUTTON, self.saveMessages, self.saveMessagesButton) # button for clearing the message log self.clearMessagesButton = wx.Button(self.scrolledPanel, label='Clear') messageControlSizer.Add(self.clearMessagesButton, proportion=0, flag=wx.BOTTOM | wx.RIGHT, border=10) self.Bind(wx.EVT_BUTTON, self.clearMessages, self.clearMessagesButton) # set up verbose logging self.verboseMessagesCheckBox = wx.CheckBox(self.scrolledPanel, label='Verbose') messageControlSizer.Add(self.verboseMessagesCheckBox, proportion=0, flag=wx.BOTTOM | wx.RIGHT, border=10) messageControlBox.Add(messageControlSizer, proportion=0, flag=wx.EXPAND) # sizer for message log area self.messageSizer = wx.BoxSizer(orient=wx.VERTICAL) self.messageSizer.Add(messageControlBox, proportion=1, flag=wx.ALL | wx.EXPAND, border=10)
def __init__(self,parent,ancestor): from math import pi self.ancestor = ancestor wx.ScrolledWindow.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = wx.StaticText(self, label="View Support array") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.support = TextPanelObject(self, "Support: ", "",100,'*.npy') vbox.Add(self.support, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Data array: ", "",100,'*.npy') vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((-1, 5)) self.sbox1 = wx.StaticBox(self, label="Isosurface", style=wx.BORDER_DEFAULT) self.sboxs1 = wx.StaticBoxSizer(self.sbox1,wx.VERTICAL) self.hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.contour_support = SpinnerObject(self,"Support:",1.0,0.0,0.1,0.5,100,100) self.hbox1.Add(self.contour_support,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.hbox1.Add((20, -1)) self.opacity = SpinnerObject(self,"Opacity:",1.0,0.0,0.1,0.5,130,100) self.hbox1.Add(self.opacity,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.sboxs1.Add(self.hbox1,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.contour = SpinnerObject(self,"Data:",MAX_INT,MIN_INT,1,100,100,100) self.hbox2.Add(self.contour,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.hbox2.Add((20, -1)) self.feature_angle = SpinnerObject(self,"Feature Angle:",180,0,1,90,130,100) self.hbox2.Add(self.feature_angle,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.sboxs1.Add(self.hbox2,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.sboxs1.Add((-1, 5)) vbox.Add(self.sboxs1,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((-1, 5)) self.hbox6 = wx.BoxSizer(wx.HORIZONTAL) self.chkbox_axes = wx.CheckBox(self, -1, 'View axes', size=(200, 20)) self.chkbox_axes.SetValue(False) self.hbox6.Add(self.chkbox_axes, 1,flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2) self.hbox6.Add((-1, 5)) self.axes_fontfactor = SpinnerObject(self,"Font Factor:",MAX_INT,1,1,2,100,100) self.hbox6.Add(self.axes_fontfactor, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=2) vbox.Add(self.hbox6, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP|wx.BOTTOM, border=2) vbox.Add((-1, 5)) button_view = wx.Button(self, label="View", size=(70, 30)) button_view.Bind(wx.EVT_BUTTON, self.SeqParser ) vbox.Add(button_view,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox ) self.FitInside() self.SetScrollRate(5, 5)
def __init__(self, parent): from math import pi self.start_iter = None self.parent = parent wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = StaticTextNew(self, label="Phase Gradient Constrained HIO Algorithm") title.SetToolTipNew("Phase is constrained in the direction "+os.linesep+"of the Q-vector.") 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) self.phasemax = SpinnerObject(self,"Phase Max: ",2.0*pi,0.0,0.01,pi,100,150) vbox.Add(self.phasemax, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.phasemin = SpinnerObject(self,"Phase Min: ",2.0*pi,0.0,0.01,0.0,100,150) vbox.Add(self.phasemin, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.qx = NumberObject(self,"Q,x:",0.0,80) self.qx.label.SetToolTipNew("Q vector, x component direction.") vbox.Add(self.qx ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.qy = NumberObject(self,"Q,y:",0.0,80) self.qy.label.SetToolTipNew("Q vector, y component direction.") vbox.Add(self.qy ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.qz = NumberObject(self,"Q,z:",0.0,80) self.qz.label.SetToolTipNew("Q vector, z component direction.") vbox.Add(self.qz ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.ttheta = 0.0 self.phi = 0.0 self.waveln = 0.0 vbox.Add((-1,20)) self.buttonq = wx.Button(self, label="Calculate Q", size=(100, 30)) vbox.Add(self.buttonq, flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=20) self.Bind(wx.EVT_BUTTON, self.OnCalcQ, self.buttonq) self.SetAutoLayout(True) self.SetSizer( vbox )
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 with Partial Coherence Optimisation") 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.niterrlpre = SpinnerObject(self,"Iterations preceding R-L optimisation:", MAX_INT,1,1,100,300,100) self.niterrlpre.label.SetToolTipNew("Number of HIO iterations performed before R-L Optimisation occurs.") vbox.Add(self.niterrlpre, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.niterrl = SpinnerObject(self,"R-L iterations: ",MAX_INT,1,1,10,300,100) self.niterrl.label.SetToolTipNew("Number of Richardon-Lucy iterations.") vbox.Add(self.niterrl, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.niterrlinterval = SpinnerObject(self,"Interval between R-L optimisation: ",MAX_INT,1,1,50,300,100) self.niterrlinterval.label.SetToolTipNew("") vbox.Add(self.niterrlinterval, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.accel = SpinnerObject(self,"Acceleration: ",MAX_INT_16,1,1,1,100,100) vbox.Add(self.accel, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((1,5)) self.gammaHWHM = SpinnerObject(self,"Initial PSF HWHM: ",MAX_INT_16,0.0,0.01,0.2,300,100) self.gammaHWHM.label.SetToolTipNew("HWHM of initial FT'd Lorentzian PSF.") vbox.Add(self.gammaHWHM, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) title1 = wx.StaticText(self, label="Zero fill end dimensions of PSF:") vbox.Add(title1 ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.zedims=[{} for i in range(3)] self.zedims[0] = SpinnerObject(self,"i",MAX_INT_16,0,1,9,20,60) self.zedims[1] = SpinnerObject(self,"j",MAX_INT_16,0,1,9,20,60) self.zedims[2] = SpinnerObject(self,"k",MAX_INT_16,0,1,9,20,60) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox1.Add(self.zedims[0], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.zedims[1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.zedims[2], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) vbox.Add(hbox1, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((1,5)) self.chkbox_reset_gamma = wx.CheckBox(self, -1, 'Reset PSF before the next R-L optimisation cycle.', (50, 10)) self.chkbox_reset_gamma.SetValue(False) vbox.Add(self.chkbox_reset_gamma, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=5) self.SetAutoLayout(True) self.SetSizer( vbox )
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 with Partial Coherence Optimisation") 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.niterrlpre = SpinnerObject(self,"Iterations preceding R-L optimisation:", MAX_INT,1,1,100,300,100) self.niterrlpre.label.SetToolTipNew("Number of ER iterations performed before R-L Optimisation occurs.") vbox.Add(self.niterrlpre, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.niterrl = SpinnerObject(self,"R-L iterations: ",MAX_INT,1,1,10,300,100) self.niterrl.label.SetToolTipNew("Number of Richardon-Lucy iterations.") vbox.Add(self.niterrl, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.niterrlinterval = SpinnerObject(self,"Interval between R-L optimisation: ",MAX_INT,1,1,50,300,100) self.niterrlinterval.label.SetToolTipNew("") vbox.Add(self.niterrlinterval, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.accel = SpinnerObject(self,"Acceleration: ",MAX_INT_16,1,1,1,100,100) vbox.Add(self.accel, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((1,5)) self.gammaHWHM = SpinnerObject(self,"Initial PSF HWHM: ",MAX_INT_16,0.0,0.01,0.2,300,100) self.gammaHWHM.label.SetToolTipNew("HWHM of initial FT'd Lorentzian PSF.") vbox.Add(self.gammaHWHM, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) title1 = wx.StaticText(self, label="Zero fill end dimensions of PSF:") vbox.Add(title1 ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.zedims=[{} for i in range(3)] self.zedims[0] = SpinnerObject(self,"i",MAX_INT_16,0,1,9,20,60) self.zedims[1] = SpinnerObject(self,"j",MAX_INT_16,0,1,9,20,60) self.zedims[2] = SpinnerObject(self,"k",MAX_INT_16,0,1,9,20,60) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox1.Add(self.zedims[0], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.zedims[1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.zedims[2], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) vbox.Add(hbox1, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((1,5)) self.chkbox_reset_gamma = wx.CheckBox(self, -1, 'Reset PSF before the next R-L optimisation cycle.', (50, 10)) self.chkbox_reset_gamma.SetValue(False) vbox.Add(self.chkbox_reset_gamma, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=5) self.SetAutoLayout(True) self.SetSizer( vbox )
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 with Partial Coherence Optimisation") 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.niterrlpre = SpinnerObject(self,"Iterations preceding R-L optimisation:", MAX_INT,1,1,100,300,100) self.niterrlpre.label.SetToolTipNew("Number of HPR iterations performed before R-L Optimisation occurs.") vbox.Add(self.niterrlpre, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.niterrl = SpinnerObject(self,"R-L iterations: ",MAX_INT,1,1,10,300,100) self.niterrl.label.SetToolTipNew("Number of Richardon-Lucy iterations.") vbox.Add(self.niterrl, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.niterrlinterval = SpinnerObject(self,"Interval between R-L optimisation: ",MAX_INT,1,1,50,300,100) self.niterrlinterval.label.SetToolTipNew("") vbox.Add(self.niterrlinterval, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.accel = SpinnerObject(self,"Acceleration: ",MAX_INT_16,1,1,1,100,100) vbox.Add(self.accel, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((1,5)) self.gammaHWHM = SpinnerObject(self,"Initial PSF HWHM: ",MAX_INT_16,0.0,0.01,0.2,300,100) self.gammaHWHM.label.SetToolTipNew("HWHM of initial FT'd Lorentzian PSF.") vbox.Add(self.gammaHWHM, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) title1 = wx.StaticText(self, label="Zero fill end dimensions of PSF:") vbox.Add(title1 ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.zedims=[{} for i in range(3)] self.zedims[0] = SpinnerObject(self,"i",MAX_INT_16,0,1,9,20,60) self.zedims[1] = SpinnerObject(self,"j",MAX_INT_16,0,1,9,20,60) self.zedims[2] = SpinnerObject(self,"k",MAX_INT_16,0,1,9,20,60) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox1.Add(self.zedims[0], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.zedims[1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.zedims[2], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) vbox.Add(hbox1, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((1,5)) self.chkbox_reset_gamma = wx.CheckBox(self, -1, 'Reset PSF before the next R-L optimisation cycle.', (50, 10)) self.chkbox_reset_gamma.SetValue(False) vbox.Add(self.chkbox_reset_gamma, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=5) self.SetAutoLayout(True) self.SetSizer( vbox )
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 with Partial Coherence Optimisation") 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.niterrlpre = SpinnerObject(self,"Iterations preceding R-L optimisation:", MAX_INT,1,1,100,300,100) self.niterrlpre.label.SetToolTipNew("Number of RAAR iterations performed before R-L Optimisation occurs.") vbox.Add(self.niterrlpre, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.niterrl = SpinnerObject(self,"R-L iterations: ",MAX_INT,1,1,10,300,100) self.niterrl.label.SetToolTipNew("Number of Richardon-Lucy iterations.") vbox.Add(self.niterrl, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.niterrlinterval = SpinnerObject(self,"Interval between R-L optimisation: ",MAX_INT,1,1,50,300,100) self.niterrlinterval.label.SetToolTipNew("") vbox.Add(self.niterrlinterval, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.accel = SpinnerObject(self,"Acceleration: ",MAX_INT_16,1,1,1,100,100) vbox.Add(self.accel, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((1,5)) self.gammaHWHM = SpinnerObject(self,"Initial PSF HWHM: ",MAX_INT_16,0.0,0.01,0.2,300,100) self.gammaHWHM.label.SetToolTipNew("HWHM of initial FT'd Lorentzian PSF.") vbox.Add(self.gammaHWHM, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) title1 = wx.StaticText(self, label="Zero fill end dimensions of PSF:") vbox.Add(title1 ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.zedims=[{} for i in range(3)] self.zedims[0] = SpinnerObject(self,"i",MAX_INT_16,0,1,9,20,60) self.zedims[1] = SpinnerObject(self,"j",MAX_INT_16,0,1,9,20,60) self.zedims[2] = SpinnerObject(self,"k",MAX_INT_16,0,1,9,20,60) hbox1 = wx.BoxSizer(wx.HORIZONTAL) hbox1.Add(self.zedims[0], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.zedims[1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox1.Add(self.zedims[2], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) vbox.Add(hbox1, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((1,5)) self.chkbox_reset_gamma = wx.CheckBox(self, -1, 'Reset PSF before the next R-L optimisation cycle.', (50, 10)) self.chkbox_reset_gamma.SetValue(False) vbox.Add(self.chkbox_reset_gamma, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=5) self.SetAutoLayout(True) self.SetSizer( vbox )
def InitUI(self): self.panel = wx.Panel(self, wx.ID_ANY) # Info Text infotext = _(u'Close all open Applications, it is possible that programs will be closed without a warning ' u'and system could reboot without further confirmation.') infobox = wx.StaticBox(self.panel, -1, _(u'Attention')) infoboxbsizer = wx.StaticBoxSizer(infobox, wx.VERTICAL) info = wx.StaticText(self.panel, label=infotext) info.Wrap(380) infoboxbsizer.Add(info, 0) self.gauge = wx.Gauge(self.panel, size=(24, 26)) self.update_label = wx.StaticText(self.panel, label=_(u'Current Progress:')) self.update_box = wx.TextCtrl(self.panel, style=wx.TE_READONLY) self.update_box.SetBackgroundColour(wx.WHITE) self.chk_shutdown = wx.CheckBox(self.panel, size=(160,20), label=_(u"Shutdown after update")) self.logButton = wx.Button(self.panel, size=(54,26), label="LOG") self.logButton.SetToolTip(wx.ToolTip(_(u'Open WPKG Log'))) self.logButton.SetBitmap(img.get('log')) self.startButton = wx.Button(self.panel, label=_(u"Update")) self.abortButton = wx.Button(self.panel, label=_(u"Cancel")) self.logButton.Disable() self.abortButton.Disable() self.line = wx.StaticLine(self.panel, -1, size=(2,2), style=wx.LI_HORIZONTAL) self.startButton.Bind(wx.EVT_BUTTON, self.OnStartButton) self.abortButton.Bind(wx.EVT_BUTTON, self.OnAbortButton) self.logButton.Bind(wx.EVT_BUTTON, self.OnLogButton) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer2 = wx.BoxSizer(wx.HORIZONTAL) self.sizer.Add(infoboxbsizer, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.gauge, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.update_label, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.update_box, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.line, 0, wx.ALL | wx.EXPAND, 5) self.sizer.Add(self.chk_shutdown, 0, wx.LEFT | wx.EXPAND, 7) self.sizer2.Add(self.logButton, 0) self.sizer2.AddStretchSpacer() self.sizer2.Add(self.startButton, 0)#, wx.RIGHT, 2) self.sizer2.Add(self.abortButton, 0) self.sizer.Add(self.sizer2, 0, wx.ALL | wx.EXPAND, 5) self.panel.SetSizerAndFit(self.sizer) self.Center()
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()
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