Python wx.RESIZE_BORDER Examples

The following are 30 code examples of wx.RESIZE_BORDER(). 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: dialog.py    From wxGlade with MIT License 7 votes vote down vote up
def create_widget(self):
        if self.parent:
            parent = self.parent.widget
        else:
            parent = common.main

        # we set always a default style because this is the best one for editing the dialog
        # (for example, a dialog without a caption would be hard to move, etc.)
        default_style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        if common.pin_design_window: default_style |= wx.STAY_ON_TOP

        # change 2002-10-09: now we create a wxFrame instead of a wxDialog,
        # because the latter gives troubles I wasn't able to solve when using wxPython 2.3.3.1 :-/
        self.widget = wx.Frame(parent, self.id, "", style=default_style)
        self.widget.SetBackgroundColour(compat.wx_SystemSettings_GetColour(wx.SYS_COLOUR_BTNFACE))
        self._set_widget_icon() 
Example #2
Source File: misc.py    From trelby with GNU General Public License v2.0 7 votes vote down vote up
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 #3
Source File: backend_wx.py    From Mastering-Elasticsearch-7.0 with MIT License 7 votes vote down vote up
def __init__(self, parent, help_entries):
        wx.Dialog.__init__(self, parent, title="Help",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)
        grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
        # create and add the entries
        bold = self.GetFont().MakeBold()
        for r, row in enumerate(self.headers + help_entries):
            for (col, width) in zip(row, self.widths):
                label = wx.StaticText(self, label=col)
                if r == 0:
                    label.SetFont(bold)
                label.Wrap(width)
                grid_sizer.Add(label, 0, 0, 0)
        # finalize layout, create button
        sizer.Add(grid_sizer, 0, wx.ALL, 6)
        OK = wx.Button(self, wx.ID_OK)
        sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.Layout()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        OK.Bind(wx.EVT_BUTTON, self.OnClose) 
Example #4
Source File: backend_wx.py    From coffeegrindsize with MIT License 6 votes vote down vote up
def __init__(self, parent, help_entries):
        wx.Dialog.__init__(self, parent, title="Help",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)
        grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
        # create and add the entries
        bold = self.GetFont().MakeBold()
        for r, row in enumerate(self.headers + help_entries):
            for (col, width) in zip(row, self.widths):
                label = wx.StaticText(self, label=col)
                if r == 0:
                    label.SetFont(bold)
                label.Wrap(width)
                grid_sizer.Add(label, 0, 0, 0)
        # finalize layout, create button
        sizer.Add(grid_sizer, 0, wx.ALL, 6)
        OK = wx.Button(self, wx.ID_OK)
        sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.Layout()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        OK.Bind(wx.EVT_BUTTON, self.OnClose) 
Example #5
Source File: FindWindow.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, parent, hwnds):
        eg.Dialog.__init__(
            self,
            parent,
            title="Found Windows",
            size=(500, 350),
            style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
        )
        windowList = eg.WindowList(self, hwnds)
        okButton = wx.Button(self, wx.ID_OK)
        btnSizer = eg.HBoxSizer(
            ((0, 0), 1, wx.EXPAND),
            (okButton, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND | wx.ALL, 5),
            ((0, 0), 1, wx.EXPAND),
            (eg.SizeGrip(self), 0, wx.ALIGN_BOTTOM | wx.ALIGN_RIGHT),
        )
        mainSizer = eg.VBoxSizer(
            (windowList, 1, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 5),
            (btnSizer, 0, wx.EXPAND),
        )
        self.SetSizer(mainSizer) 
Example #6
Source File: controlcontainer.py    From admin4 with Apache License 2.0 6 votes vote down vote up
def addStatusBar(self, res=None):
    if self.statusbar:
      return
    flags=0;
    if self.HasFlag(wx.RESIZE_BORDER):
      flags = wx.ST_SIZEGRIP
    self.statusbar = wx.StatusBar(self, -1, flags)
    if res:
      res.AttachUnknownControl("StatusBar", self.statusbar)
    else:
      sbHeight=self.statusbar.GetSize().y
      dlgSize=self.GetSize()
      self.SetSize( (dlgSize.x, dlgSize.y+sbHeight) )
      clientSize=self.GetClientSize()
      self.statusbar.SetDimensions(0, clientSize.y-sbHeight, clientSize.x, sbHeight)
    self.statusbar.Show() 
Example #7
Source File: SimpleInputDialog.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def Configure(self, prompt=None, initialValue=""):
        if prompt is None:
            prompt = PROMPT
        eg.TaskletDialog.__init__(
            self, None, -1, PROMPT, style=wx.RESIZE_BORDER | wx.CAPTION
        )
        textCtrl = self.TextCtrl(initialValue, size=(300, -1))
        buttonRow = eg.ButtonRow(self, [wx.ID_OK])
        mainSizer = eg.VBoxSizer(
            (self.StaticText(prompt), 0, wx.EXPAND | wx.ALL, 5),
            (textCtrl, 0, wx.EXPAND | wx.ALL, 5),
            ((5, 5), 1, wx.EXPAND),
            (wx.StaticLine(self), 0, wx.EXPAND),
            (buttonRow.sizer, 0, wx.EXPAND),
        )
        self.SetSizerAndFit(mainSizer)
        self.SetMinSize(self.GetSize())
        while self.Affirmed():
            self.SetResult(textCtrl.GetValue()) 
Example #8
Source File: rule_editor.py    From Rule-based_Expert_System with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, parent, id, title, size):
        wx.Frame.__init__(self, parent, id, title,
                          style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx.MINIMIZE_BOX |
                                                          wx.MAXIMIZE_BOX))
        self.SetSize(size)
        self.Center()
        self.ps = wx.StaticText(self, label='IF part using \'AND\' to combine antecedent. Please ONE antecedent per line',
                                pos=(10, 5), size=(40 ,100))
        self.ifLabel = wx.StaticText(self, label='IF: ', pos=(10, 30), size=(40, 50))
        self.thenLabel = wx.StaticText(self, label='THEN: ', pos=(10, 250), size=(40, 50))
        self.descriptionLabel = wx.StaticText(self, label='Description: ', pos=(10, 280), size=(40, 50))
        self.ifText = wx.TextCtrl(self, pos=(100, 30), size=(490, 210), style=wx.TE_MULTILINE)
        self.thenText = wx.TextCtrl(self, pos=(100, 250), size=(490, 25))
        self.descriptionText = wx.TextCtrl(self, pos=(100, 280), size=(490, 25))
        self.createButton = wx.Button(self, label='Create', pos=(85, 320), size=(130, 30))
        self.createButton.Bind(wx.EVT_BUTTON, self.create_rule)
        self.cancelButton = wx.Button(self, label='Cancel', pos=(385, 320), size=(130, 30))
        self.cancelButton.Bind(wx.EVT_BUTTON, self.cancel_creation) 
Example #9
Source File: AboutDialog.py    From OpenPLC_Editor with GNU General Public License v3.0 6 votes vote down vote up
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: backend_wx.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def __init__(self, parent, help_entries):
        wx.Dialog.__init__(self, parent, title="Help",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)
        grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
        # create and add the entries
        bold = self.GetFont().MakeBold()
        for r, row in enumerate(self.headers + help_entries):
            for (col, width) in zip(row, self.widths):
                label = wx.StaticText(self, label=col)
                if r == 0:
                    label.SetFont(bold)
                label.Wrap(width)
                grid_sizer.Add(label, 0, 0, 0)
        # finalize layout, create button
        sizer.Add(grid_sizer, 0, wx.ALL, 6)
        OK = wx.Button(self, wx.ID_OK)
        sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.Layout()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        OK.Bind(wx.EVT_BUTTON, self.OnClose) 
Example #11
Source File: backend_wx.py    From GraphicDesignPatternByPython with MIT License 6 votes vote down vote up
def __init__(self, parent, help_entries):
        wx.Dialog.__init__(self, parent, title="Help",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)
        grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
        # create and add the entries
        bold = self.GetFont().MakeBold()
        for r, row in enumerate(self.headers + help_entries):
            for (col, width) in zip(row, self.widths):
                label = wx.StaticText(self, label=col)
                if r == 0:
                    label.SetFont(bold)
                label.Wrap(width)
                grid_sizer.Add(label, 0, 0, 0)
        # finalize layout, create button
        sizer.Add(grid_sizer, 0, wx.ALL, 6)
        OK = wx.Button(self, wx.ID_OK)
        sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.Layout()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        OK.Bind(wx.EVT_BUTTON, self.OnClose) 
Example #12
Source File: backend_wx.py    From CogAlg with MIT License 6 votes vote down vote up
def __init__(self, parent, help_entries):
        wx.Dialog.__init__(self, parent, title="Help",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        sizer = wx.BoxSizer(wx.VERTICAL)
        grid_sizer = wx.FlexGridSizer(0, 3, 8, 6)
        # create and add the entries
        bold = self.GetFont().MakeBold()
        for r, row in enumerate(self.headers + help_entries):
            for (col, width) in zip(row, self.widths):
                label = wx.StaticText(self, label=col)
                if r == 0:
                    label.SetFont(bold)
                label.Wrap(width)
                grid_sizer.Add(label, 0, 0, 0)
        # finalize layout, create button
        sizer.Add(grid_sizer, 0, wx.ALL, 6)
        OK = wx.Button(self, wx.ID_OK)
        sizer.Add(OK, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALL, 8)
        self.SetSizer(sizer)
        sizer.Fit(self)
        self.Layout()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        OK.Bind(wx.EVT_BUTTON, self.OnClose) 
Example #13
Source File: NamespaceTree.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Test(cls):
        dialog = eg.Dialog(
            None,
            style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        )
        tree = cls(dialog, eg)
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(tree, 1, wx.EXPAND)
        tree.FillTree()
        dialog.SetSizerAndFit(sizer)
        dialog.ShowModal()
        dialog.Destroy() 
Example #14
Source File: EventRemapDialog.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, mapping=None):
        eg.Dialog.__init__(
            self, parent, style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        )
        listCtrl = wx.ListCtrl(self, -1, style=wx.LC_REPORT)
        listCtrl.InsertColumn(0, "New event name")
        listCtrl.InsertColumn(1, "Events")
        listCtrl.InsertColumn(2, "Repeat events")
        listCtrl.InsertColumn(3, "Timeout")

        newEventCtrl = self.TextCtrl()
        eventsCtrl = self.TextCtrl()
        repeatEventsCtrl = self.TextCtrl()

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(listCtrl, 1, wx.EXPAND)

        editSizer = wx.GridSizer(1, 2)
        editSizer.Add(
            self.StaticText("New event name:"),
            wx.ALIGN_CENTER_VERTICAL
        )
        editSizer.Add(newEventCtrl, 0)
        editSizer.Add(
            self.StaticText("Events:"),
            wx.ALIGN_CENTER_VERTICAL
        )
        editSizer.Add(eventsCtrl, 0)
        editSizer.Add(
            self.StaticText("Repeat events:"),
            wx.ALIGN_CENTER_VERTICAL
        )
        editSizer.Add(repeatEventsCtrl, 0)

        sizer.Add(editSizer)
        self.SetSizerAndFit(sizer) 
Example #15
Source File: TreeItemBrowseDialog.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(
        self,
        title,
        text,
        searchItem,
        resultClasses,
        filterClasses=(eg.FolderItem, eg.MacroItem),
        parent=None,
    ):
        self.resultData = searchItem
        self.resultClasses = resultClasses
        self.foundId = None
        style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        eg.TaskletDialog.__init__(self, parent, -1, title=title, style=style)
        staticText = wx.StaticText(self, -1, text)
        staticText.Wrap(430)

        def filterFunc(obj):
            return isinstance(obj, filterClasses)

        tree = eg.TreeItemBrowseCtrl(self, filterFunc, selectItem=searchItem)
        tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelectionChanged)
        self.treeCtrl = tree

        self.buttonRow = eg.ButtonRow(self, (wx.ID_CANCEL, wx.ID_OK), True)
        mainSizer = eg.VBoxSizer(
            (staticText, 0, wx.EXPAND | wx.ALL, 5),
            (tree, 1, wx.EXPAND | wx.LEFT | wx.RIGHT, 5),
            (self.buttonRow.sizer, 0, wx.EXPAND),
        )

        self.SetSizerAndFit(mainSizer)
        self.SetSize((450, 400))

        if not searchItem:
            self.buttonRow.okButton.Enable(False)
        while self.Affirmed():
            self.SetResult(self.resultData) 
Example #16
Source File: ExportDialog.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self):
        self.foundId = None
        style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        eg.TaskletDialog.__init__(self, None, -1, title="Export", style=style)
        staticText = wx.StaticText(self, -1, text.mesg)

        filterClasses = (eg.FolderItem, )  #eg.MacroItem)

        def filterFunc(obj):
            return isinstance(obj, filterClasses)

        tree = eg.TreeItemBrowseCtrl(self, filterFunc)  #, multiSelect=True)
        #tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelectionChanged)
        tree.UnselectAll()

        buttonRow = eg.ButtonRow(self, (wx.ID_OK, wx.ID_CANCEL), True)

        mainSizer = eg.VBoxSizer(
            (staticText, 0, wx.EXPAND | wx.ALL, 5),
            (tree, 1, wx.EXPAND),
            (buttonRow.sizer, 0, wx.EXPAND),
        )
        self.SetSizerAndFit(mainSizer)
        self.SetAutoLayout(True)
        #mainSizer.Fit(self)
        #self.SetMinSize(self.GetSize())
        self.SetSize((450, 400))
        while self.Affirmed():
            items = tree.GetSelections()
            GetPyData = tree.GetPyData
            self.SetResult([GetPyData(item) for item in items]) 
Example #17
Source File: BrowseValuesLibraryDialog.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, name, library, default=None):
        wx.Dialog.__init__(self,
                           name='BrowseValueDialog', parent=parent,
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
                           title=_('Browse %s values library') % name)

        self.staticText1 = wx.StaticText(
            label=_('Choose a value for %s:') % name,
            name='staticText1', parent=self,
            pos=wx.Point(0, 0), size=wx.DefaultSize, style=0)

        self.ValuesLibrary = wx.TreeCtrl(
            name='ValuesLibrary', parent=self, pos=wx.Point(0, 0),
            size=wx.Size(400, 200),
            style=wx.TR_HAS_BUTTONS | wx.TR_SINGLE | wx.SUNKEN_BORDER | wx.TR_HIDE_ROOT | wx.TR_LINES_AT_ROOT)

        self.ButtonSizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)

        self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.ButtonSizer.GetAffirmativeButton().GetId())

        self.flexGridSizer1 = wx.FlexGridSizer(cols=1, hgap=0, rows=3, vgap=10)

        self.flexGridSizer1.AddWindow(self.staticText1,   0, border=20, flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)
        self.flexGridSizer1.AddWindow(self.ValuesLibrary, 0, border=20, flag=wx.GROW | wx.LEFT | wx.RIGHT)
        self.flexGridSizer1.AddSizer(self.ButtonSizer,    0, border=20, flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)

        self.flexGridSizer1.AddGrowableCol(0)
        self.flexGridSizer1.AddGrowableRow(1)

        self.SetSizer(self.flexGridSizer1)
        self.Fit()

        root = self.ValuesLibrary.AddRoot("")
        self.GenerateValuesLibraryBranch(root, library, default) 
Example #18
Source File: ConfigEditor.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, database):
        wx.Dialog.__init__(self, parent,
                           size=wx.Size(700, 500),
                           title=_('ESI Files Database management'),
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        main_sizer = wx.FlexGridSizer(cols=1, hgap=0, rows=2, vgap=10)
        main_sizer.AddGrowableCol(0)
        main_sizer.AddGrowableRow(0)

        self.DatabaseSizer = LibraryEditorSizer(
            self, database,
            [
                ("ImportButton", "ImportESI", _("Import file to ESI files database"), None),
                ("DeleteButton", "remove_element", _("Remove file from database"), None)
            ])
        self.DatabaseSizer.SetControlMinSize(wx.Size(0, 0))
        main_sizer.AddSizer(self.DatabaseSizer, border=10,
                            flag=wx.GROW | wx.TOP | wx.LEFT | wx.RIGHT)

        button_sizer = self.CreateButtonSizer(wx.OK | wx.CANCEL | wx.CENTRE)
        button_sizer.GetAffirmativeButton().SetLabel(_("Add file to project"))
        button_sizer.GetCancelButton().SetLabel(_("Close"))
        main_sizer.AddSizer(button_sizer, border=10,
                            flag=wx.ALIGN_RIGHT | wx.BOTTOM | wx.LEFT | wx.RIGHT)

        self.SetSizer(main_sizer)

        self.DatabaseSizer.RefreshView() 
Example #19
Source File: main_frame.py    From Rule-based_Expert_System with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, id, title, text):
        wx.Frame.__init__(self, parent, id, title, style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx.MINIMIZE_BOX |
                                                          wx.MAXIMIZE_BOX))
        self.SetSize((400, 780))
        self.SetPosition((200, 0))
        self.ruleText = wx.TextCtrl(self, pos=(0, 0), size=(400, 780), style=wx.TE_MULTILINE | wx.TE_READONLY)
        self.ruleText.WriteText(text) 
Example #20
Source File: IDManager.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, ctr):
        self.ctr = ctr
        wx.Dialog.__init__(self,
                           name='IDManager', parent=parent,
                           title=_('URI Editor'),
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER,
                           size=(800, 600))
        # start IDBrowser in manager mode
        self.browser = IDBrowser(self, ctr)
        self.Bind(wx.EVT_CHAR_HOOK, self.OnEscapeKey) 
Example #21
Source File: AboutDialog.py    From OpenPLC_Editor with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent, info):
        wx.Dialog.__init__(self, parent, title=_("Credits"), size=(475, 320),
                           style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        if parent and parent.GetIcon():
            self.SetIcon(parent.GetIcon())

        self.SetMinSize((300, 200))
        notebook = wx.Notebook(self)
        close = wx.Button(self, id=wx.ID_CLOSE, label=_("&Close"))
        close.SetDefault()

        developer = wx.TextCtrl(notebook, style=wx.TE_READONLY | wx.TE_MULTILINE)
        translators = wx.TextCtrl(notebook, style=wx.TE_READONLY | wx.TE_MULTILINE)

        developer.SetValue(u'\n'.join(info.Developers))
        translators.SetValue(u'\n'.join(info.Translators))

        notebook.AddPage(developer, text=_("Written by"))
        notebook.AddPage(translators, text=_("Translated by"))

        btnSizer = wx.BoxSizer(wx.HORIZONTAL)
        btnSizer.Add(close)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(notebook, 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 #22
Source File: frame_overview.py    From bookhub with MIT License 5 votes vote down vote up
def __init__(self, repo):
        FrameStyle = wx.CAPTION | wx.RESIZE_BORDER | wx.SYSTEM_MENU |\
            wx.MINIMIZE_BOX | wx.MAXIMIZE_BOX | wx.CLOSE_BOX
        wx.Frame.__init__(self, parent=None, id=-1, title="BookHub",
                          pos=(100, 100), size=(500, 600), style=FrameStyle)

        self.BuildUI()
        self.InitObjectListView(repo)
        self.InitSearchCtrls() 
Example #23
Source File: rstbx_frame.py    From dials with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def OnShowZoom(self, event):
        if self.zoom_frame is None:
            self.zoom_frame = ZoomFrame(
                self,
                -1,
                "Zoom",
                style=wx.CAPTION | wx.CLOSE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU,
            )
            self.zoom_frame.set_image(self._img)
            self.zoom_frame.Show()
        self.zoom_frame.Raise() 
Example #24
Source File: rstbx_frame.py    From dials with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def OnShow3D(self, event):
        if self.zoom_3d is None:
            from rstbx.viewer import pixels3d

            self.zoom_3d = pixels3d.pixel_viewer_3d_frame(
                self,
                -1,
                "3D view",
                style=wx.CAPTION | wx.CLOSE_BOX | wx.RESIZE_BORDER | wx.SYSTEM_MENU,
            )
            self.zoom_3d.set_image(self._img)
            self.zoom_3d.Show()
        self.zoom_3d.Raise() 
Example #25
Source File: spotfinder_frame.py    From dials with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def OnMask(self, event):
        if not self._mask_frame:
            self._mask_frame = MaskSettingsFrame(
                self,
                wx.ID_ANY,
                "Mask tool",
                style=wx.CAPTION | wx.CLOSE_BOX | wx.RESIZE_BORDER,
            )
            self._mask_frame.Show()
            self._mask_frame.Raise()
        else:
            self._mask_frame.Destroy() 
Example #26
Source File: main_frame.py    From Rule-based_Expert_System with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, id, title, text):
        wx.Frame.__init__(self, parent, id, title, style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx.MINIMIZE_BOX |
                                                          wx.MAXIMIZE_BOX))
        self.SetSize((400, 780))
        self.SetPosition((600, 0))
        self.factText = wx.TextCtrl(self, pos=(0, 0), size=(400, 780), style=wx.TE_MULTILINE | wx.TE_READONLY)
        self.factText.WriteText(text) 
Example #27
Source File: main_frame.py    From Rule-based_Expert_System with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, id, title, size):
        wx.Frame.__init__(self, parent, id, title,
                          style=wx.DEFAULT_FRAME_STYLE ^ (wx.RESIZE_BORDER | wx.MINIMIZE_BOX |
                                                          wx.MAXIMIZE_BOX))
        self.SetSize(size)
        self.Center()
        self.sourceLabel = wx.StaticText(self, label='Source Image', pos=(150, 10), size=(40, 25))
        self.detectionLabel = wx.StaticText(self, label='Detection Image', pos=(550, 10), size=(40, 25))
        self.openPicButton = wx.Button(self, label='Open Image', pos=(830, 30), size=(150, 30))
        self.openPicButton.Bind(wx.EVT_BUTTON, self.open_picture)
        self.openEditorButton = wx.Button(self, label='Open Rule Editor', pos=(830, 70), size=(150, 30))
        self.openEditorButton.Bind(wx.EVT_BUTTON, self.open_rule_editor)
        self.showRuleButton = wx.Button(self, label='Show Rules', pos=(830, 110), size=(150, 30))
        self.showRuleButton.Bind(wx.EVT_BUTTON, self.show_rules)
        self.showFactButton = wx.Button(self, label='Show Facts', pos=(830, 150), size=(150, 30))
        self.showFactButton.Bind(wx.EVT_BUTTON, self.show_facts)
        self.treeLabel = wx.StaticText(self, label='What shape do you want', pos=(830, 200), size=(40, 25))
        self.shapeTree = wx.TreeCtrl(self, pos=(830, 220), size=(160, 210))
        root = self.shapeTree.AddRoot('All Shapes')
        self.add_tree_nodes(root, shape_items.tree)
        self.shapeTree.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.shape_chosen)
        self.shapeTree.Expand(root)
        self.show_picture('init_source.png', (10, 30))
        self.show_picture('init_detection.png', (420, 30))
        self.resultLabel = wx.StaticText(self, label='Detection Result', pos=(100, 450), size=(40, 25))
        self.resultText = wx.TextCtrl(self, pos=(10, 480), size=(310, 280), style=wx.TE_MULTILINE | wx.TE_READONLY)
        self.matchedFactLabel = wx.StaticText(self, label='Matched Facts', pos=(430, 450), size=(40, 25))
        self.matchedFactText = wx.TextCtrl(self, pos=(340, 480), size=(310, 280), style=wx.TE_MULTILINE | wx.TE_READONLY)
        self.hitRuleLabel = wx.StaticText(self, label='Hit Rules', pos=(780, 450), size=(40, 25))
        self.hitRuleText = wx.TextCtrl(self, pos=(670, 480), size=(310, 280), style=wx.TE_MULTILINE | wx.TE_READONLY)
        self.title = title
        self.pic_path = None
        self.engine = None
        self.contour_num = None
        self.Show() 
Example #28
Source File: PyOgg3.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: PyOgg3_MyDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        wx.Dialog.__init__(self, *args, **kwds)
        self.notebook_1 = wx.Notebook(self, wx.ID_ANY)
        self.notebook_1_pane_1 = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.text_ctrl_1 = wx.TextCtrl(self.notebook_1_pane_1, wx.ID_ANY, "")
        self.button_3 = wx.Button(self.notebook_1_pane_1, wx.ID_OPEN, "")
        self.notebook_1_pane_2 = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.radio_box_1 = wx.RadioBox(self.notebook_1_pane_2, wx.ID_ANY, _("Sampling Rate"), choices=[_("44 kbit"), _("128 kbit")], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
        self.notebook_1_pane_3 = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.text_ctrl_2 = wx.TextCtrl(self.notebook_1_pane_3, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.notebook_1_pane_4 = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.label_2 = wx.StaticText(self.notebook_1_pane_4, wx.ID_ANY, _("File name:"))
        self.text_ctrl_3 = wx.TextCtrl(self.notebook_1_pane_4, wx.ID_ANY, "")
        self.button_4 = wx.Button(self.notebook_1_pane_4, wx.ID_OPEN, "")
        self.checkbox_1 = wx.CheckBox(self.notebook_1_pane_4, wx.ID_ANY, _("Overwrite existing file"))
        self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
        self.button_5 = wx.Button(self, wx.ID_CLOSE, "")
        self.button_2 = wx.Button(self, wx.ID_CANCEL, "", style=wx.BU_TOP)
        self.button_1 = wx.Button(self, wx.ID_OK, "", style=wx.BU_TOP)

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.startConverting, self.button_1)
        # end wxGlade

        # manually added code
        print( 'Dialog has been created at ', time.asctime() ) 
Example #29
Source File: spellcheckcfgdlg.py    From trelby with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, scDict, isGlobal):
        wx.Dialog.__init__(self, parent, -1, "Spell checker dictionary",
                           style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)

        self.scDict = scDict

        vsizer = wx.BoxSizer(wx.VERTICAL)

        if isGlobal:
            s = "Global words:"
        else:
            s = "Script-specific words:"

        vsizer.Add(wx.StaticText(self, -1, s))

        self.itemsEntry = wx.TextCtrl(self, -1, style = wx.TE_MULTILINE |
                                     wx.TE_DONTWRAP, size = (300, 300))
        vsizer.Add(self.itemsEntry, 1, wx.EXPAND)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        hsizer.Add((1, 1), 1)

        cancelBtn = gutil.createStockButton(self, "Cancel")
        hsizer.Add(cancelBtn, 0, wx.LEFT, 10)

        okBtn = gutil.createStockButton(self, "OK")
        hsizer.Add(okBtn, 0, wx.LEFT, 10)

        vsizer.Add(hsizer, 0, wx.EXPAND | wx.TOP, 10)

        self.cfg2gui()

        util.finishWindow(self, vsizer)

        wx.EVT_TEXT(self, self.itemsEntry.GetId(), self.OnMisc)
        wx.EVT_BUTTON(self, cancelBtn.GetId(), self.OnCancel)
        wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK) 
Example #30
Source File: templates_ui.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: TemplateInfoDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE | wx.MAXIMIZE_BOX | wx.RESIZE_BORDER
        wx.Dialog.__init__(self, *args, **kwds)
        self.template_name = wx.TextCtrl(self, wx.ID_ANY, "")
        self.author = wx.TextCtrl(self, wx.ID_ANY, "")
        self.description = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.instructions = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.button_1 = wx.Button(self, wx.ID_OK, "")
        self.button_2 = wx.Button(self, wx.ID_CANCEL, "")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade