我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用wx.EXPAND。
def __init__( self, parent ): wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Encrypted Files", pos = wx.DefaultPosition, size = wx.Size( 600,400 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) BodySizer = wx.BoxSizer( wx.VERTICAL ) self.m_panel4 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL ) TextCtrlSizer = wx.BoxSizer( wx.VERTICAL ) self.EncryptedFilesTextCtrl = wx.TextCtrl( self.m_panel4, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_DONTWRAP|wx.TE_MULTILINE|wx.TE_READONLY ) TextCtrlSizer.Add( self.EncryptedFilesTextCtrl, 1, wx.ALL|wx.EXPAND, 5 ) self.m_panel4.SetSizer( TextCtrlSizer ) self.m_panel4.Layout() TextCtrlSizer.Fit( self.m_panel4 ) BodySizer.Add( self.m_panel4, 1, wx.EXPAND |wx.ALL, 5 ) self.SetSizer( BodySizer ) self.Layout() self.Centre( wx.BOTH )
def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, id, title, size=(400, 250)) panel = wx.Panel(self, wx.ID_ANY) panel.SetBackgroundColour('#000000') text = """\n \t \t \t E-Z Music Downloader v1.0 \n \n Type in the song you want to downloading the the first box like so: "Song name by Artist" make sure you have both the artist and the song name in the query, in the second box type in what you want to name the Mp3. Next select High quality or Medium quality. High quality creates a larger file, therefore takes longer to convert. The status bar will show the actions the program is doing, once the status bar says done you can download another. To change the directory in which the song downloads, go to options in the menu bar and select "ChangeDownloadDirectory". \n \n \t \t Thanks for chosing E-Z Musick Downloader! \n \n \t (Songs converted using http://www.convertmemp3.com )""" txt = wx.StaticText(panel, label=text) txt.SetForegroundColour('#FFFFFF') sizer = wx.BoxSizer(wx.HORIZONTAL) sizer.Add(txt, 1, wx.EXPAND|wx.ALIGN_CENTER, 5) panel.SetSizer(sizer) self.Show() self.Centre()
def __init__(self, parent, browser,model = None): wx.Panel.__init__(self, parent, -1) panel = wx.Panel(self, -1) self.dvc = dv.DataViewCtrl(self, style=wx.BORDER_THEME | dv.DV_ROW_LINES # | dv.DV_VERT_RULES | dv.DV_MULTIPLE ) self.Sizer = wx.BoxSizer(wx.VERTICAL) self.Sizer.Add(self.dvc, 1, wx.EXPAND) self.browser = browser self.WindowsSize = wx.GetClientDisplayRect() if self.browser: self.browser.set_window_size(self.WindowsSize[2]/2, (self.WindowsSize[3])) self.browser.set_window_position(self.WindowsSize[2]/2, 0) self.dvc.Bind(dv.EVT_DATAVIEW_ITEM_ACTIVATED, self.OnOpenGooleChrome) self.dvc.Bind(dv.EVT_DATAVIEW_SELECTION_CHANGED, self.OnSelectionChanged) self.url = ""
def __init__(self, parent,nbresult,lf,rt): wx.Panel.__init__(self, parent, -1) panel = wx.Panel(self, -1) self.nbResult = nbresult self.lf = lf self.rt = rt hbox1 = wx.BoxSizer(wx.HORIZONTAL) self.UrlTxtCtrl = wx.TextCtrl(self, -1, "http://news.china.com.cn", style = wx.TE_PROCESS_ENTER) btnStart = wx.Button(self, -1, "?", (20,20)) #¼ #Onstart = frame.OnStart self.Bind(wx.EVT_BUTTON, self.OnStart, btnStart) hbox1.Add(self.UrlTxtCtrl, 1, wx.EXPAND) hbox1.Add(btnStart,0, wx.EXPAND) self.SetSizer(hbox1)
def __init__(self, parent,start): wx.Panel.__init__(self, parent, -1) self.start = start panel = wx.Panel(self, -1) hbox2 = wx.BoxSizer(wx.HORIZONTAL) self.NumTxtCtrl = wx.TextCtrl(self, -1, " ?v0.1.4", style = wx.TE_PROCESS_ENTER|wx.TE_READONLY) self.severule = wx.Button(self, -1, "" ,(20,20)) self.btnClear = wx.Button(self, -1, "?" ,(20,20)) self.btnParseURL = wx.Button(self, -1, "URL" ,(20,20)) self.btnParseContent = wx.Button(self, -1, "?" ,(20,20)) #sizer hbox2.Add(self.NumTxtCtrl,1, wx.EXPAND) hbox2.Add(self.severule,0, wx.EXPAND) hbox2.Add(self.btnClear,0, wx.EXPAND) hbox2.Add(self.btnParseURL,0, wx.EXPAND) hbox2.Add(self.btnParseContent,0, wx.EXPAND) self.SetSizer(hbox2) ##?¼ self.Bind(wx.EVT_BUTTON, self.start.OnRemoveCache, self.btnClear) self.Bind(wx.EVT_BUTTON, self.start.OnSeveResult, self.severule) self.Bind(wx.EVT_BUTTON, self.start.OnStart, self.btnParseURL) self.Bind(wx.EVT_BUTTON, self.start.OnStart, self.btnParseContent)
def __init__(self, parent=None, default_url=""): wx.Panel.__init__(self, parent) self._sizer = wx.BoxSizer(wx.HORIZONTAL) self._url = wx.TextCtrl(self) self._url.Bind(wx.EVT_KILL_FOCUS, self._field_changed) self._url.SetValue(default_url) self._status_label = ProcessingPlaceholderText(self) label = wx.StaticText(self, label="Server URL") label.SetToolTipString("URL for the IRIDA server API.") self._sizer.Add(label, flag=wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, border=5, proportion=0) self._sizer.Add(self._url, flag=wx.EXPAND, proportion=1) self._sizer.Add(self._status_label, flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT | wx.RIGHT, border=5, proportion=0) self.SetSizerAndFit(self._sizer) self.Layout() self.Bind(wx.EVT_CLOSE, self._on_close) pub.subscribe(self._status_label.SetError, APIConnectorTopics.connection_error_url_topic) pub.subscribe(self._status_label.SetSuccess, APIConnectorTopics.connection_success_topic) pub.subscribe(self._status_label.SetSuccess, APIConnectorTopics.connection_success_valid_url)
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 _sample_sheet_error(self, sample_sheet=None, error=None): """Show the invalid sample sheets panel whenever a sample sheet error is raised. Args: sample_sheet: the sample sheet that's got the error error: the validation error """ if not self._invalid_sheets_panel.IsShown(): self.Freeze() # clear out the other panels that might already be added self._sizer.Clear(deleteWindows=True) # add the sheets panel to the sizer and show it self._sizer.Add(self._invalid_sheets_panel, flag=wx.EXPAND, proportion=1) self._invalid_sheets_panel.Show() self.Layout() self.Thaw()
def _add_run(self, run): """Update the display to add a new `RunPanel`. When the `DirectoryScannerTopics.run_discovered` topic is received, add the run to the display. Args: run: the run to add to the display. """ logging.info("Adding run [{}]".format(run.sample_sheet_dir)) self._discovered_runs.append(run) run_panel = RunPanel(self, run, self._api) pub.subscribe(self._upload_failed, run.upload_failed_topic) self.Freeze() self._run_sizer.Add(run_panel, flag=wx.EXPAND, proportion=1) self.Layout() self.Thaw()
def _post_processing_task_started(self): """Show a 'processing' message on the UI while the post processing task is executing.""" pub.unsubscribe(self._post_processing_task_started, RunUploaderTopics.started_post_processing) pub.subscribe(self._post_processing_task_completed, RunUploaderTopics.finished_post_processing) pub.subscribe(self._post_processing_task_failed, RunUploaderTopics.failed_post_processing) logging.info("Post-processing started, updating UI.") self.Freeze() self._post_processing_sizer = wx.BoxSizer(wx.HORIZONTAL) self._post_processing_placeholder = ProcessingPlaceholderText(self) self._post_processing_placeholder.SetFont(wx.Font(pointSize=18, family=wx.FONTFAMILY_DEFAULT, style=wx.NORMAL, weight=wx.FONTWEIGHT_BOLD, face="Segoe UI Symbol")) self._post_processing_text = wx.StaticText(self, label="Executing post-processing task.") self._post_processing_text.SetFont(wx.Font(18, wx.DEFAULT, wx.NORMAL, wx.BOLD)) self._post_processing_text.Wrap(350) self._post_processing_text.SetToolTipString("Executing command `{}`.".format(read_config_option("completion_cmd"))) self._post_processing_sizer.Add(self._post_processing_text, flag=wx.RIGHT, border=5, proportion=1) self._post_processing_sizer.Add(self._post_processing_placeholder, flag=wx.LEFT, border=5, proportion=0) self._sizer.Insert(0, self._post_processing_sizer, flag=wx.EXPAND | wx.ALL, border=5) self.Layout() self.Thaw()
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 initNTrial(self): trialSizer = wx.BoxSizer(orient=wx.HORIZONTAL) trainTrialControlBox = widgets.ControlBox(self, label='Train Trials', orient=wx.VERTICAL) self.trainTrialSpinCtrl = wx.SpinCtrl(self, #style=wx.SP_WRAP, value=str(self.pg.nTrainTrial), min=2, max=100) self.Bind(wx.EVT_SPINCTRL, self.setNTrainTrial, self.trainTrialSpinCtrl) self.offlineControls += [self.trainTrialSpinCtrl] trainTrialControlBox.Add(self.trainTrialSpinCtrl, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) trialSizer.Add(trainTrialControlBox, proportion=1, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) testTrialControlBox = widgets.ControlBox(self, label='Test Trials', orient=wx.VERTICAL) self.testTrialSpinCtrl = wx.SpinCtrl(self, #style=wx.SP_WRAP, value=str(self.pg.nTestTrial), min=1, max=100) self.Bind(wx.EVT_SPINCTRL, self.setNTestTrial, self.testTrialSpinCtrl) self.offlineControls += [self.testTrialSpinCtrl] testTrialControlBox.Add(self.testTrialSpinCtrl, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) trialSizer.Add(testTrialControlBox, proportion=1, flag=wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.sizer.Add(trialSizer, proportion=0, flag=wx.EXPAND)
def initGain(self): gainSizer = wx.BoxSizer(orient=wx.VERTICAL) gainControlBox = widgets.ControlBox(self, label='Gain', orient=wx.HORIZONTAL) self.gainText = wx.StaticText(self, label='%0.2f' % self.pg.gain) gainTextSizer = wx.BoxSizer(orient=wx.VERTICAL) gainTextSizer.Add(self.gainText, proportion=1, flag=wx.EXPAND) self.gainSlider = wx.Slider(self, style=wx.SL_HORIZONTAL, value=int(self.pg.gain*100.0), minValue=1, maxValue=100) self.Bind(wx.EVT_SLIDER, self.setGain, self.gainSlider) gainControlBox.Add(gainTextSizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) gainControlBox.Add(self.gainSlider, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) gainSizer.Add(gainControlBox, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.sizer.Add(gainSizer, proportion=0, flag=wx.EXPAND)
def initMediaPath(self): mediaPathControlBox = widgets.ControlBox(self, label='Media Path', orient=wx.HORIZONTAL) self.mediaPathTextCtrl = wx.TextCtrl(parent=self, style=wx.TE_PROCESS_ENTER) self.mediaPathTextCtrl.SetValue(self.pg.defaultMusicDir) mediaPathControlBox.Add(self.mediaPathTextCtrl, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) self.Bind(wx.EVT_TEXT_ENTER, self.setMediaPath, self.mediaPathTextCtrl) self.offlineControls += [self.mediaPathTextCtrl] self.mediaBrowseButton = wx.Button(self, label='Browse') mediaPathControlBox.Add(self.mediaBrowseButton, proportion=0, flag=wx.TOP | wx.RIGHT | wx.BOTTOM, border=10) self.Bind(wx.EVT_BUTTON, self.mediaBrowse, self.mediaBrowseButton) self.offlineControls += [self.mediaBrowseButton] self.sizer.Add(mediaPathControlBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10)
def initNTrial(self): trialSizer = wx.BoxSizer(orient=wx.HORIZONTAL) trainTrialControlBox = widgets.ControlBox(self, label='Train Trials', orient=wx.VERTICAL) self.trainTrialSpinCtrl = wx.SpinCtrl(self, #style=wx.SP_WRAP, value=str(self.pg.nTrainTrial), min=10, max=100) self.Bind(wx.EVT_SPINCTRL, self.setNTrainTrial, self.trainTrialSpinCtrl) self.offlineControls += [self.trainTrialSpinCtrl] trainTrialControlBox.Add(self.trainTrialSpinCtrl, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) trialSizer.Add(trainTrialControlBox, proportion=1, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) testTrialControlBox = widgets.ControlBox(self, label='Test Trials', orient=wx.VERTICAL) self.testTrialSpinCtrl = wx.SpinCtrl(self, #style=wx.SP_WRAP, value=str(self.pg.nTestTrial), min=1, max=100) self.Bind(wx.EVT_SPINCTRL, self.setNTestTrial, self.testTrialSpinCtrl) self.offlineControls += [self.testTrialSpinCtrl] testTrialControlBox.Add(self.testTrialSpinCtrl, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) trialSizer.Add(testTrialControlBox, proportion=1, flag=wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.sizer.Add(trialSizer, proportion=0, flag=wx.EXPAND)
def initControls(self): # slider for controlling the length of the spans in Welch's method # since sliders are int, we use divide by 4 to get float value spanControlBox = widgets.ControlBox(self, label='Span', orient=wx.HORIZONTAL) self.spanText = wx.StaticText(self, label='%4.2f(s)' % self.pg.welchConfig.span) spanTextSizer = wx.BoxSizer(orient=wx.VERTICAL) spanTextSizer.Add(self.spanText, proportion=1, flag=wx.LEFT | wx.RIGHT | wx.EXPAND, border=8) self.spanSlider = wx.Slider(self, style=wx.SL_HORIZONTAL, value=int(self.pg.welchConfig.span*4), minValue=1, maxValue=12) spanControlBox.Add(spanTextSizer, proportion=0, flag=wx.TOP, border=10) spanControlBox.Add(self.spanSlider, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) self.Bind(wx.EVT_SLIDER, self.setSpan, self.spanSlider) self.sizer.Add(spanControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10)
def initChoices(self): choiceControlBox = widgets.ControlBox(self, label='Choices', orient=wx.VERTICAL) choiceGridSizer = wx.GridSizer(1, 2, 10, 10) self.leftChoiceTextCtrl = wx.TextCtrl(parent=self, value=self.pg.choices[0], style=wx.TE_PROCESS_ENTER) self.Bind(wx.EVT_TEXT_ENTER, self.setChoices, self.leftChoiceTextCtrl) self.leftChoiceTextCtrl.Bind(wx.EVT_KILL_FOCUS, self.setChoices, self.leftChoiceTextCtrl) self.offlineControls += [self.leftChoiceTextCtrl] choiceGridSizer.Add(self.leftChoiceTextCtrl, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) self.rightChoiceTextCtrl = wx.TextCtrl(parent=self, value=self.pg.choices[1], style=wx.TE_PROCESS_ENTER) self.Bind(wx.EVT_TEXT_ENTER, self.setChoices, self.rightChoiceTextCtrl) self.rightChoiceTextCtrl.Bind(wx.EVT_KILL_FOCUS, self.setChoices, self.rightChoiceTextCtrl) self.offlineControls += [self.rightChoiceTextCtrl] choiceGridSizer.Add(self.rightChoiceTextCtrl, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) choiceControlBox.Add(choiceGridSizer, proportion=1, flag=wx.ALL | wx.EXPAND, border=0) self.sizer.Add(choiceControlBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10)
def configFilter(self, event=None): filterChoiceIndex = self.chainListBox.GetSelection() if self.filterConfigPanel is not None: self.filterConfigPanel.Destroy() if filterChoiceIndex != wx.NOT_FOUND: flt = self.filterChain.getFilter(filterChoiceIndex) self.filterConfigPanel = flt.genConfigPanel(parent=self, pg=self) self.configSizer.Add(self.filterConfigPanel, proportion=1, flag=wx.EXPAND) else: self.filterConfigPanel = None self.Layout()
def initLayout(self): """Initialize the page layout. """ scrolledSizer = wx.BoxSizer(orient=wx.HORIZONTAL) scrolledSizer.Add(self.sourceSizer, proportion=0)#, flag=wx.EXPAND) scrolledSizer.Add(self.chanSizer, proportion=0, flag=wx.EXPAND) scrolledSizer.Add(self.messageSizer, proportion=1, flag=wx.EXPAND) self.scrolledPanel.SetSizer(scrolledSizer) # main sizer sizer = wx.BoxSizer(orient=wx.HORIZONTAL) sizer.Add(self.scrolledPanel, proportion=1, flag=wx.EXPAND) self.SetSizer(sizer) self.scrolledPanel.Layout() self.scrolledPanel.FitInside() self.scrolledPanel.SetupScrolling() # hide after layout (prevents gtk warnings) for sp in self.srcPanels.values(): sp.deselect()
def initSigControls(self): """Initialize signal controls. """ sigSizer = wx.BoxSizer(orient=wx.VERTICAL) scaleControlBox = widgets.ControlBox(self, label='Noise', orient=wx.VERTICAL) self.scaleText = wx.StaticText(self, label='%4.1f' % self.src.scale.value) scaleTextSizer = wx.BoxSizer(orient=wx.VERTICAL) scaleTextSizer.Add(self.scaleText, proportion=1, flag=wx.EXPAND) self.scaleSlider = wx.Slider(self, style=wx.SL_VERTICAL, value=self.src.scale.value*10.0, minValue=1, maxValue=100) self.Bind(wx.EVT_SLIDER, self.setScale, self.scaleSlider) scaleControlBox.Add(scaleTextSizer, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) scaleControlBox.Add(self.scaleSlider, proportion=1, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) sigSizer.Add(scaleControlBox, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) self.sizer.Add(sigSizer, proportion=1, flag=wx.EXPAND)
def initFileControls(self): fileSizer = wx.BoxSizer(orient=wx.VERTICAL) fileControlBox = widgets.ControlBox(self, label='Data File', orient=wx.VERTICAL) self.fileTextCtrl = wx.TextCtrl(self, value=str('SAMPLE DATA'), style=wx.TE_READONLY) self.fileBrowseButton = wx.Button(self, label='Browse') fileControlBox.Add(self.fileTextCtrl, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) fileControlBox.Add(self.fileBrowseButton, proportion=1, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) fileSizer.Add(fileControlBox, proportion=1, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.sizer.Add(fileSizer, proportion=1, flag=wx.EXPAND)
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 __do_layout(self): # begin wxGlade: Dialog_snapshot.__do_layout sizer_2 = wx.BoxSizer(wx.VERTICAL) grid_sizer_2 = wx.FlexGridSizer(4, 2, 10, 10) grid_sizer_2.Add(self.label_1, 0, 0, 0) grid_sizer_2.Add(self.nombre_snap, 0, 0, 0) grid_sizer_2.Add(self.label_2, 0, 0, 0) grid_sizer_2.Add(self.descripcion_snap, 0, 0, 0) grid_sizer_2.Add(self.checkbox_memory, 0, 0, 0) grid_sizer_2.Add(self.checkbox_quiesce, 0, 0, 0) grid_sizer_2.Add(self.snap_ok, 0, wx.ALIGN_RIGHT | wx.RIGHT, 0) grid_sizer_2.Add(self.snap_cancel, 0, 0, 0) grid_sizer_2.AddGrowableCol(1) sizer_2.Add(grid_sizer_2, 1, wx.ALL | wx.EXPAND, 10) self.SetSizer(sizer_2) sizer_2.Fit(self) self.Layout() # end wxGlade # end of class Dialog_snapshot
def __do_layout(self): # begin wxGlade: Dialogo_user_pass.__do_layout sizer_3 = wx.BoxSizer(wx.VERTICAL) grid_sizer_4 = wx.FlexGridSizer(1, 2, 0, 0) grid_sizer_1 = wx.FlexGridSizer(2, 2, 5, 5) grid_sizer_1.Add(self.label_3, 0, 0, 0) grid_sizer_1.Add(self.usuario, 0, 0, 0) grid_sizer_1.Add(self.label_4, 0, 0, 0) grid_sizer_1.Add(self.password, 0, 0, 0) grid_sizer_1.AddGrowableCol(0) sizer_3.Add(grid_sizer_1, 1, wx.ALIGN_CENTER | wx.ALIGN_RIGHT | wx.ALL | wx.EXPAND, 10) grid_sizer_4.Add(self.button_OK, 0, 0, 0) grid_sizer_4.Add(self.button_cancel, 0, wx.ALIGN_RIGHT, 0) sizer_3.Add(grid_sizer_4, 1, wx.ALIGN_RIGHT | wx.ALL, 4) self.SetSizer(sizer_3) sizer_3.Fit(self) self.Layout() # end wxGlade # end of class Dialogo_user_pass
def __do_layout(self): # begin wxGlade: Dialogo_acceso_vcenter.__do_layout sizer_6 = wx.BoxSizer(wx.VERTICAL) grid_sizer_6 = wx.FlexGridSizer(1, 2, 0, 0) grid_sizer_5 = wx.FlexGridSizer(4, 2, 5, 5) grid_sizer_5.Add(self.label_7, 0, 0, 0) grid_sizer_5.Add(self.nombre_vcenter, 0, 0, 0) grid_sizer_5.Add(self.label_9, 0, 0, 0) grid_sizer_5.Add(self.login_vcenter, 0, 0, 0) grid_sizer_5.Add(self.label_10, 0, 0, 0) grid_sizer_5.Add(self.passwor_vcenter, 0, 0, 0) grid_sizer_5.Add(self.label_8, 0, 0, 0) grid_sizer_5.Add(self.puert_vcenter, 0, 0, 0) sizer_6.Add(grid_sizer_5, 1, wx.ALIGN_CENTER | wx.ALIGN_RIGHT | wx.ALL | wx.EXPAND, 10) grid_sizer_6.Add(self.button_Exit, 0, wx.RIGHT, 3) grid_sizer_6.Add(self.button_Connect, 0, 0, 0) sizer_6.Add(grid_sizer_6, 1, wx.ALIGN_RIGHT | wx.ALL, 4) self.SetSizer(sizer_6) self.Layout() # end wxGlade # end of class Dialogo_acceso_vcenter
def add_toolbar(self): self.toolbar = NavigationToolbar2Wx(self.canvas) self.toolbar.Realize() if wx.Platform == '__WXMAC__': # Mac platform (OSX 10.3, MacPython) does not seem to cope with # having a toolbar in a sizer. This work-around gets the buttons # back, but at the expense of having the toolbar at the top self.SetToolBar(self.toolbar) else: # On Windows platform, default window size is incorrect, so set # toolbar width to figure width. tw, th = self.toolbar.GetSizeTuple() fw, fh = self.canvas.GetSizeTuple() # By adding toolbar in sizer, we are able to put it at the bottom # of the frame - so appearance is closer to GTK version. # As noted above, doesn't work for Mac. self.toolbar.SetSize(wx.Size(fw, th)) self.sizer.Add(self.toolbar, 0, wx.LEFT | wx.EXPAND) # update the axes menu on the toolbar self.toolbar.update()
def __init__(self): wx.Frame.__init__(self, parent=None, id=wx.ID_ANY, title='Moogle HTTP to OPC Server', size=(800,600) ) sizer = wx.BoxSizer(wx.VERTICAL) self.row_colours = { 'rest': 'blue', 'opc': 'purple'} ## -- Configure Top Tool bar tb = wx.ToolBar(self, style=TBFLAGS) sizer.Add(tb, 0, wx.EXPAND) tsize = (24,24) tb.SetToolBitmapSize(tsize) tb.Realize() self.list = wx.ListCtrl(self, -1, style=wx.LC_REPORT #| wx.BORDER_SUNKEN #| wx.BORDER_NONE | wx.LC_EDIT_LABELS | wx.LC_SORT_ASCENDING | wx.LC_NO_HEADER | wx.LC_VRULES | wx.LC_HRULES #| wx.LC_SINGLE_SEL ) self.loadListviewHeader() sizer.Add(self.list, 1, wx.EXPAND) self.SetSizer(sizer) sizer.Layout() self.Bind(wx.EVT_CLOSE, self.onClose)
def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = StaticTextNew(self, label="Sum or Subtract Arrays") title.SetToolTipNew("Sum or subtract array2 from array 1") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input File 1: ", "",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename1 = TextPanelObject(self, "Input File 2: ", "",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.input_filename1, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.output_filename = TextPanelObject(self, "Output File: ", "output.npy",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.addsub = RadioBoxNew(self, label="Add or Subtract:", choices=['Add','Subtract'], majorDimension=2, style=wx.RA_SPECIFY_COLS) self.addsub.SetToolTipNew("Add or Subtract") vbox.Add(self.addsub, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = StaticTextNew(self, label="Rotate Support Array") title.SetToolTipNew("Rotate support (binary complex) arrays only. \nStrange results will ensue if used on data arrays.") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input File: ", "",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.output_filename = TextPanelObject(self, "Output File: ", "data_rotated.npy",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.rotationaxis = SpinnerObject(self,"Axis:",3,1,1,1,150,150) self.rotationaxis.label.SetToolTipNew("Rotation axis.") vbox.Add(self.rotationaxis, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.rotationangle = SpinnerObject(self,"Angle:",360,-360,1,0,150,150) self.rotationangle.label.SetToolTipNew("Rotation angle in degrees.") vbox.Add(self.rotationangle, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = wx.StaticText(self, label="Create binary mask from Numpy array") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input File: ", "",150,'*.npy') vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.output_filename = TextPanelObject(self, "Output File: ", "mask.npy",150,'*.npy') vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.max = SpinnerObject(self,"Maximum Value:",MAX_INT,MIN_INT,1.0,MAX_INT,150,150) self.max.label.SetToolTipNew("Data within the min/max range "+os.linesep+"will result in a non-zero mask value.") self.min = SpinnerObject(self,"Minimum Value:",MAX_INT,MIN_INT,1,50.0,150,150) self.min.label.SetToolTipNew("Data within the min/max range "+os.linesep+"will result in a non-zero mask value.") vbox.Add(self.max, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add(self.min, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = StaticTextNew(self, label="Bin Numpy Array") title.SetToolTipNew("Input array will be binned "+os.linesep+"according to the values below.") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input File: ", "",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.output_filename = TextPanelObject(self, "Output File: ", "",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) title2 = wx.StaticText(self, label="Bin dimensions: ") vbox.Add(title2 ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.bdims=[{} for i in range(3)] self.bdims[0] = SpinnerObject(self,"x",MAX_INT_16,1,1,1,20,60) self.bdims[1] = SpinnerObject(self,"y",MAX_INT_16,1,1,1,20,60) self.bdims[2] = SpinnerObject(self,"z",MAX_INT_16,1,1,1,20,60) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.bdims[0], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox.Add(self.bdims[1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox.Add(self.bdims[2], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) vbox.Add(hbox, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = StaticTextNew(self, label="Threshold data in Numpy array") title.SetToolTipNew("Data outside range is set to zero.") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input File: ", "",150,'*.npy') vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.output_filename = TextPanelObject(self, "Output File: ", "data_thresh.npy",150,'*.npy') vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.max = SpinnerObject(self,"Maximum Value:",MAX_INT,MIN_INT,1.0,MAX_INT,150,150) self.max.label.SetToolTipNew("Data within the min/max range "+os.linesep+"will result in a non-zero mask value.") self.min = SpinnerObject(self,"Minimum Value:",MAX_INT,MIN_INT,1,50.0,150,150) self.min.label.SetToolTipNew("Data within the min/max range "+os.linesep+"will result in a non-zero mask value.") vbox.Add(self.max, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add(self.min, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self, parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = wx.StaticText(self, label="Filter array with median filter.") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input File: ", "",150,'*.npy') vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.output_filename = TextPanelObject(self, "Output File: ", "output.npy",150,'*.npy') vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) title2 = wx.StaticText(self, label="Filter kernel dimensions: ") vbox.Add(title2 ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.kdims=[{} for i in range(3)] self.kdims[0] = SpinnerObject(self,"x",MAX_INT_16,1,1,3,20,60) self.kdims[1] = SpinnerObject(self,"y",MAX_INT_16,1,1,3,20,60) self.kdims[2] = SpinnerObject(self,"z",MAX_INT_16,1,1,1,20,60) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.kdims[0], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox.Add(self.kdims[1], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) hbox.Add(self.kdims[2], 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10) vbox.Add(hbox, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.maxdev = SpinnerObject(self,"Normal deviation:",MAX_INT_16,0.0,0.1,0.5,150,150) self.maxdev.label.SetToolTipNew("Maximum element-wise normal deviation.") vbox.Add(self.maxdev, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.SetAutoLayout(True) self.SetSizer( vbox )
def __init__(self,parent): wx.Panel.__init__(self, parent, style=wx.SUNKEN_BORDER) vbox = wx.BoxSizer(wx.VERTICAL) title = wx.StaticText(self, label="Numpy array with coordinates to VTK array") vbox.Add(title ,0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) self.input_filename = TextPanelObject(self, "Input file: ", "input.npy",150,"Numpy files (*.npy)|*.npy|All files (*.*)|*.*") vbox.Add(self.input_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((-1, 5)) self.coords_filename = TextPanelObject(self, "Co-ord's file: ", "coordinates.npy",150,'*.npy') vbox.Add(self.coords_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((-1, 5)) self.output_filename = TextPanelObject(self, "Output file: ", "output.vtk",150,"VTK files (*.vtk)|*.vtk|All files (*.*)|*.*") vbox.Add(self.output_filename, 0, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, border=2) vbox.Add((-1, 5)) self.rbampphase = wx.RadioBox(self, label="Type", choices=['Amplitude','Phase'], majorDimension=2, style=wx.RA_SPECIFY_COLS) vbox.Add(self.rbampphase,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") 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 createNotebook(self): panel = wx.Panel(self) notebook = wx.Notebook(panel) widgets = Widgets(notebook) notebook.AddPage(widgets, "Widgets") notebook.SetBackgroundColour(BACKGROUNDCOLOR) # layout boxSizer = wx.BoxSizer() boxSizer.Add(notebook, 1, wx.EXPAND) panel.SetSizerAndFit(boxSizer) #====================== # Start GUI #======================
def __init__(self, parent, pos=(0, 0), size=(300, 200), style=0): wx.Panel.__init__(self, parent, pos=pos, size=size, style=style) box = wx.BoxSizer(wx.VERTICAL) self._curzoom = (0.0, 1.0) self.sndview = SndViewTablePanel(self, None) box.Add(self.sndview, 1, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.TOP, 5) self.SetSizer(box)
def __init__(self, parent, table, pos=(150, 680), size=(1000, 200)): wx.Panel.__init__(self, parent, pos=pos, size=size) self.parent = parent self.table = table self.size = size sizer = wx.BoxSizer(wx.HORIZONTAL) self.sndView = GuiSndViewPlayHead(self.parent, size=self.size) self.sndView.setTable(self.table) sizer.Add(self.sndView, 0, wx.EXPAND) # def createSndTable(self): # print self.parent.GetSize() # sizer = wx.BoxSizer(wx.HORIZONTAL) # jr 1 juin 2017 # self.sndview = GuiSndViewPlayHead(self.parent, size=(1000, 400)) # self.sndview.setTable(self.table) # sizer.Add(self.sndview, 0, wx.LEFT | wx.EXPAND, 155) # JR 1 juin 2017 # return sizer # def createTimeSlider(self): # sizer = wx.BoxSizer(wx.VERTICAL) # self.timeSlider = PyoGuiControlSlider(self.parent, 0, self.table.getDur(False), 0, orient=wx.HORIZONTAL) # self.timeSlider.Bind(EVT_PYO_GUI_CONTROL_SLIDER, self.moveTimeSlider) # # self.timeSlider = wx.Slider(self.parent, -1, value=0, minValue=0, maxValue=self.table.getDur(False), # # style=wx.SL_HORIZONTAL|wx.SL_LABELS) ## self.timeSlider.Bind(wx.EVT_SLIDER, self.moveTimeSlider) # sizer.Add(self.timeSlider, 0, wx.LEFT | wx.EXPAND, 155) # return sizer # def moveTimeSlider(self,e): # print self.timeSlider.value # # def setRange(self,min,max): # self.timeSlider.setRange(min,max)
def __init__(self, title, pos, size): # Initialize some flags self.IsEtotRead = False wx.Frame.__init__(self, None, -1, title, pos, size) panel = wx.Panel(self, -1) panel.SetBackgroundColour("White") text = wx.TextCtrl(self, wx.ID_ANY, size=size, style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(text, 1, wx.EXPAND) self.SetSizer(sizer) self.Fit() self.Bind(wx.EVT_CLOSE, self.OnQuit) self.createMenuBar() self.CreateStatusBar() self.SetStatusText("Welcome to pyQHA") # Redirect stout to the TextCtrl in the main panel self.redir=RedirectText(text) sys.stdout=self.redir sys.stderr=self.redir ############################################################################ # # Menu functions #
def createHeading(self, panel, headingText): hbox = wx.BoxSizer(wx.HORIZONTAL) pathHeading = wx.StaticText(panel, label=headingText) pathHeading.SetFont(self.fontHeading) hbox.Add(pathHeading, flag=wx.RIGHT|wx.EXPAND, border=0) return hbox
def createExplainerLine(self, panel, font, label_text): hbox = wx.BoxSizer(wx.HORIZONTAL) self.inputDescriptionLabel = wx.StaticText(panel, label=label_text) self.inputDescriptionLabel.SetFont(font) hbox.Add(self.inputDescriptionLabel, flag=wx.RIGHT|wx.EXPAND, border=8) return hbox
def __init__(self, parent, df, status_bar_callback): wx.Panel.__init__(self, parent) self.df_list_ctrl = ListCtrlDataFrame(self, df, status_bar_callback) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.df_list_ctrl, 1, wx.ALL | wx.EXPAND | wx.GROW, 5) self.SetSizer(sizer) self.Show()
def __init__(self, parent, columns, df_list_ctrl): wx.Panel.__init__(self, parent) self.columns = columns self.df_list_ctrl = df_list_ctrl self.list_box = ListBoxDraggable(self, -1, columns, style=wx.LB_EXTENDED) self.Bind(wx.EVT_LISTBOX, self.update_selected_columns) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.list_box, 1, wx.ALL | wx.EXPAND | wx.GROW, 5) self.SetSizer(sizer) self.list_box.SetFocus()
def __init__(self, parent, columns, df_list_ctrl, change_callback): wx.Panel.__init__(self, parent) columns_with_neutral_selection = [''] + list(columns) self.columns = columns self.df_list_ctrl = df_list_ctrl self.change_callback = change_callback self.num_filters = 10 self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.combo_boxes = [] self.text_controls = [] for i in range(self.num_filters): combo_box = wx.ComboBox(self, choices=columns_with_neutral_selection, style=wx.CB_READONLY) text_ctrl = wx.TextCtrl(self, wx.ID_ANY, '') self.Bind(wx.EVT_COMBOBOX, self.on_combo_box_select) self.Bind(wx.EVT_TEXT, self.on_text_change) row_sizer = wx.BoxSizer(wx.HORIZONTAL) row_sizer.Add(combo_box, 0, wx.ALL, 5) row_sizer.Add(text_ctrl, 1, wx.ALL | wx.EXPAND | wx.ALIGN_RIGHT, 5) self.combo_boxes.append(combo_box) self.text_controls.append(text_ctrl) self.main_sizer.Add(row_sizer, 0, wx.EXPAND) self.SetSizer(self.main_sizer)
def __init__(self, parent, columns, df_list_ctrl): wx.Panel.__init__(self, parent) columns_with_neutral_selection = [''] + list(columns) self.columns = columns self.df_list_ctrl = df_list_ctrl self.figure = Figure(facecolor="white", figsize=(1, 1)) self.axes = self.figure.add_subplot(111) self.canvas = FigureCanvas(self, -1, self.figure) chart_toolbar = NavigationToolbar2Wx(self.canvas) self.combo_box1 = wx.ComboBox(self, choices=columns_with_neutral_selection, style=wx.CB_READONLY) self.Bind(wx.EVT_COMBOBOX, self.on_combo_box_select) row_sizer = wx.BoxSizer(wx.HORIZONTAL) row_sizer.Add(self.combo_box1, 0, wx.ALL | wx.ALIGN_CENTER, 5) row_sizer.Add(chart_toolbar, 0, wx.ALL, 5) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(self.canvas, 1, flag=wx.EXPAND, border=5) sizer.Add(row_sizer) self.SetSizer(sizer)