我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用wx.BoxSizer()。
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): wx.Frame.__init__(self, None, pos=wx.DefaultPosition, size=wx.Size(450, 100), style=wx.MINIMIZE_BOX | wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.CLIP_CHILDREN, title="BRUNO") panel = wx.Panel(self) ico = wx.Icon('boy.ico', wx.BITMAP_TYPE_ICO) self.SetIcon(ico) my_sizer = wx.BoxSizer(wx.VERTICAL) lbl = wx.StaticText(panel, label="Bienvenido Sir. How can I help you?") my_sizer.Add(lbl, 0, wx.ALL, 5) self.txt = wx.TextCtrl(panel, style=wx.TE_PROCESS_ENTER, size=(400, 30)) self.txt.SetFocus() self.txt.Bind(wx.EVT_TEXT_ENTER, self.OnEnter) my_sizer.Add(self.txt, 0, wx.ALL, 5) panel.SetSizer(my_sizer) self.Show() speak.Speak('''Welcome back Sir, Broono at your service.''')
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 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 addFileWidgets(self): boxSizerH = wx.BoxSizer(wx.HORIZONTAL) boxSizerH.Add(wx.Button(self.panel, label='Browse to File...')) boxSizerH.Add(wx.TextCtrl( self.panel, size=(174, -1), value= "Z:\\" )) boxSizerH1 = wx.BoxSizer(wx.HORIZONTAL) boxSizerH1.Add(wx.Button(self.panel, label='Copy File To: ')) boxSizerH1.Add(wx.TextCtrl( self.panel, size=(174, -1), value= "Z:\\Backup" )) boxSizerV = wx.BoxSizer(wx.VERTICAL) boxSizerV.Add(boxSizerH) boxSizerV.Add(boxSizerH1) self.statBoxSizerMgrV.Add( boxSizerV, 1, wx.ALL ) #====================================================================
def __init__(self, parent): wx.Panel.__init__(self, parent, -1) box = wx.BoxSizer(wx.VERTICAL) box.Add((20, 30)) keys = buttonDefs.keys() for k in keys: text = buttonDefs[k][1] btn = wx.Button(self, k, text) box.Add(btn, 0, wx.ALIGN_CENTER|wx.ALL, 15) self.Bind(wx.EVT_BUTTON, self.OnButton, btn) # put a GLCanvas on the wx.Panel c = CubeCanvas(self) c.SetMinSize((200, 200)) box.Add(c, 0, wx.ALIGN_CENTER|wx.ALL, 15) c = ConeCanvas(self) c.SetMinSize((200, 200)) box.Add(c, 0, wx.ALIGN_CENTER|wx.ALL, 15) self.SetAutoLayout(True) self.SetSizer(box)
def createWidgets(self): # Main window resizer object sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(topPanel(self, self.SIM), 1, wx.ALL|wx.EXPAND, 5) sizer.Add(bottomPanel(self, self.SIM), 1, wx.ALL|wx.EXPAND, 5) #buttons = wx.BoxSizer(wx.HORIZONTAL) #buttons.Add(wx.Button(self, ID_BUTTON_CHANGE_PIN, "Okay"), 1, wx.ALIGN_LEFT | wx.ALL, 20) #buttons.Add(wx.Button(self, wxID_CANCEL, "Cancel"), 1, wx.ALIGN_RIGHT | wx.ALL, 20) #sizer.Add(buttons, 1, wx.ALL) self.SetSizer(sizer) self.SetAutoLayout(1) sizer.Fit(self) self.Layout() wx.EVT_CLOSE(self, self.closeWindow)
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, id, title, message, download_url, size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE, name='dialog'): wx.Dialog.__init__(self, parent, id, title, pos, size, style, name) label = wx.StaticText(self, label=message) button = wx.Button(self, id=wx.ID_OK, label="Close") button.SetDefault() line = wx.StaticLine(self, wx.ID_ANY, size=(20, -1), style=wx.LI_HORIZONTAL) download_ctrl = hl.HyperLinkCtrl(self, wx.ID_ANY, download_url, URL=download_url) sizer = wx.BoxSizer(wx.VERTICAL) button_sizer = wx.StdDialogButtonSizer() button_sizer.AddButton(button) button_sizer.Realize() sizer.Add(label, 0, wx.ALIGN_CENTER|wx.ALL, 5) sizer.Add(download_ctrl, 0, wx.ALL, 10) sizer.Add(line, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.RIGHT|wx.TOP, 5) sizer.Add(button_sizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5) self.SetSizer(sizer) sizer.Fit(self)
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, first_run=False): wx.Dialog.__init__(self, parent, title="Settings", style=wx.DEFAULT_DIALOG_STYLE) self._first_run = first_run self._sizer = wx.BoxSizer(wx.VERTICAL) self._defaults = {} self._sizer.Add(URLEntryPanel(self, default_url=read_config_option("baseurl")), flag=wx.EXPAND | wx.ALL, border=5) authorization_sizer = wx.BoxSizer(wx.HORIZONTAL) authorization_sizer.Add(ClientDetailsPanel(self, default_client_id=read_config_option("client_id"), default_client_secret=read_config_option("client_secret")), flag=wx.EXPAND | wx.RIGHT, border=2, proportion=1) authorization_sizer.Add(UserDetailsPanel(self, default_user=read_config_option("username"), default_pass=read_config_option("password")), flag=wx.EXPAND | wx.LEFT, border=2, proportion=1) self._sizer.Add(authorization_sizer, flag=wx.EXPAND | wx.ALL, border=5) self._sizer.Add(PostProcessingTaskPanel(self, default_post_process=read_config_option("completion_cmd")), flag=wx.EXPAND | wx.ALL, border=5) self._sizer.Add(DefaultDirectoryPanel(self, default_directory=read_config_option("default_dir"), monitor_directory=read_config_option("monitor_default_dir", expected_type=bool)), flag=wx.EXPAND | wx.ALL, border=5) self._sizer.Add(self.CreateSeparatedButtonSizer(flags=wx.OK), flag=wx.EXPAND | wx.ALL, border=5) self.SetSizerAndFit(self._sizer) self.Layout() pub.subscribe(self._field_changed, SettingsDialog.field_changed_topic) self.Bind(wx.EVT_CLOSE, self._on_close) self.Bind(wx.EVT_BUTTON, self._on_close, id=wx.ID_OK) threading.Thread(target=connect_to_irida).start()
def __init__(self, parent): """Initialize the UploaderAppPanel. Args: parent: the parent Window for this panel. """ wx.Panel.__init__(self, parent) self._parent = parent self._discovered_runs = [] self._selected_directory = None self._sizer = wx.BoxSizer(wx.VERTICAL) # topics to handle from directory scanning pub.subscribe(self._add_run, DirectoryScannerTopics.run_discovered) pub.subscribe(self._finished_loading, DirectoryScannerTopics.finished_run_scan) pub.subscribe(self._sample_sheet_error, DirectoryScannerTopics.garbled_sample_sheet) pub.subscribe(self._sample_sheet_error, DirectoryScannerTopics.missing_files) # topics to handle when settings have changed in the settings frame pub.subscribe(self._settings_changed, SettingsDialog.settings_closed_topic) # topics to handle when a directory is selected by File > Open pub.subscribe(self._directory_selected, UploaderAppFrame.directory_selected_topic) self._settings_changed() self.SetSizerAndFit(self._sizer)
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 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 initMethod(self): methodControlBox = widgets.ControlBox(self, label='Method', orient=wx.VERTICAL) self.methodComboBox = wx.ComboBox(self, value=self.pg.method, style=wx.CB_READONLY, choices=('Welch Power', 'Autoregressive')) self.Bind(wx.EVT_COMBOBOX, self.setMethod, self.methodComboBox) self.offlineControls += [self.methodComboBox] methodControlBox.Add(self.methodComboBox, proportion=0, flag=wx.ALL | wx.EXPAND, border=10) self.sizer.Add(methodControlBox, proportion=0, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.methodConfigSizer = wx.BoxSizer(orient=wx.VERTICAL) self.welchPanel = WelchConfigPanel(self, pg=self.pg, cp=self) self.methodConfigSizer.Add(self.welchPanel, proportion=1, flag=wx.EXPAND) self.autoregPanel = AutoregConfigPanel(self, pg=self.pg, cp=self) self.methodConfigSizer.Add(self.autoregPanel, proportion=1, flag=wx.EXPAND) self.sizer.Add(self.methodConfigSizer, proportion=1, flag=wx.EXPAND) self.methodConfig = self.welchPanel
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 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=5, 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 initLattice(self): latticeSizer = wx.BoxSizer(orient=wx.HORIZONTAL) latticeSizeXControlBox = widgets.ControlBox(self, label='Lattice Size X', orient=wx.VERTICAL) self.latticeSizeXSpinCtrl = wx.SpinCtrl(self, #style=wx.SP_WRAP, value=str(self.pg.latticeSize[0]), min=1, max=512) self.Bind(wx.EVT_SPINCTRL, self.setLatticeSizeX, self.latticeSizeXSpinCtrl) self.offlineControls += [self.latticeSizeXSpinCtrl] latticeSizeXControlBox.Add(self.latticeSizeXSpinCtrl, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) latticeSizer.Add(latticeSizeXControlBox, proportion=1, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) latticeSizeYControlBox = widgets.ControlBox(self, label='Lattice Size Y', orient=wx.VERTICAL) self.latticeSizeYSpinCtrl = wx.SpinCtrl(self, #style=wx.SP_WRAP, value=str(self.pg.latticeSize[0]), min=1, max=512) self.Bind(wx.EVT_SPINCTRL, self.setLatticeSizeY, self.latticeSizeYSpinCtrl) self.offlineControls += [self.latticeSizeYSpinCtrl] latticeSizeYControlBox.Add(self.latticeSizeYSpinCtrl, proportion=1, flag=wx.ALL | wx.EXPAND, border=10) latticeSizer.Add(latticeSizeYControlBox, proportion=1, flag=wx.BOTTOM | wx.RIGHT | wx.EXPAND, border=10) self.sizer.Add(latticeSizer, proportion=0, flag=wx.EXPAND)
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 __init__(self, parent, pg, *args, **kwargs): """Construct a new panel containing configuration widgets. Args: parent: Parent in wx hierarchy. pg: Page to be configured. *args, **kwargs: Additional arguments passed to the wx.Panel base class. """ # initialize wx.Panel base class ScrolledPanel.__init__(self, parent=parent, *args, **kwargs) # page to be configured self.pg = pg # main sizer self.sizer = wx.BoxSizer(orient=wx.VERTICAL) self.SetSizer(self.sizer) self.SetupScrolling()#scroll_x=False, scroll_y=True) self.offlineControls = []
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 __init__(self, parent, src, orient=wx.HORIZONTAL, *args, **kwargs): """Initialize a new source configuration panel. Args: parent: wx parent of this panel. src: Source to configure. args, kwargs: Additional arguments to pass to the wx.Panel base class constructor. """ wx.Panel.__init__(self, parent=parent, *args, **kwargs) self.src = src self.sizer = wx.BoxSizer(orient=orient) self.SetSizer(self.sizer)
def initOptions(self): optionsSizer = wx.BoxSizer(wx.HORIZONTAL) kernTypeControlBox = widgets.ControlBox(self, label='Kernel Type', orient=wx.HORIZONTAL) self.kernTypeComboBox = wx.ComboBox(self, choices=self.flt.kernMap.keys(), value=self.flt.kernType, style=wx.CB_DROPDOWN) self.Bind(wx.EVT_COMBOBOX, self.setKernType, self.kernTypeComboBox) kernTypeControlBox.Add(self.kernTypeComboBox, proportion=1, flag=wx.ALL, border=8) optionsSizer.Add(kernTypeControlBox, proportion=1, flag=wx.ALL | wx.ALIGN_CENTER, border=8) widthControlBox = widgets.ControlBox(self, label='Width', orient=wx.HORIZONTAL) self.widthSpinCtrl = wx.SpinCtrl(self, value=str(self.flt.width), min=2, max=100) self.Bind(wx.EVT_SPINCTRL, self.setWidth, self.widthSpinCtrl) widthControlBox.Add(self.widthSpinCtrl, proportion=1, flag=wx.ALL, border=8) optionsSizer.Add(widthControlBox, proportion=0, flag=wx.TOP | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border=8) self.sizer.Add(optionsSizer, proportion=0)#, 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 initOptions(self): STransConfigPanel.initOptions(self) optionsSizer = wx.BoxSizer(wx.HORIZONTAL) kurtosisControlBox = widgets.ControlBox(self, label='Kurtosis', orient=wx.VERTICAL) self.kurtosisComboBox = wx.ComboBox(self, choices=('Adapt', 'Sub', 'Super'), value=self.flt.kurtosis, style=wx.CB_DROPDOWN) self.Bind(wx.EVT_COMBOBOX, self.setKurtosis, self.kurtosisComboBox) kurtosisControlBox.Add(self.kurtosisComboBox, proportion=1, flag=wx.ALL, border=8) optionsSizer.Add(kurtosisControlBox, proportion=1, flag=wx.LEFT | wx.RIGHT, border=8) maxIterControlBox = widgets.ControlBox(self, label='Max Iter.', orient=wx.HORIZONTAL) self.maxIterSpinCtrl = wx.SpinCtrl(self, value=str(self.flt.maxIter), min=50, max=3500) self.Bind(wx.EVT_SPINCTRL, self.setMaxIter, self.maxIterSpinCtrl) maxIterControlBox.Add(self.maxIterSpinCtrl, proportion=1, flag=wx.ALL | wx.ALIGN_CENTER_VERTICAL, border=8) optionsSizer.Add(maxIterControlBox, proportion=0, flag=wx.RIGHT | wx.EXPAND, border=8) #lrControlBox = widgets.ControlBox(self, label='Learning Rate.', orient=wx.HORIZONTAL) self.sizer.Add(optionsSizer, proportion=0)
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: MyFrame.__do_layout sizer_4 = wx.BoxSizer(wx.VERTICAL) sizer_5 = wx.BoxSizer(wx.HORIZONTAL) sizer_5.Add(self.label_5, 0, wx.ALIGN_CENTER_VERTICAL, 0) sizer_5.Add(self.text_ctrl_bucar, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 7) sizer_5.Add(self.button_buscar, 0, wx.ALIGN_CENTER_VERTICAL, 0) sizer_5.Add(self.label_6, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5) sizer_5.Add(self.bitmap_button_1, 0, wx.ALIGN_CENTER_VERTICAL, 0) sizer_4.Add(sizer_5, 1, wx.ALIGN_BOTTOM | wx.ALIGN_RIGHT | wx.ALL, 6) sizer_4.Add(self.list_ctrl_1, 1, 0, 0) self.SetSizer(sizer_4) sizer_4.Fit(self) self.Layout() # end wxGlade # end of class MyFrame
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 __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) from wx.lib.floatcanvas.ScreenShot import getScreenShotBitmap note1 = wx.StaticText(self, -1, errorText) note2 = wx.StaticText(self, -1, "This is what the FloatCanvas can look like:") S = wx.BoxSizer(wx.VERTICAL) S.Add((10, 10), 1) S.Add(note1, 0, wx.ALIGN_CENTER) S.Add(note2, 0, wx.ALIGN_CENTER | wx.BOTTOM, 4) S.Add(wx.StaticBitmap(self,-1,getScreenShotBitmap()),0,wx.ALIGN_CENTER) S.Add((10, 10), 1) self.SetSizer(S) self.Layout()
def __init__(self, parent, log): self.log = log wx.Panel.__init__(self, parent, -1) note1 = wx.StaticText(self, -1, "The FloatCanvas Demo needs") note2 = wx.StaticText(self, -1, "a separate frame") b = wx.Button(self, -1, "Open Demo Frame Now") b.Bind(wx.EVT_BUTTON, self.OnButton) S = wx.BoxSizer(wx.VERTICAL) S.Add((10, 10), 1) S.Add(note1, 0, wx.ALIGN_CENTER) S.Add(note2, 0, wx.ALIGN_CENTER | wx.BOTTOM, 5) S.Add(b, 0, wx.ALIGN_CENTER | wx.ALL, 5) S.Add((10, 10), 1) self.SetSizer(S) self.Layout()
def __init__(self): wx.Frame.__init__(self,None,-1, 'CanvasFrame',size=(550,350)) self.SetBackgroundColour(wx.NamedColor("WHITE")) self.figure = Figure() self.axes = self.figure.add_subplot(111) self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) self.SetSizer(self.sizer) self.Fit() self.add_toolbar() # comment this out for no toolbar self.axes.set_title("NURBS and B-Spline Algorithms: ")
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 ): win_height = parent.GetSize()[1] height_of_pannels_above = 230 space_left = win_height - height_of_pannels_above wx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = (0, height_of_pannels_above), size = wx.Size(285, space_left), style = wx.TAB_TRAVERSAL ) wx.StaticText(self, label='Cron Config Menu', pos=(25, 10)) self.read_cron_btn = wx.Button(self, label='Read Crontab', pos=(10, 40), size=(175, 30)) self.read_cron_btn.Bind(wx.EVT_BUTTON, self.read_cron_click) self.new_cron_btn = wx.Button(self, label='New cron job', pos=(10, 80), size=(175, 30)) self.new_cron_btn.Bind(wx.EVT_BUTTON, self.new_cron_click) self.update_cron_btn = wx.Button(self, label='Update Cron', pos=(10, 120), size=(175, 30)) self.update_cron_btn.Bind(wx.EVT_BUTTON, self.update_cron_click) self.SetBackgroundColour('sea green') #TESTING ONLY REMOVE WHEN SIZING IS DONE AND ALL THAT BUSINESS bSizer = wx.BoxSizer(wx.VERTICAL) bSizer.Add(self.read_cron_btn, 0, wx.ALL, 5) bSizer.Add(self.new_cron_btn, 0, wx.ALL, 5) bSizer.Add(self.update_cron_btn, 0, wx.ALL, 5) self.SetSizer(bSizer)
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 )