我们从Python开源项目中,提取了以下50个代码示例,用于说明如何使用wx.ALL。
def __init__(self): app = wx.App() self.frame = MainWindow(None, "Bonsu - The Interactive Phase Retrieval Suite") self.nb = wx.Notebook(self.frame) self.nb.AddPage(PanelPhase(self.nb), "Phasing Pipeline") self.nb.AddPage(PanelVisual(self.nb), "Visualisation") self.nb.AddPage(PanelGraph(self.nb), "Graph") self.nb.AddPage(PanelScript(self.nb), "Python Prompt") self.nb.AddPage(PanelStdOut(self.nb), "Log") self.frame.nb = self.nb self.frame.sizer.Add(self.nb, 1, wx.ALL|wx.EXPAND, 5) self.frame.SetBackgroundColour(wx.NullColour) self.frame.SetSizer(self.frame.sizer) self.frame.Fit() self.frame.Show() self.frame.OnFileArg() app.MainLoop()
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 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, 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, 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, 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 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 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=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 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) 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): 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: 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) 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 get_auto_clim_values(self, *args): """ Set min/max of display to n_sigma_below and n_sigma_above background 'cheat' for speed by sampling only a subset of pts """ finite_mask = np.isfinite(self.display_image) n_finite_pts = finite_mask.sum() if n_finite_pts > 0: n_pts = 1000 # sample ALL points unless the sampled points will be reasonably nicely distributed. e.g. # n_pts=1000, n_finite_pts=1999 -> all samples would be clumped in one half. # factor of 5* means that the 'missing' unsampled clump at the end is <=20% of total pts, which seems reasonable if n_finite_pts < (5*n_pts): robust_mean, robust_median, robust_stdev = sigma_clipped_stats(self.display_image[finite_mask]) else: stepsize = n_finite_pts/n_pts robust_mean, robust_median, robust_stdev = sigma_clipped_stats(self.display_image[finite_mask].ravel()[0::stepsize]) n_sigma_below = 1.0 n_sigma_above = 6. return (robust_mean - n_sigma_below * robust_stdev, robust_mean + n_sigma_above * robust_stdev) else: return (0., 0.) # no valid pixels
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, id = wx.ID_ANY, pos = (0,0), size = wx.Size( 285,190 ), style = wx.TAB_TRAVERSAL ) self.SetBackgroundColour((150,230,170)) #TESTING ONLY REMOVE WHEN SIZING IS DONE AND ALL THAT BUSINESS pi_link_pnl.target_ip = '' pi_link_pnl.target_user = '' pi_link_pnl.target_pass = '' pi_link_pnl.config_location_on_pi = '/home/pi/Pigrow/config/pigrow_config.txt' ## the three boxes for pi's connection details, IP, Username and Password self.l_ip = wx.StaticText(self, label='address', pos=(10, 20)) self.tb_ip = wx.TextCtrl(self, pos=(125, 25), size=(150, 25)) self.tb_ip.SetValue("192.168.1.") self.l_user = wx.StaticText(self, label='Username', pos=(10, 60)) self.tb_user = wx.TextCtrl(self, pos=(125, 60), size=(150, 25)) self.tb_user.SetValue("pi") self.l_pass = wx.StaticText(self, label='Password', pos=(10, 95)) self.tb_pass = wx.TextCtrl(self, pos=(125, 95), size=(150, 25)) self.tb_pass.SetValue("raspberry") ## link with pi button self.link_with_pi_btn = wx.Button(self, label='Link to Pi', pos=(10, 125), size=(175, 30)) self.link_with_pi_btn.Bind(wx.EVT_BUTTON, self.link_with_pi_btn_click) self.link_status_text = wx.StaticText(self, label='-- no link --', pos=(25, 160)) ## seek next pi button self.seek_for_pigrows_btn = wx.Button(self, label='Seek next', pos=(190,125)) self.seek_for_pigrows_btn.Bind(wx.EVT_BUTTON, self.seek_for_pigrows_click)
def initialise_visuals(self,item): print('Trying to initialise visuals with ', item) self.fieldname, self.field = item self.pyplotp = PyplotPanel(self) self.choosep = FieldChooserPanel(self) self.slidersp = RecordSliderPanel(self) vbox = wx.BoxSizer(wx.VERTICAL) hbox = wx.BoxSizer(wx.HORIZONTAL) hbox.Add(self.choosep, 0, wx.EXPAND | wx.ALL) hbox.Add(self.pyplotp, 1, wx.EXPAND | wx.ALL) vbox.Add(hbox, 1, wx.EXPAND | wx.ALL) vbox.Add(self.slidersp, 0, wx.EXPAND | wx.ALL) self.SetSizer(vbox) self.set_bindings() self.set_defaults()
def __init__(self, parent, info): wx.Dialog.__init__(self, parent, title=_("License"), size=(500, 400), style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) if parent and parent.GetIcon(): self.SetIcon(parent.GetIcon()) self.SetMinSize((400, 300)) close = wx.Button(self, id=wx.ID_CLOSE, label=_("&Close")) ctrl = wx.TextCtrl(self, style=wx.TE_READONLY | wx.TE_MULTILINE) ctrl.SetValue(info.License) btnSizer = wx.BoxSizer(wx.HORIZONTAL) btnSizer.Add(close) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(ctrl, 1, wx.EXPAND | wx.ALL, 10) sizer.Add(btnSizer, flag=wx.ALIGN_RIGHT | wx.RIGHT | wx.BOTTOM, border=10) self.SetSizer(sizer) self.Layout() self.Show() self.SetEscapeId(close.GetId()) close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
def __init__( self, parent, title): wx.Dialog.__init__ (self, parent, -1, title, style = wx.DEFAULT_DIALOG_STYLE) self.lst = wx.BoxSizer( wx.VERTICAL ) self.tus = [] self.funcs = {'ctrl':self.add_ctrl, 'slide':self.add_slide, int:self.add_num, float:self.add_num, 'lab':self.add_lab, bool:self.add_check, str:self.add_txt, list:self.add_choice, 'img':self.add_img, 'tab':self.add_tab, 'color':self.add_color} self.on_ok, self.on_cancel = None, None self.ctrl_dic = {} boxBack = wx.BoxSizer() boxBack.Add(self.lst, 0, wx.ALL, 10) self.SetSizer( boxBack ) self.Layout() self.handle = self.handle_
def add_color(self, title, key, unit): sizer = wx.BoxSizer( wx.HORIZONTAL ) lab_title = wx.StaticText( self, wx.ID_ANY, title, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE ) lab_title.Wrap( -1 ) sizer.Add( lab_title, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) ctrl = ColorCtrl(self) self.ctrl_dic[key] = ctrl ctrl.Bind(wx.EVT_KEY_UP, lambda x : self.para_changed(key)) sizer.Add( ctrl, 2, wx.ALL, 5 ) lab_unit = wx.StaticText( self, wx.ID_ANY, unit, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE ) lab_unit.Wrap( -1 ) sizer.Add( lab_unit, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.tus.append((lab_title, lab_unit)) self.lst.Add( sizer, 0, wx.EXPAND, 5 )
def add_slide(self, rang, title, key, unit): sizer = wx.BoxSizer( wx.HORIZONTAL ) lab_title = wx.StaticText( self, wx.ID_ANY, title, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE ) lab_title.Wrap( -1 ) sizer.Add( lab_title, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) iswin = platform.system() == 'Windows' lab = wx.SL_VALUE_LABEL if iswin else wx.SL_LABELS ctrl = wx.Slider( self, wx.ID_ANY, 50, rang[0], rang[1], wx.DefaultPosition, wx.Size( -1,-1 ), wx.SL_HORIZONTAL|lab ) self.ctrl_dic[key] = ctrl ctrl.Bind(wx.EVT_SCROLL, lambda x : self.para_changed(key)) sizer.Add( ctrl, 2, wx.ALL, 5 ) lab_unit = wx.StaticText( self, wx.ID_ANY, unit, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE ) lab_unit.Wrap( -1 ) sizer.Add( lab_unit, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.tus.append((lab_title, lab_unit)) self.lst.Add( sizer, 0, wx.EXPAND, 5 )
def add_txt(self, title, key, unit): sizer = wx.BoxSizer( wx.HORIZONTAL ) lab_title = wx.StaticText( self, wx.ID_ANY, title, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE ) lab_title.Wrap( -1 ) sizer.Add( lab_title, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) ctrl = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) self.ctrl_dic[key] = ctrl ctrl.Bind( wx.EVT_KEY_UP, lambda x : self.para_changed(key)) sizer.Add( ctrl, 2, wx.ALL, 5 ) lab_unit = wx.StaticText( self, wx.ID_ANY, unit, wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE ) lab_unit.Wrap( -1 ) sizer.Add( lab_unit, 0, wx.ALIGN_CENTER|wx.ALL, 5 ) self.tus.append((lab_title, lab_unit)) self.lst.Add( sizer, 0, wx.EXPAND, 5 )
def __init__(self): wx.Frame.__init__(self, None, wx.ID_ANY, "File and Folder Dialogs Tutorial") panel = wx.Panel(self, wx.ID_ANY) self.currentDirectory = os.getcwd() # create the buttons and bindings dirDlgBtn1 = wx.Button(panel, label="Choose Source") dirDlgBtn1.Bind(wx.EVT_BUTTON, self.onDir1) dirDlgBtn2 = wx.Button(panel, label="Choose Destination") dirDlgBtn2.Bind(wx.EVT_BUTTON, self.onDir2) moveBtn=wx.Button(panel, label="Check and Move Files") moveBtn.Bind(wx.EVT_BUTTON, self.moveUFiles) # put the buttons in a sizer sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(dirDlgBtn1, 0, wx.ALL|wx.CENTER, 5) sizer.Add(dirDlgBtn2, 0, wx.ALL|wx.CENTER, 5) sizer.Add(moveBtn, 0, wx.ALL|wx.CENTER, 5) panel.SetSizer(sizer)
def __do_layout(self): # begin wxGlade: ui_choice2Dialog.__do_layout sizer_1 = wx.BoxSizer(wx.HORIZONTAL) sizer_3 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_2.Add(self.numListBox, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 20) sizer_2.Add(self.button_ok, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 10) sizer_1.Add(sizer_2, 1, wx.EXPAND, 0) sizer_3.Add(self.denListBox, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 20) sizer_3.Add(self.button_cancel, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 10) sizer_1.Add(sizer_3, 1, wx.EXPAND, 0) self.SetSizer(sizer_1) self.Layout() # end wxGlade # end of class ui_choice2Dialog #if __name__ == "__main__": #app = wx.PySimpleApp(0) #wx.InitAllImageHandlers() #ChiantiPy = ui_choice2Dialog(None, -1, "") #app.SetTopWindow(ChiantiPy) #ChiantiPy.Show() #app.MainLoop()
def __do_layout(self): # begin wxGlade: working_days.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) grid_sizer_1 = wx.GridSizer(4, 2, 10, 10) grid_sizer_1.Add(self.label_1, 0, wx.LEFT, 20) grid_sizer_1.Add(self.combo_box_1, 0, wx.RIGHT, 20) grid_sizer_1.Add(self.label_5, 0, wx.LEFT, 74) grid_sizer_1.Add((0, 0), 0, 0, 0) grid_sizer_1.Add(self.label_2, 0, wx.LEFT | wx.TOP, 7) grid_sizer_1.Add(self.text_ctrl_1, 0, 0, 0) grid_sizer_1.Add(self.label_3, 0, wx.LEFT | wx.TOP, 7) grid_sizer_1.Add(self.text_ctrl_2, 0, 0, 0) grid_sizer_1.Add(self.label_4, 0, wx.LEFT | wx.TOP, 10) grid_sizer_1.Add(self.text_ctrl_3, 0, 0, 0) grid_sizer_1.Add(self.button_1, 0, wx.LEFT, 60) grid_sizer_1.Add(self.button_2, 0, wx.LEFT, 10) sizer_1.Add(grid_sizer_1, 1, wx.ALL | wx.EXPAND, 5) self.SetSizer(sizer_1) self.Layout() self.Centre() # end wxGlade
def __do_layout(self): # begin wxGlade: chng_pass.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) grid_sizer_1 = wx.GridSizer(4, 2, 0, 0) grid_sizer_1.Add(self.label_3, 0, wx.TOP, 10) grid_sizer_1.Add(self.combo_box_1, 0, 0, 0) grid_sizer_1.Add(self.label_4, 0, wx.TOP, 10) grid_sizer_1.Add(self.text_ctrl_1, 0, 0, 0) grid_sizer_1.Add(self.label_5, 0, wx.TOP, 10) grid_sizer_1.Add(self.text_ctrl_2, 0, 0, 0) grid_sizer_1.Add(self.label_6, 0, wx.TOP, 10) grid_sizer_1.Add(self.text_ctrl_3, 0, 0, 0) sizer_2.Add(grid_sizer_1, 1, wx.EXPAND, 0) sizer_3.Add(self.button_1, 0, wx.LEFT, 80) sizer_3.Add(self.button_2, 0, wx.LEFT, 30) sizer_2.Add(sizer_3, 0, wx.TOP | wx.EXPAND, 20) sizer_1.Add(sizer_2, 1, wx.ALL | wx.EXPAND, 20) self.SetSizer(sizer_1) sizer_1.Fit(self) self.Layout() self.Centre() # end wxGlade
def __init__( self, parent, id, titlemsg ): wx.Dialog.__init__( self, parent, id, title=titlemsg ) MechList = [] for m in parent.ScoreServer.MechList.List: MechList.append( str(m.ID) + ": " + str(m.Name) ) self.MechText = wx.StaticText( self, -1, "Mech Selection:" ) self.MechChoice = wx.ListBox( self, -1, style=wx.LB_EXTENDED, choices=MechList ) self.CancelButton = wx.Button( self, wx.ID_CANCEL, "Cancel" ) self.OKButton = wx.Button( self, wx.ID_OK, "OK" ) TopSizer = wx.BoxSizer( wx.VERTICAL ) BtnSizer = wx.BoxSizer( wx.HORIZONTAL ) BtnSizer.Add( self.CancelButton, 0, wx.ALL, 5 ) BtnSizer.Add( self.OKButton, 0, wx.ALL, 5 ) TopSizer.Add( self.MechText, 0, wx.ALL, 5 ) TopSizer.Add( self.MechChoice, 0, wx.ALL, 5 ) TopSizer.Add( BtnSizer, 0, wx.ALL|wx.CENTER, 5 ) self.SetSizer( TopSizer ) TopSizer.Fit( self )
def __do_layout(self): # begin wxGlade: TerminalSettingsDialog.__do_layout sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) self.sizer_4_staticbox.Lower() sizer_4 = wx.StaticBoxSizer(self.sizer_4_staticbox, wx.VERTICAL) sizer_4.Add(self.checkbox_echo, 0, wx.ALL, 4) sizer_4.Add(self.checkbox_unprintable, 0, wx.ALL, 4) sizer_4.Add(self.radio_box_newline, 0, 0, 0) sizer_2.Add(sizer_4, 0, wx.EXPAND, 0) sizer_3.Add(self.button_ok, 0, 0, 0) sizer_3.Add(self.button_cancel, 0, 0, 0) sizer_2.Add(sizer_3, 0, wx.ALL | wx.ALIGN_RIGHT, 4) self.SetSizer(sizer_2) sizer_2.Fit(self) self.Layout() # end wxGlade
def __do_layout(self): # begin wxGlade: TerminalSettingsDialog.__do_layout sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_3 = wx.BoxSizer(wx.HORIZONTAL) sizer_4 = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Input/Output"), wx.VERTICAL) sizer_4.Add(self.checkbox_echo, 0, wx.ALL, 4) sizer_4.Add(self.checkbox_unprintable, 0, wx.ALL, 4) sizer_4.Add(self.radio_box_newline, 0, 0, 0) sizer_2.Add(sizer_4, 0, wx.EXPAND, 0) sizer_3.Add(self.button_ok, 0, 0, 0) sizer_3.Add(self.button_cancel, 0, 0, 0) sizer_2.Add(sizer_3, 0, wx.ALL|wx.ALIGN_RIGHT, 4) self.SetAutoLayout(1) self.SetSizer(sizer_2) sizer_2.Fit(self) sizer_2.SetSizeHints(self) self.Layout() # end wxGlade
def __init__(self, parent, frame, ID, label): wx.Panel.__init__(self, parent, ID) self.frame = frame box = wx.StaticBox(self, -1, label) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) self.next_button = wx.Button(self, -1, label="Next 100") self.next_button.Bind(wx.EVT_BUTTON, self.on_next) self.previous_button = wx.Button(self, -1, label="Previous 100") self.previous_button.Bind(wx.EVT_BUTTON, self.on_previous) manual_box = wx.BoxSizer(wx.HORIZONTAL) manual_box.Add(self.previous_button, flag=wx.ALIGN_CENTER_VERTICAL) manual_box.AddSpacer(10) manual_box.Add(self.next_button, flag=wx.ALIGN_CENTER_VERTICAL) sizer.Add(manual_box, 0, wx.ALL, 10) self.SetSizer(sizer) sizer.Fit(self)
def layoutWidgets(self): boxSizerV = wx.BoxSizer( wx.VERTICAL ) boxSizerV.Add( self.statBoxSizerV, 1, wx.ALL ) boxSizerV.Add( self.statBoxSizerMgrV, 1, wx.ALL ) self.panel.SetSizer( boxSizerV ) boxSizerV.SetSizeHints( self.panel ) #----------------------------------------------------------
def addStaticBoxWithLabels(self): boxSizerH = wx.BoxSizer(wx.HORIZONTAL) staticBox = wx.StaticBox( self.panel, -1, "Labels within a Frame" ) staticBoxSizerV = wx.StaticBoxSizer( staticBox, wx.VERTICAL ) boxSizerV = wx.BoxSizer( wx.VERTICAL ) staticText1 = wx.StaticText( self.panel, -1, " Choose a number:" ) boxSizerV.Add( staticText1, 0, wx.ALL) staticText2 = wx.StaticText( self.panel, -1, " Label 2") boxSizerV.Add( staticText2, 0, wx.ALL ) #------------------------------------------------------ staticBoxSizerV.Add( boxSizerV, 0, wx.ALL ) boxSizerH.Add(staticBoxSizerV) #------------------------------------------------------ boxSizerH.Add(wx.ComboBox(self.panel, size=(70, -1))) #------------------------------------------------------ boxSizerH.Add(wx.SpinCtrl(self.panel, size=(50, -1), style=wx.BORDER_RAISED)) # Add local boxSizer to main frame self.statBoxSizerV.Add( boxSizerH, 1, wx.ALL ) #----------------------------------------------------------
def addTextCtrl(self): boxSizerH = wx.BoxSizer(wx.HORIZONTAL) boxSizerH.Add(wx.TextCtrl(self.panel, size=(275, -1), style= wx.TE_MULTILINE)) self.statBoxSizerV.Add( boxSizerH, 1, wx.ALL ) #----------------------------------------------------------
def addButtons(self): boxSizerH = wx.BoxSizer(wx.HORIZONTAL) boxSizerH.Add(wx.Button(self.panel, label='All Time Zones')) boxSizerH.Add(wx.Button(self.panel, label='Local Zone')) boxSizerH.Add(wx.Button(self.panel, label='New York')) self.statBoxSizerV.Add( boxSizerH, 1, wx.ALL ) #----------------------------------------------------------
def __init__(self, parent, style, html_body_content, bgcolor, size): wx.PopupTransientWindow.__init__(self, parent, style) panel = wx.Panel(self) panel.SetBackgroundColour(bgcolor) html_window = self.HtmlWindow(panel, wx.ID_ANY, size=size) html_window.SetPage('<body bgcolor="' + bgcolor + '">' + html_body_content + '</body>') sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(html_window, 0, wx.ALL, 5) panel.SetSizer(sizer) sizer.Fit(panel) sizer.Fit(self) self.Layout()
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()