python类EXPAND的实例源码

GuiAbsBase.py 文件源码 项目:Crypter 作者: sithis993 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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 )
recipe-578681.py 文件源码 项目:code 作者: ActiveState 项目源码 文件源码 阅读 38 收藏 0 点赞 0 评论 0
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()
url?????v1.0.py 文件源码 项目:Url 作者: beiruan 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
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 = ""
url?????v1.0.py 文件源码 项目:Url 作者: beiruan 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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)
url?????v1.0.py 文件源码 项目:Url 作者: beiruan 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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)
SettingsDialog.py 文件源码 项目:irida-miseq-uploader 作者: phac-nml 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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)
SettingsDialog.py 文件源码 项目:irida-miseq-uploader 作者: phac-nml 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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()
UploaderApp.py 文件源码 项目:irida-miseq-uploader 作者: phac-nml 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
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()
UploaderApp.py 文件源码 项目:irida-miseq-uploader 作者: phac-nml 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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()
UploaderApp.py 文件源码 项目:irida-miseq-uploader 作者: phac-nml 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
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()
mobile_insight_gui.py 文件源码 项目:mobileinsight-core 作者: mobile-insight 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
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()
mentaltasks.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
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)
mentaltasks.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
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)
bciplayer.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
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)
bciplayer.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
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)
power.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
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)
motorpong.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
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)
motorpong.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
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)
p300bot.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
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)
filt.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
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()
config.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
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()
mttest.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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)
replay.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
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)
bandpass.py 文件源码 项目:cebl 作者: idfah 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
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)
dialogos.py 文件源码 项目:pyvmwareclient 作者: wbugbofh 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 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
dialogos.py 文件源码 项目:pyvmwareclient 作者: wbugbofh 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
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
dialogos.py 文件源码 项目:pyvmwareclient 作者: wbugbofh 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
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
NURBS_fitting_by_Biarc_curves_wx.py 文件源码 项目:dxf2gcode 作者: cnc-club 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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()
wxMain.py 文件源码 项目:opc-rest-api 作者: matzpersson 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
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)
subpanel.py 文件源码 项目:bonsu 作者: bonsudev 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
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 )


问题


面经


文章

微信
公众号

扫码关注公众号