Python wx.BOTTOM Examples
The following are 30
code examples of wx.BOTTOM().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
wx
, or try the search function
.
Example #1
Source File: misc.py From trelby with GNU General Public License v2.0 | 7 votes |
def __init__(self, parent, text, title): wx.Dialog.__init__(self, parent, -1, title, style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER) vsizer = wx.BoxSizer(wx.VERTICAL) tc = wx.TextCtrl(self, -1, size = wx.Size(400, 200), style = wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_LINEWRAP) tc.SetValue(text) vsizer.Add(tc, 1, wx.EXPAND); vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5) okBtn = gutil.createStockButton(self, "OK") vsizer.Add(okBtn, 0, wx.ALIGN_CENTER) util.finishWindow(self, vsizer) wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK) okBtn.SetFocus()
Example #2
Source File: button.py From wxGlade with MIT License | 6 votes |
def __init__(self, name, parent, index, label): # Initialise parent classes ManagedBase.__init__(self, name, parent, index) EditStylesMixin.__init__(self) BitmapMixin.__init__(self) # initialise instance properties self.label = np.TextProperty(label, default_value="", multiline="grow") self.default = np.CheckBoxProperty(False, default_value=False) self.stockitem = np.ListBoxPropertyD(self.STOCKITEMS[0], choices=self.STOCKITEMS) self.bitmap = np.BitmapPropertyD(min_version=(3,0)) self.disabled_bitmap = np.BitmapPropertyD(min_version=(3,0)) self.pressed_bitmap = np.BitmapPropertyD(min_version=(3,0)) self.current_bitmap = np.BitmapPropertyD(min_version=(3,0)) self.focus_bitmap = np.BitmapPropertyD(min_version=(3,0)) values = [wx.LEFT, wx.RIGHT, wx.TOP, wx.BOTTOM] aliases = ["wxLEFT", "wxRIGHT", "wxTOP", "wxBOTTOM"] p = self.bitmap_dir = np.RadioProperty(wx.LEFT, values, columns=4, aliases=aliases, default_value=wx.LEFT) p.min_version = (3,0) p.blocked = True
Example #3
Source File: optionsframe.py From youtube-dl-gui with The Unlicense | 6 votes |
def _set_layout(self): main_sizer = wx.BoxSizer(wx.HORIZONTAL) vertical_sizer = wx.BoxSizer(wx.VERTICAL) vertical_sizer.Add(self.subtitles_label) vertical_sizer.Add(self.subtitles_combobox, flag=wx.EXPAND | wx.ALL, border=5) vertical_sizer.Add(self.subtitles_lang_listbox, 1, wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5) vertical_sizer.Add(self.subtitles_opts_label, flag=wx.TOP, border=5) vertical_sizer.Add(self.embed_subs_checkbox, flag=wx.ALL, border=5) plist_and_fsize_sizer = wx.BoxSizer(wx.HORIZONTAL) plist_and_fsize_sizer.Add(self._build_playlist_sizer(), 1, wx.EXPAND) plist_and_fsize_sizer.AddSpacer((5, -1)) plist_and_fsize_sizer.Add(self._build_filesize_sizer(), 1, wx.EXPAND) vertical_sizer.Add(plist_and_fsize_sizer, 1, wx.EXPAND | wx.TOP, border=5) main_sizer.Add(vertical_sizer, 1, wx.EXPAND | wx.ALL, border=5) self.SetSizer(main_sizer)
Example #4
Source File: optionsframe.py From youtube-dl-gui with The Unlicense | 6 votes |
def _set_layout(self): main_sizer = wx.BoxSizer(wx.HORIZONTAL) vertical_sizer = wx.BoxSizer(wx.VERTICAL) vertical_sizer.Add(self.video_formats_label) vertical_sizer.Add(self.video_formats_checklistbox, 1, wx.EXPAND | wx.ALL, border=5) vertical_sizer.Add(self.audio_formats_label, flag=wx.TOP, border=5) vertical_sizer.Add(self.audio_formats_checklistbox, 1, wx.EXPAND | wx.ALL, border=5) vertical_sizer.Add(self.post_proc_opts_label, flag=wx.TOP, border=5) vertical_sizer.Add(self.keep_video_checkbox, flag=wx.ALL, border=5) vertical_sizer.Add(self.extract_audio_checkbox, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5) vertical_sizer.Add(self.embed_thumbnail_checkbox, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5) vertical_sizer.Add(self.add_metadata_checkbox, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5) audio_quality_sizer = wx.BoxSizer(wx.HORIZONTAL) audio_quality_sizer.Add(self.audio_quality_label, flag=wx.ALIGN_CENTER_VERTICAL) audio_quality_sizer.AddSpacer((20, -1)) audio_quality_sizer.Add(self.audio_quality_combobox) vertical_sizer.Add(audio_quality_sizer, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM, border=5) main_sizer.Add(vertical_sizer, 1, wx.EXPAND | wx.ALL, border=5) self.SetSizer(main_sizer)
Example #5
Source File: ConfigEditor.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
def _create_EthercatNodeEditor(self, prnt): self.EthercatNodeEditor = wx.Panel(prnt, style=wx.TAB_TRAVERSAL) main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=5) main_sizer.AddGrowableCol(0) main_sizer.AddGrowableRow(1) variables_label = wx.StaticText(self.EthercatNodeEditor, label=_('Variable entries:')) main_sizer.AddWindow(variables_label, border=10, flag=wx.TOP | wx.LEFT | wx.RIGHT) self.NodeVariables = NodeVariablesSizer(self.EthercatNodeEditor, self.Controler) main_sizer.AddSizer(self.NodeVariables, border=10, flag=wx.GROW | wx.BOTTOM | wx.LEFT | wx.RIGHT) self.EthercatNodeEditor.SetSizer(main_sizer) return self.EthercatNodeEditor
Example #6
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def Configure(self, cmdLineArgs=""): vlcPath = GetVlcPath() panel = eg.ConfigPanel() cmdLineCtrl = panel.TextCtrl(cmdLineArgs) resultCtrl = eg.StaticTextBox(panel) def OnTextChange(event=None): cmdLineArgs = cmdLineCtrl.GetValue() cmdString = '"%s" %s' % (vlcPath, self.GetCmdLineArgs(cmdLineArgs)) resultCtrl.SetValue(cmdString) if event: event.Skip() OnTextChange() cmdLineCtrl.Bind(wx.EVT_TEXT, OnTextChange) panel.sizer.AddMany([ (panel.StaticText(self.text.additionalArgs), 0, wx.BOTTOM, 3), (cmdLineCtrl, 0, wx.EXPAND|wx.BOTTOM, 5), ((15, 15), ), (panel.StaticText(self.text.resultingCmdLine), 0, wx.BOTTOM, 3), (resultCtrl, 1, wx.EXPAND), ]) while panel.Affirmed(): panel.SetResult(cmdLineCtrl.GetValue())
Example #7
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 6 votes |
def Configure(self, imageFileName='', style=1): panel = eg.ConfigPanel() text = self.text filepathCtrl = eg.FileBrowseButton( panel, size = (340, -1), initialValue = imageFileName, labelText = "", fileMask = text.fileMask, buttonText = eg.text.General.browse, ) choice = wx.Choice(panel, -1, choices=text.choices) choice.SetSelection(style) sizer = panel.sizer sizer.Add(panel.StaticText(text.text1), 0, wx.EXPAND) sizer.Add(filepathCtrl, 0, wx.EXPAND) sizer.Add(panel.StaticText(text.text2), 0, wx.EXPAND | wx.TOP, 10) sizer.Add(choice, 0, wx.BOTTOM, 10) while panel.Affirmed(): panel.SetResult(filepathCtrl.GetValue(), choice.GetSelection())
Example #8
Source File: ProjectDialog.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
def __init__(self, parent, enable_required=True): wx.Dialog.__init__(self, parent, title=_('Project properties'), style=wx.DEFAULT_DIALOG_STYLE) main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10) main_sizer.AddGrowableCol(0) main_sizer.AddGrowableRow(0) self.ProjectProperties = ProjectPropertiesPanel( self, enable_required=enable_required, scrolling=False) main_sizer.AddWindow(self.ProjectProperties, flag=wx.GROW) self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE) self.Bind(wx.EVT_BUTTON, self.OnOK, self.ButtonSizer.GetAffirmativeButton()) main_sizer.AddSizer(self.ButtonSizer, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT) self.SetSizer(main_sizer) self.ProjectProperties.Fit() self.Fit()
Example #9
Source File: AboutDialog.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
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())
Example #10
Source File: dialogs.py From NVDARemote with GNU General Public License v2.0 | 6 votes |
def __init__(self, parent, id, title): super().__init__(parent, id, title=title) main_sizer = self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.client_or_server = wx.RadioBox(self, wx.ID_ANY, choices=(_("Client"), _("Server")), style=wx.RA_VERTICAL) self.client_or_server.Bind(wx.EVT_RADIOBOX, self.on_client_or_server) self.client_or_server.SetSelection(0) main_sizer.Add(self.client_or_server) choices = [_("Control another machine"), _("Allow this machine to be controlled")] self.connection_type = wx.RadioBox(self, wx.ID_ANY, choices=choices, style=wx.RA_VERTICAL) self.connection_type.SetSelection(0) main_sizer.Add(self.connection_type) self.container = wx.Panel(parent=self) self.panel = ClientPanel(parent=self.container) main_sizer.Add(self.container) buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL) main_sizer.Add(buttons, flag=wx.BOTTOM) main_sizer.Fit(self) self.SetSizer(main_sizer) self.Center(wx.BOTH | WX_CENTER) ok = wx.FindWindowById(wx.ID_OK, self) ok.Bind(wx.EVT_BUTTON, self.on_ok)
Example #11
Source File: tydesk.py From tydesk with GNU General Public License v3.0 | 6 votes |
def InitUI(self): pnl = wx.Panel(self) vbox = wx.BoxSizer(wx.VERTICAL) sb = wx.StaticBox(pnl, label=u'请输入员工号') sbs = wx.StaticBoxSizer(sb, orient=wx.VERTICAL) self.tcCheckin = wx.TextCtrl(pnl) sbs.Add(self.tcCheckin, 0, wx.ALL|wx.EXPAND, 5) pnl.SetSizer(sbs) hbox2 = wx.BoxSizer(wx.HORIZONTAL) okButton = wx.Button(self, label=u'确认') closeButton = wx.Button(self, label=u'取消') hbox2.Add(okButton) hbox2.Add(closeButton, flag=wx.LEFT, border=5) vbox.Add(pnl, 0, wx.ALL|wx.EXPAND, 5) vbox.Add(hbox2, 0, wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM, 10) self.SetSizer(vbox) self.Layout() okButton.Bind(wx.EVT_BUTTON, self.OnConfirm) closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
Example #12
Source File: ProjectPropertiesPanel.py From OpenPLC_Editor with GNU General Public License v3.0 | 6 votes |
def AddSizerParams(self, parent, sizer, params): for idx, (name, label) in enumerate(params): border = 0 if idx == 0: border |= wx.TOP elif idx == len(params) - 1: border |= wx.BOTTOM st = wx.StaticText(parent, label=label) sizer.AddWindow(st, border=10, flag=wx.ALIGN_CENTER_VERTICAL | border | wx.LEFT) tc = wx.TextCtrl(parent, style=wx.TE_PROCESS_ENTER) setattr(self, name, tc) callback = self.GetTextCtrlChangedFunction(tc, name) self.Bind(wx.EVT_TEXT_ENTER, callback, tc) tc.Bind(wx.EVT_KILL_FOCUS, callback) sizer.AddWindow(tc, border=10, flag=wx.GROW | border | wx.RIGHT)
Example #13
Source File: welcome.py From DeepLabCut with GNU Lesser General Public License v3.0 | 6 votes |
def __init__(self, parent, gui_size): h = gui_size[0] w = gui_size[1] wx.Panel.__init__(self, parent, -1, style=wx.SUNKEN_BORDER, size=(h, w)) ## design the panel sizer = wx.GridBagSizer(10, 7) # Add image of DLC icon = wx.StaticBitmap(self, bitmap=wx.Bitmap(dlc)) sizer.Add(icon, pos=(0, 0), span=(0, 8), flag=wx.EXPAND | wx.BOTTOM, border=10) line = wx.StaticLine(self) sizer.Add(line, pos=(1, 0), span=(1, 8), flag=wx.EXPAND | wx.BOTTOM, border=10) # if editing this text make sure you add the '\n' to get the new line. The sizer is unable to format lines correctly. description = "DeepLabCut™ is an open source tool for markerless\npose estimation of user-defined body parts with deep learning.\nA. and M.W. Mathis Labs | http://www.deeplabcut.org\n \nWelcome to the DeepLabCut Project Manager GUI!\nTo get started, please click on the 'Manage Project'\n tab to create or load an existing project. \n " self.proj_name = wx.StaticText(self, label=description, style=wx.ALIGN_CENTRE) sizer.Add(self.proj_name, pos=(2, 3), border=10) sizer.AddGrowableCol(2) self.SetSizer(sizer) sizer.Fit(self)
Example #14
Source File: ConfigPanel.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def AddCtrl(self, ctrl): self.sizer.Add(ctrl, 0, wx.BOTTOM, 10)
Example #15
Source File: DiscoveryPanel.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def _init_coll_MainSizer_Items(self, parent): parent.AddWindow(self.staticText1, 0, border=20, flag=wx.TOP | wx.LEFT | wx.RIGHT | wx.GROW) parent.AddWindow(self.ServicesList, 0, border=20, flag=wx.LEFT | wx.RIGHT | wx.GROW) parent.AddSizer(self.ButtonGridSizer, 0, border=20, flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.GROW)
Example #16
Source File: ListCtrlPrinter.py From bookhub with MIT License | 5 votes |
def Normal(headerFontName="Gill Sans", rowFontName="Times New Roman"): """ Return a reasonable default format for a report """ fmt = ReportFormat() fmt.IsShrinkToFit = True fmt.PageHeader.Font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face=headerFontName) fmt.PageHeader.Line(wx.BOTTOM, wx.BLUE, 2, space=5) fmt.PageHeader.Padding = (0, 0, 0, 12) fmt.ListHeader.Font = wx.FFont(26, wx.FONTFAMILY_SWISS, wx.FONTFLAG_BOLD, face=headerFontName) fmt.ListHeader.TextColor = wx.WHITE fmt.ListHeader.Padding = (0, 12, 0, 12) fmt.ListHeader.TextAlignment = wx.ALIGN_LEFT fmt.ListHeader.Background(wx.BLUE, wx.WHITE, space=(16, 4, 0, 4)) fmt.GroupTitle.Font = wx.FFont(14, wx.FONTFAMILY_DEFAULT, face=headerFontName) fmt.GroupTitle.Line(wx.BOTTOM, wx.BLUE, 4, toColor=wx.WHITE, space=5) fmt.GroupTitle.Padding = (0, 12, 0, 12) fmt.PageFooter.Font = wx.FFont(10, wx.FONTFAMILY_DEFAULT, face=headerFontName) fmt.PageFooter.Background(wx.WHITE, wx.BLUE, space=(0, 4, 0, 4)) fmt.ColumnHeader.Font = wx.FFont(14, wx.FONTFAMILY_DEFAULT, wx.FONTFLAG_BOLD, face=headerFontName) fmt.ColumnHeader.CellPadding = 2 fmt.ColumnHeader.Background(wx.Colour(192, 192, 192)) fmt.ColumnHeader.GridPen = wx.Pen(wx.WHITE, 1) fmt.ColumnHeader.Padding = (0, 0, 0, 12) fmt.ColumnHeader.AlwaysCenter = True fmt.Row.Font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face=rowFontName) fmt.Row.Line(wx.BOTTOM, pen=wx.Pen(wx.BLUE, 1, wx.DOT), space=3) fmt.Row.CellPadding = 2 fmt.Row.CanWrap = True return fmt
Example #17
Source File: IDEFrame.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def ComputeTabsLayout(tabs, rect): if len(tabs) == 0: return tabs if len(tabs) == 1: return tabs[0] split = None split_id = None for idx, tab in enumerate(tabs): if len(tab["pages"]) == 0: raise ValueError("Not possible") if tab["size"][0] == rect.width: if tab["pos"][1] == rect.y: split = (wx.TOP, tab["size"][1] / rect.height) split_rect = wx.Rect(rect.x, rect.y + tab["size"][1] + TAB_BORDER, rect.width, rect.height - tab["size"][1] - TAB_BORDER) elif tab["pos"][1] == rect.height + 1 - tab["size"][1]: split = (wx.BOTTOM, 1.0 - tab["size"][1] / rect.height) split_rect = wx.Rect(rect.x, rect.y, rect.width, rect.height - tab["size"][1] - TAB_BORDER) split_id = idx break elif tab["size"][1] == rect.height: if tab["pos"][0] == rect.x: split = (wx.LEFT, tab["size"][0] / rect.width) split_rect = wx.Rect(rect.x + tab["size"][0] + TAB_BORDER, rect.y, rect.width - tab["size"][0] - TAB_BORDER, rect.height) elif tab["pos"][0] == rect.width + 1 - tab["size"][0]: split = (wx.RIGHT, 1.0 - tab["size"][0] / rect.width) split_rect = wx.Rect(rect.x, rect.y, rect.width - tab["size"][0] - TAB_BORDER, rect.height) split_id = idx break if split is not None: split_tab = tabs.pop(split_id) return {"split": split, "tab": split_tab, "others": ComputeTabsLayout(tabs, split_rect)} else: if SimplifyTabLayout(tabs, rect): return ComputeTabsLayout(tabs, rect) return tabs
Example #18
Source File: ListCtrlPrinter.py From bookhub with MIT License | 5 votes |
def Minimal(headerFontName="Arial", rowFontName="Times New Roman"): """ Return a minimal format for a report """ fmt = ReportFormat() fmt.IsShrinkToFit = False fmt.PageHeader.Font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face=headerFontName) fmt.PageHeader.Line(wx.BOTTOM, wx.BLACK, 1, space=5) fmt.PageHeader.Padding = (0, 0, 0, 12) fmt.ListHeader.Font = wx.FFont(18, wx.FONTFAMILY_DEFAULT, face=headerFontName) fmt.ListHeader.Padding = (0, 12, 0, 12) fmt.ListHeader.Line(wx.BOTTOM, wx.BLACK, 1, space=5) fmt.GroupTitle.Font = wx.FFont(12, wx.FONTFAMILY_DEFAULT, face=headerFontName) fmt.GroupTitle.Padding = (0, 12, 0, 12) fmt.GroupTitle.Line(wx.BOTTOM, wx.BLACK, 1, space=5) fmt.PageFooter.Font = wx.FFont(10, wx.FONTFAMILY_DEFAULT, face=headerFontName) fmt.PageFooter.Line(wx.TOP, wx.BLACK, 1, space=3) fmt.PageFooter.Padding = (0, 16, 0, 0) fmt.ColumnHeader.Font = wx.FFont(14, wx.FONTFAMILY_DEFAULT, wx.FONTFLAG_BOLD, face=headerFontName) fmt.ColumnHeader.Padding = (0, 12, 0, 12) fmt.ColumnHeader.CellPadding = 5 fmt.ColumnHeader.Line(wx.BOTTOM, wx.Colour(192, 192, 192), 1, space=3) fmt.ColumnHeader.AlwaysCenter = True fmt.Row.Font = wx.FFont(10, wx.FONTFAMILY_DEFAULT, face=rowFontName) fmt.Row.CellPadding = 5 fmt.Row.Line(wx.BOTTOM, wx.Colour(192, 192, 192), 1, space=3) fmt.Row.CanWrap = True return fmt
Example #19
Source File: CommentEditDialog.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, font, value="", size=wx.Size(400, 200)): """ Constructor :param parent: parent window (wx.Window) :param font: the font for text control :param value: the default value, which may be the empty string :param size: desired initial size for text control. Minimal size of text control is limited by (100,100) """ wx.Dialog.__init__(self, parent, title=_("Please enter comment text")) msg_label = wx.StaticText(self, label=_("Edit comment")) input_size = wx.Size(max(size[0], 100), max(size[1], 100)) input = wx.TextCtrl(self, style=wx.TE_MULTILINE) input.SetInitialSize(input_size) input.SetFont(font) input.SetValue(value) buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL) sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10) border = 20 sizer.Add(msg_label, 0, flag=wx.TOP | wx.LEFT | wx.RIGHT, border=border) sizer.Add(input, 1, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=border) sizer.Add(buttons, 0, flag=wx.EXPAND | wx.LEFT | wx.RIGHT | wx.BOTTOM, border=border) self.SetSizerAndFit(sizer) self.input = input
Example #20
Source File: ListCtrlPrinter.py From bookhub with MIT License | 5 votes |
def Line(self, side=wx.BOTTOM, color=wx.BLACK, width=1, toColor=None, space=0, pen=None): """ Add a line to our decorations. If a pen is given, we use a straight Line decoration, otherwise we use a coloured rectangle """ if pen: self.Add(LineDecoration(side, pen, space)) else: self.Add(RectangleDecoration(side, None, color, toColor, width, space))
Example #21
Source File: __init__.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def Configure(self, link=None): panel = eg.ConfigPanel(resizable=True) if link is not None: searchItem = link.target else: searchItem = None link = eg.TreeLink(panel.dialog.treeItem) tree = eg.TreeItemBrowseCtrl( panel, self.FilterFunc, #searchFunc, selectItem=searchItem ) tree.SetFocus() panel.sizer.Add(panel.StaticText(self.text.text1), 0, wx.BOTTOM, 5) panel.sizer.Add(tree, 1, wx.EXPAND) while panel.Affirmed(): treeItem = tree.GetSelection() if treeItem.IsOk(): obj = tree.GetPyData(treeItem) if self.IsSelectableItem(obj): link.SetTarget(obj) panel.SetResult(link) continue eg.MessageBox(self.text.cantSelect, parent=panel)
Example #22
Source File: ConfigPanel.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def FinishSetup(self): self.shown = True if self.lines: self.AddGrid(self.lines, *self.sizerProps) spaceSizer = wx.BoxSizer(wx.HORIZONTAL) spaceSizer.Add((2, 2)) spaceSizer.Add(self.sizer, 1, wx.EXPAND | wx.TOP | wx.BOTTOM, 3) spaceSizer.Add((4, 4)) self.SetSizerAndFit(spaceSizer) #self.dialog.FinishSetup() def OnEvent(dummyEvent): self.SetIsDirty() self.Bind(wx.EVT_CHECKBOX, OnEvent) self.Bind(wx.EVT_BUTTON, OnEvent) self.Bind(wx.EVT_CHOICE, OnEvent) self.Bind(wx.EVT_TOGGLEBUTTON, OnEvent) self.Bind(wx.EVT_TEXT, OnEvent) self.Bind(wx.EVT_RADIOBOX, OnEvent) self.Bind(wx.EVT_RADIOBUTTON, OnEvent) self.Bind(wx.EVT_TREE_SEL_CHANGED, OnEvent) self.Bind(wx.EVT_DATE_CHANGED, OnEvent) self.Bind(eg.EVT_VALUE_CHANGED, OnEvent) self.Bind(wx.EVT_CHECKLISTBOX, OnEvent) self.Bind(wx.EVT_SCROLL, OnEvent) self.Bind(wx.EVT_LISTBOX, OnEvent)
Example #23
Source File: ConfigPanel.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def AddLabel(self, label): self.sizer.Add(self.StaticText(label), 0, wx.BOTTOM, 2)
Example #24
Source File: __init__.py From BitTorrent with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, path='', setfunc=None, editable=True, file_dialog_title=_("Choose a file..."), directory_dialog_title=_("Choose a folder..."), file_button_label=_("Choose &file..."), directory_button_label=_("Choose f&older..."), wildcard=_("All files (*.*)|*.*"), file_dialog_style=wx.OPEN): wx.BoxSizer.__init__(self, wx.VERTICAL) self.parent = parent self.setfunc = setfunc self.file_dialog_title = file_dialog_title self.directory_dialog_title = directory_dialog_title self.file_button_label = file_button_label self.directory_button_label = directory_button_label self.wildcard = wildcard self.file_dialog_style = file_dialog_style self.pathbox = wx.TextCtrl(self.parent, size=(250, -1)) self.pathbox.SetEditable(editable) self.Add(self.pathbox, flag=wx.EXPAND|wx.BOTTOM, border=SPACING) self.pathbox.SetValue(path) self.subsizer = wx.BoxSizer(wx.HORIZONTAL) self.Add(self.subsizer, flag=wx.ALIGN_RIGHT, border=0) self.fbutton = PathDialogButton(parent, gen_dialog=self.file_dialog, setfunc=self.set_choice, label=self.file_button_label) self.subsizer.Add(self.fbutton, flag=wx.LEFT, border=SPACING) self.dbutton = PathDialogButton(parent, gen_dialog=self.directory_dialog, setfunc=self.set_choice, label=self.directory_button_label) self.subsizer.Add(self.dbutton, flag=wx.LEFT, border=SPACING)
Example #25
Source File: Password.py From EventGhost with GNU General Public License v2.0 | 5 votes |
def __init__(self): self.result = None wx.Dialog.__init__(self, eg.document.frame) staticText = wx.StaticText( self, -1, "Please enter your master password:" ) self.passwordCtrl = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD) self.buttonRow = eg.ButtonRow(self, (wx.ID_OK, wx.ID_CANCEL)) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(staticText, 0, wx.EXPAND | wx.ALL, 5) sizer.Add(self.passwordCtrl, 0, wx.EXPAND | wx.ALL, 5) sizer.Add(wx.StaticLine(self), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5) sizer.Add(self.buttonRow.sizer, 0, wx.ALIGN_CENTER) self.SetSizerAndFit(sizer)
Example #26
Source File: custom_widget.py From wxGlade with MIT License | 5 votes |
def __init__(self): title = _('Enter widget class') wx.Dialog.__init__(self, None, -1, title, wx.GetMousePosition()) klass = 'CustomWidget' self.classname = wx.TextCtrl(self, -1, klass) sizer = wx.BoxSizer(wx.VERTICAL) hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add(wx.StaticText(self, -1, _('class')), 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5) hsizer.Add(self.classname, 1, wx.ALIGN_CENTER_VERTICAL|wx.TOP|wx.BOTTOM|wx.RIGHT, 3) sizer.Add(hsizer, 0, wx.EXPAND) # horizontal sizer for action buttons hsizer = wx.BoxSizer(wx.HORIZONTAL) hsizer.Add( wx.Button(self, wx.ID_CANCEL, _('Cancel')), 1, wx.ALL, 5) self.OK_button = btn = wx.Button(self, wx.ID_OK, _('OK') ) btn.SetDefault() hsizer.Add(btn, 1, wx.ALL, 5) sizer.Add(hsizer, 0, wx.EXPAND) self.SetAutoLayout(True) self.SetSizer(sizer) sizer.Fit(self) w = self.GetTextExtent(title)[0] + 50 if self.GetSize()[0] < w: self.SetSize((w, -1)) self.classname.Bind(wx.EVT_TEXT, self.validate)
Example #27
Source File: params.py From admin4 with Apache License 2.0 | 5 votes |
def __init__(self, parent, name, textWidth=-1): PPanel.__init__(self, parent, name) self.ID_TEXT_CTRL = wx.NewId() # We use sizer even here to have the same size of text control sizer = wx.BoxSizer() self.text = wx.TextCtrl(self, self.ID_TEXT_CTRL, size=wx.Size(textWidth,-1)) if textWidth == -1: option = 1 else: option = 0 sizer.Add(self.text, option, wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.BOTTOM, 2) self.SetAutoLayout(True) self.SetSizerAndFit(sizer) wx.EVT_TEXT(self, self.ID_TEXT_CTRL, self.OnChange)
Example #28
Source File: params.py From admin4 with Apache License 2.0 | 5 votes |
def __init__(self, parent, name): PPanel.__init__(self, parent, name) self.ID_TEXT_CTRL = wx.NewId() self.ID_BUTTON = wx.NewId() sizer = wx.BoxSizer() self.text = wx.TextCtrl(self, self.ID_TEXT_CTRL, size=(80,-1)) sizer.Add(self.text, 0, wx.ALIGN_CENTER_VERTICAL | wx.TOP | wx.BOTTOM, 2) self.button = wx.Panel(self, self.ID_BUTTON, wx.DefaultPosition, wx.Size(20, 20)) sizer.Add(self.button, 0, wx.ALIGN_CENTER_VERTICAL | wx.LEFT, 5) self.SetAutoLayout(True) self.SetSizerAndFit(sizer) self.textModified = False wx.EVT_PAINT(self.button, self.OnPaintButton) wx.EVT_TEXT(self, self.ID_TEXT_CTRL, self.OnChange) wx.EVT_LEFT_DOWN(self.button, self.OnLeftDown)
Example #29
Source File: runtime_display_panel.py From me-ica with GNU Lesser General Public License v2.1 | 5 votes |
def _do_layout(self): sizer = wx.BoxSizer(wx.VERTICAL) sizer.AddSpacer(10) sizer.Add(self.text, 0, wx.LEFT, 30) sizer.AddSpacer(10) sizer.Add(self.cmd_textbox, 1, wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, 30) sizer.AddSpacer(20) self.SetSizer(sizer)
Example #30
Source File: LanguageSettings.py From BitTorrent with GNU General Public License v3.0 | 5 votes |
def set_error(self, errstr): index = self.box_sizer.GetItem(self.bottom_error) if not index: self.box_sizer.Add(self.bottom_error, flag=wx.BOTTOM|wx.LEFT|wx.RIGHT, border=SPACING) self.bottom_error.SetLabel(errstr) if text_wrappable: self.bottom_error.Wrap(250) self.refit()