Python wx.StaticLine() Examples

The following are 30 code examples of wx.StaticLine(). 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 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 #2
Source File: bugdialog_ui.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: UIBugDialog.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER
        wx.Dialog.__init__(self, *args, **kwds)
        self.SetSize((600, 400))
        self.notebook_1 = wx.Notebook(self, wx.ID_ANY, style=wx.NB_BOTTOM)
        self.nb1_pane_summary = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.st_header = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("An internal error occurred while %(action)s"))
        self.st_summary = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("Error type: %(exc_type)s\nError summary: %(exc_msg)s"))
        self.st_report = wx.StaticText(self.nb1_pane_summary, wx.ID_ANY, _("This is a bug - please report it."))
        self.nb1_pane_details = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.st_details = wx.StaticText(self.nb1_pane_details, wx.ID_ANY, _("Error details:"))
        self.tc_details = wx.TextCtrl(self.nb1_pane_details, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.notebook_1_pane_1 = wx.Panel(self.notebook_1, wx.ID_ANY)
        self.tc_howto_report = wx.TextCtrl(self.notebook_1_pane_1, wx.ID_ANY, _("Writing a helpful bug report is easy if you follow some hints. The items below should help you to integrate useful information. They are not an absolute rule - it's more like a guideline.\n\n- What did you do? Maybe you want to include a screenshot.\n- What did you want to happen?\n- What did actually happen?\n- Provide a short example to reproduce the issue.\n- Include the internal error log file %(log_file)s if required.\n\nPlease open a new bug in the wxGlade bug tracker https://github.com/wxGlade/wxGlade/issues/ .\nAlternatively you can send the bug report to the wxGlade mailing list wxglade-general@lists.sourceforge.net. Keep in mind that you need a subscription for sending emails to this mailing list.\nThe subscription page is at https://sourceforge.net/projects/wxglade/lists/wxglade-general ."), style=wx.TE_MULTILINE | wx.TE_READONLY)
        self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
        self.btn_copy = wx.Button(self, wx.ID_COPY, "")
        self.btn_ok = wx.Button(self, wx.ID_OK, "")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.OnCopy, self.btn_copy)
        # end wxGlade 
Example #3
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 #4
Source File: font_dialog.py    From wxGlade with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwds):
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.label_2_copy = wx.StaticText(self, -1, _("Family:"))
        self.label_3_copy = wx.StaticText(self, -1, _("Style:"))
        self.label_4_copy = wx.StaticText(self, -1, _("Weight:"))
        self.family = wx.Choice(self, -1, choices=["Default", "Decorative", "Roman", "Script", "Swiss", "Modern"])
        self.style = wx.Choice(self, -1, choices=["Normal", "Slant", "Italic"])
        self.weight = wx.Choice(self, -1, choices=["Normal", "Light", "Bold"])
        self.label_1 = wx.StaticText(self, -1, _("Size in points:"))
        self.point_size = wx.SpinCtrl(self, -1, "", min=0, max=100)
        self.underline = wx.CheckBox(self, -1, _("Underlined"))
        self.font_btn = wx.Button(self, -1, _("Specific font..."))
        self.static_line_1 = wx.StaticLine(self, -1)
        self.ok_btn = wx.Button(self, wx.ID_OK, _("OK"))
        self.cancel_btn = wx.Button(self, wx.ID_CANCEL, _("Cancel"))

        self.__set_properties()
        self.__do_layout()
        self.value = None
        self.font_btn.Bind(wx.EVT_BUTTON, self.choose_specific_font)
        self.ok_btn.Bind(wx.EVT_BUTTON, self.on_ok) 
Example #5
Source File: bug192.py    From wxGlade with MIT License 6 votes vote down vote up
def __do_layout(self):
        # begin wxGlade: Frame192.__do_layout
        self.sizer_as_attr = wx.FlexGridSizer(3, 1, 0, 0)
        sizer_local = wx.BoxSizer(wx.HORIZONTAL)
        label_1 = wx.StaticText(self, wx.ID_ANY, _("Just a text"), style=wx.ALIGN_CENTER)
        self.sizer_as_attr.Add(label_1, 1, wx.ALIGN_CENTER | wx.ALL | wx.EXPAND | wx.SHAPED, 5)
        static_line_1 = wx.StaticLine(self, wx.ID_ANY)
        self.sizer_as_attr.Add(static_line_1, 0, wx.ALL | wx.EXPAND, 5)
        sizer_local.Add(self.button_2, 0, 0, 0)
        sizer_local.Add(self.button_1, 0, 0, 0)
        self.sizer_as_attr.Add(sizer_local, 1, wx.ALIGN_RIGHT | wx.ALL, 5)
        self.SetSizer(self.sizer_as_attr)
        self.sizer_as_attr.SetSizeHints(self)
        self.sizer_as_attr.AddGrowableRow(0)
        self.sizer_as_attr.AddGrowableCol(0)
        self.Layout()
        # end wxGlade

# end of class Frame192 
Example #6
Source File: welcome.py    From DeepLabCut with GNU Lesser General Public License v3.0 6 votes vote down vote up
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 #7
Source File: ConfigDialog.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def FinishSetup(self):
        # Temporary hack to fix button tabulator ordering problems.
        self.panel.FinishSetup()
        if self.description:
            self.CreateHelpPanel()
        #line = wx.StaticLine(self)
        #self.mainSizer.Add(line, 0, wx.EXPAND|wx.ALIGN_CENTER)
        buttonRow = self.buttonRow
        buttonRow.applyButton.MoveAfterInTabOrder(self.notebook)
        buttonRow.cancelButton.MoveAfterInTabOrder(self.notebook)
        buttonRow.okButton.MoveAfterInTabOrder(self.notebook)
        if buttonRow.testButton:
            buttonRow.testButton.MoveAfterInTabOrder(self.notebook)
#        if not self.showLine:
#            line.Hide()
        if self.resizable:
            self.mainSizer.Add(self.buttonRow.sizer, 0, wx.EXPAND, 0)
        else:
            self.mainSizer.Add(self.buttonRow.sizer, 0, wx.EXPAND | wx.RIGHT, 10)
        self.SetSizerAndFit(self.mainSizer)
        self.Fit()  # without the addition Fit(), some dialogs get a bad size
        self.SetMinSize(self.GetSize())
        self.CentreOnParent()
        self.panel.SetFocus()
        eg.TaskletDialog.FinishSetup(self) 
Example #8
Source File: ComplexExample.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrameGrid.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((492, 300))
        self.SetTitle(_("FrameOggCompressionDetails"))

        self._szr_frame = wx.BoxSizer(wx.VERTICAL)

        self.grid_sizer = wx.FlexGridSizer(3, 1, 0, 0)
        self._szr_frame.Add(self.grid_sizer, 1, wx.EXPAND, 0)

        self.grid = wx.grid.Grid(self, wx.ID_ANY, size=(1, 1))
        self.grid.CreateGrid(8, 3)
        self.grid_sizer.Add(self.grid, 1, wx.EXPAND, 0)

        self.static_line = wx.StaticLine(self, wx.ID_ANY)
        self.grid_sizer.Add(self.static_line, 0, wx.ALL | wx.EXPAND, 5)

        self.button = wx.Button(self, wx.ID_CLOSE, "")
        self.button.SetFocus()
        self.button.SetDefault()
        self.grid_sizer.Add(self.button, 0, wx.ALIGN_RIGHT | wx.ALL, 5)

        self.grid_sizer.AddGrowableRow(0)
        self.grid_sizer.AddGrowableCol(0)

        self.SetSizer(self._szr_frame)
        self._szr_frame.SetSizeHints(self)

        self.Layout()
        # end wxGlade

# end of class MyFrameGrid 
Example #9
Source File: item_sizer.py    From iqiyi-parser with MIT License 5 votes vote down vote up
def initWidget(self, **kwargs):

        name = kwargs.get('name', '')
        current = kwargs.get('current', 0)
        percent = current*100.0 / self.total if self.total > 0 else 0
        speed = format_byte(kwargs.get('speed', 0), '%.1f%s/S')

        self.text_name = wx.StaticText(self.parent, wx.ID_ANY, name, wx.DefaultPosition, wx.Size(20, -1),
                                       wx.ALIGN_RIGHT)
        self.text_percent = wx.StaticText(self.parent, wx.ID_ANY, str(round(percent, 1)) + '%', wx.DefaultPosition,
                                          wx.Size(40, -1), wx.ALIGN_RIGHT)
        self.text_speed = wx.StaticText(self.parent, wx.ID_ANY, speed, wx.DefaultPosition, wx.Size(65, -1),
                                        wx.ALIGN_RIGHT)

        self.text_name.Wrap(-1)
        self.text_percent.Wrap(-1)
        self.text_speed.Wrap(-1)

        self.gauge_progress = wx.Gauge(self.parent, wx.ID_ANY, 10000, wx.DefaultPosition, wx.DefaultSize,
                                       wx.GA_HORIZONTAL)
        self.gauge_progress.SetValue(int(percent*100))

        self.Add(self.text_name, 0, wx.ALIGN_RIGHT | wx.ALL, 5)
        self.Add(self.gauge_progress, 5, wx.ALL, 5)
        self.Add(self.text_percent, 0, wx.ALL, 5)
        self.Add(self.text_speed, 0, wx.ALL, 5)
        # self.Add(self.text_progress, 0, wx.ALL, 5)
        staticline1 = wx.StaticLine(self.parent, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)

        self.Add(staticline1, 0, wx.EXPAND | wx.ALL, 2) 
Example #10
Source File: ComplexExample_30_Classic.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrameGrid.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((492, 300))
        self.SetTitle(_("FrameOggCompressionDetails"))

        self._szr_frame = wx.BoxSizer(wx.VERTICAL)

        self.grid_sizer = wx.FlexGridSizer(3, 1, 0, 0)
        self._szr_frame.Add(self.grid_sizer, 1, wx.EXPAND, 0)

        self.grid = wx.grid.Grid(self, wx.ID_ANY, size=(1, 1))
        self.grid.CreateGrid(8, 3)
        self.grid_sizer.Add(self.grid, 1, wx.EXPAND, 0)

        self.static_line = wx.StaticLine(self, wx.ID_ANY)
        self.grid_sizer.Add(self.static_line, 0, wx.ALL | wx.EXPAND, 5)

        self.button = wx.Button(self, wx.ID_CLOSE, "")
        self.button.SetFocus()
        self.button.SetDefault()
        self.grid_sizer.Add(self.button, 0, wx.ALIGN_RIGHT | wx.ALL, 5)

        self.grid_sizer.AddGrowableRow(0)
        self.grid_sizer.AddGrowableCol(0)

        self.SetSizer(self._szr_frame)
        self._szr_frame.SetSizeHints(self)

        self.Layout()
        # end wxGlade

# end of class MyFrameGrid 
Example #11
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 #12
Source File: PyOgg3.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: PyOgg3_MyFrame.__init__
        kwds["style"] = wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.grid_1 = wx.grid.Grid(self, wx.ID_ANY, size=(1, 1))
        self.static_line_2 = wx.StaticLine(self, wx.ID_ANY)
        self.button_6 = wx.Button(self, wx.ID_CLOSE, "")

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

        # manually added code
        print( 'Frame has been created at ', datetime.datetime.now().isoformat() ) 
Example #13
Source File: ComplexExample_Phoenix.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyFrameGrid.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
        wx.Frame.__init__(self, *args, **kwds)
        self.SetSize((492, 300))
        self.SetTitle(_("FrameOggCompressionDetails"))

        self._szr_frame = wx.BoxSizer(wx.VERTICAL)

        self.grid_sizer = wx.FlexGridSizer(3, 1, 0, 0)
        self._szr_frame.Add(self.grid_sizer, 1, wx.EXPAND, 0)

        self.grid = wx.grid.Grid(self, wx.ID_ANY, size=(1, 1))
        self.grid.CreateGrid(8, 3)
        self.grid_sizer.Add(self.grid, 1, wx.EXPAND, 0)

        self.static_line = wx.StaticLine(self, wx.ID_ANY)
        self.grid_sizer.Add(self.static_line, 0, wx.ALL | wx.EXPAND, 5)

        self.button = wx.Button(self, wx.ID_CLOSE, "")
        self.button.SetFocus()
        self.button.SetDefault()
        self.grid_sizer.Add(self.button, 0, wx.ALIGN_RIGHT | wx.ALL, 5)

        self.grid_sizer.AddGrowableRow(0)
        self.grid_sizer.AddGrowableCol(0)

        self.SetSizer(self._szr_frame)
        self._szr_frame.SetSizeHints(self)

        self.Layout()
        # end wxGlade

# end of class MyFrameGrid 
Example #14
Source File: remove_class_inplace_expected.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
        self.button_2 = wx.Button(self, wx.ID_OK, "")
        self.button_1 = wx.Button(self, wx.ID_CANCEL, "")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade 
Example #15
Source File: add_class_inplace_orig.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
        self.button_2 = wx.Button(self, wx.ID_OK, "")
        self.button_1 = wx.Button(self, wx.ID_CANCEL, "")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade 
Example #16
Source File: add_class_inplace_extended.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
        self.button_2 = wx.Button(self, wx.ID_OK, "")
        self.button_1 = wx.Button(self, wx.ID_CANCEL, "")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade 
Example #17
Source File: remove_class_inplace_input.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, *args, **kwds):
        # begin wxGlade: MyDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.text_ctrl_1 = wx.TextCtrl(self, wx.ID_ANY, "", style=wx.TE_MULTILINE)
        self.static_line_1 = wx.StaticLine(self, wx.ID_ANY)
        self.button_2 = wx.Button(self, wx.ID_OK, "")
        self.button_1 = wx.Button(self, wx.ID_CANCEL, "")

        self.__set_properties()
        self.__do_layout()
        # end wxGlade 
Example #18
Source File: about.py    From wxGlade with MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        wx.Dialog.__init__(self, parent, -1, _('About wxGlade'))
        html = wx.html.HtmlWindow(self, -1, size=(480, 250))
        html.Bind(wx.html.EVT_HTML_LINK_CLICKED, self.OnLinkClicked)
        # it's recommended at least for GTK2 based wxPython
        if "gtk2" in wx.PlatformInfo:
            html.SetStandardFonts()
        bgcolor = misc.color_to_string(self.GetBackgroundColour())
        icon_path = os.path.join(config.icons_path, 'wxglade_small.png')
        html.SetPage( self.text % (bgcolor, icon_path, config.version, config.py_version, config.wx_version) )
        ir = html.GetInternalRepresentation()
        ir.SetIndent(0, wx.html.HTML_INDENT_ALL)
        html.SetSize((ir.GetWidth(), ir.GetHeight()))
        szr = wx.BoxSizer(wx.VERTICAL)
        szr.Add(html, 0, wx.TOP|wx.ALIGN_CENTER, 10)
        szr.Add(wx.StaticLine(self, -1), 0, wx.LEFT|wx.RIGHT|wx.EXPAND, 20)
        szr2 = wx.BoxSizer(wx.HORIZONTAL)
        btn = wx.Button(self, wx.ID_OK, _("OK"))
        btn.SetDefault()
        szr2.Add(btn)
        if wx.Platform == '__WXGTK__':
            extra_border = 5  # border around a default button
        else:
            extra_border = 0
        szr.Add(szr2, 0, wx.ALL|wx.ALIGN_RIGHT, 20 + extra_border)
        self.SetAutoLayout(True)
        self.SetSizer(szr)
        szr.Fit(self)
        self.Layout()
        if parent: self.CenterOnParent()
        else: self.CenterOnScreen() 
Example #19
Source File: static_line.py    From wxGlade with MIT License 5 votes vote down vote up
def create_widget(self):
        self.widget = wx.StaticLine(self.parent_window.widget, self.id, style=self.style)
        self.widget.Bind(wx.EVT_LEFT_DOWN, self.on_set_focus) 
Example #20
Source File: color_dialog.py    From wxGlade with MIT License 5 votes vote down vote up
def __do_layout(self):
        sizer_1 = wx.BoxSizer(wx.VERTICAL)
        sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_2.Add(self.use_null_color, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 5)
        sizer_2.Add(wx.StaticLine(self.panel_1, -1), 0, wx.ALL|wx.EXPAND, 5)
        sizer_2.Add(self.use_sys_color, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 5)
        sizer_2.Add(self.sys_color, 0, wx.ALL|wx.EXPAND, 5)
        sizer_2.Add(self.sys_color_panel, 0, wx.ALL|wx.EXPAND, 5)
        sizer_2.Add(wx.StaticLine(self.panel_1, -1), 0, wx.ALL|wx.EXPAND, 5)
        sizer_2.Add(self.use_chooser, 0, wx.LEFT|wx.RIGHT|wx.TOP|wx.EXPAND, 5)
        self.panel_1.SetAutoLayout(1)
        self.panel_1.SetSizer(sizer_2)
        sizer_2.Fit(self.panel_1)
        sizer_2.SetSizeHints(self.panel_1)
        sizer_1.Add(self.panel_1, 0, wx.EXPAND, 0)
        sizer_1.Add(self.color_chooser, 0, wx.ALL, 5)
        sizer_2.Add(wx.StaticLine(self.panel_1, -1), 0, wx.ALL|wx.EXPAND, 5)
        sizer_3.Add(self.ok, 0, wx.RIGHT, 13)
        sizer_3.Add(self.cancel, 0, 0, 5)
        sizer_1.Add(sizer_3, 0, wx.ALL|wx.ALIGN_RIGHT, 10)
        self.SetAutoLayout(1)
        self.SetSizer(sizer_1)
        sizer_1.Fit(self)
        sizer_1.SetSizeHints(self)
        self.Layout() 
Example #21
Source File: Password.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
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 #22
Source File: wx_util.py    From Gooey with MIT License 5 votes vote down vote up
def _rule(parent, direction):
    line = wx.StaticLine(parent, -1, style=direction)
    line.SetSize((10, 10))
    return line 
Example #23
Source File: wx_util.py    From pyFileFixity with MIT License 5 votes vote down vote up
def _rule(parent, direction):
  line = wx.StaticLine(parent, -1, style=direction)
  line.SetSize((10, 10))
  return line 
Example #24
Source File: styling.py    From pyFileFixity with MIT License 5 votes vote down vote up
def HorizontalRule(parent):
  line = wx.StaticLine(parent, -1, style=wx.LI_HORIZONTAL)
  line.SetSize((10, 10))
  return line 
Example #25
Source File: display_main.py    From pyFileFixity with MIT License 5 votes vote down vote up
def _draw_horizontal_line(self, sizer):
    line = wx.StaticLine(self, -1, style=wx.LI_HORIZONTAL)
    line.SetSize((10, 10))
    sizer.Add(line, 0, wx.EXPAND) 
Example #26
Source File: configuration_dialogs.py    From superpaper with MIT License 5 votes vote down vote up
def create_bottom_butts(self):
        """Create sizer for bottom row buttons."""
        self.sizer_buttons = wx.BoxSizer(wx.HORIZONTAL)

        self.button_align_test = wx.Button(self, label="Align test")
        self.button_test_pick = wx.Button(self, label="Pick image")
        self.button_test_imag = wx.Button(self, label="Test image")
        self.button_ok = wx.Button(self, label="OK")
        self.button_cancel = wx.Button(self, label="Close")

        self.button_align_test.Bind(wx.EVT_BUTTON, self.onAlignTest)
        self.button_test_pick.Bind(wx.EVT_BUTTON, self.onChooseTestImage)
        self.button_test_imag.Bind(wx.EVT_BUTTON, self.onTestWallpaper)
        self.button_ok.Bind(wx.EVT_BUTTON, self.onOk)
        self.button_cancel.Bind(wx.EVT_BUTTON, self.onCancel)

        self.sizer_buttons.Add(self.button_align_test, 0, wx.CENTER|wx.ALL, 5)
        sline = wx.StaticLine(self, -1, style=wx.LI_VERTICAL)
        self.sizer_buttons.Add(sline, 0, wx.EXPAND|wx.ALL, 5)
        self.tc_testimage = wx.TextCtrl(self, -1, size=(self.tc_width, -1))
        self.sizer_buttons.Add(self.tc_testimage, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_buttons.Add(self.button_test_pick, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_buttons.Add(self.button_test_imag, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_buttons.AddStretchSpacer()
        self.sizer_buttons.Add(self.button_ok, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_buttons.Add(self.button_cancel, 0, wx.CENTER|wx.ALL, 5) 
Example #27
Source File: cfgdlg.py    From trelby with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, id, cfg):
        wx.Panel.__init__(self, parent, id)
        self.cfg = cfg

        vsizer = wx.BoxSizer(wx.VERTICAL)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        hsizer.Add(wx.StaticText(self, -1, "Element:"), 0,
                   wx.ALIGN_CENTER_VERTICAL | wx.RIGHT, 10)

        self.elementsCombo = wx.ComboBox(self, -1, style = wx.CB_READONLY)

        for t in config.getTIs():
            self.elementsCombo.Append(t.name, t.lt)

        hsizer.Add(self.elementsCombo, 0)

        vsizer.Add(hsizer, 0, wx.EXPAND)

        vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 10)

        gsizer = wx.FlexGridSizer(0, 2, 5, 0)

        self.addTypeCombo("newEnter", "Enter creates", self, gsizer)
        self.addTypeCombo("newTab", "Tab creates", self, gsizer)
        self.addTypeCombo("nextTab", "Tab switches to", self, gsizer)
        self.addTypeCombo("prevTab", "Shift+Tab switches to", self, gsizer)

        vsizer.Add(gsizer)

        util.finishWindow(self, vsizer, center = False)

        wx.EVT_COMBOBOX(self, self.elementsCombo.GetId(), self.OnElementCombo)

        self.elementsCombo.SetSelection(0)
        self.OnElementCombo() 
Example #28
Source File: misc.py    From trelby with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, text, title, validateFunc = None):
        wx.Dialog.__init__(self, parent, -1, title,
                           style = wx.DEFAULT_DIALOG_STYLE | wx.WANTS_CHARS)

        # function to call to validate the input string on OK. can be
        # None, in which case it is not called. if it returns "", the
        # input is valid, otherwise the string it returns is displayed in
        # a message box and the dialog is not closed.
        self.validateFunc = validateFunc

        vsizer = wx.BoxSizer(wx.VERTICAL)

        vsizer.Add(wx.StaticText(self, -1, text), 1, wx.EXPAND | wx.BOTTOM, 5)

        self.tc = wx.TextCtrl(self, -1, style = wx.TE_PROCESS_ENTER)
        vsizer.Add(self.tc, 1, wx.EXPAND);

        vsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND | wx.TOP | wx.BOTTOM, 5)

        hsizer = wx.BoxSizer(wx.HORIZONTAL)

        cancelBtn = gutil.createStockButton(self, "Cancel")
        hsizer.Add(cancelBtn)

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

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

        util.finishWindow(self, vsizer)

        wx.EVT_BUTTON(self, cancelBtn.GetId(), self.OnCancel)
        wx.EVT_BUTTON(self, okBtn.GetId(), self.OnOK)

        wx.EVT_TEXT_ENTER(self, self.tc.GetId(), self.OnOK)

        wx.EVT_CHAR(self.tc, self.OnCharEntry)
        wx.EVT_CHAR(cancelBtn, self.OnCharButton)
        wx.EVT_CHAR(okBtn, self.OnCharButton)

        self.tc.SetFocus() 
Example #29
Source File: wx_util.py    From me-ica with GNU Lesser General Public License v2.1 5 votes vote down vote up
def _rule(parent, direction):
  line = wx.StaticLine(parent, -1, style=direction)
  line.SetSize((10, 10))
  return line 
Example #30
Source File: frame_downloader.py    From iqiyi-parser with MIT License 4 votes vote down vote up
def __init__(self, parent):
        wx.Frame.__init__(self, parent, id=wx.ID_ANY, title='视频下载器', pos=wx.DefaultPosition,
                          size=wx.Size(-1, 420), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL)

        self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)
        self.SetBackgroundColour(wx.Colour(240, 240, 240))
        self.SetMinSize(wx.Size(390, 420))
        self.SetMaxSize(wx.Size(390, 420))
        self.global_sizer = wx.BoxSizer(wx.VERTICAL)

        self.sizer_items = wx.BoxSizer(wx.VERTICAL)
        self.sizer_blocks = wx.WrapSizer(wx.HORIZONTAL)
        self.sizer_total = wx.BoxSizer(wx.HORIZONTAL)

        self.text_name = None
        self.gauge_total = None
        self.text_speed = None
        self.text_percent = None
        self.total = None
        self.text_progress = wx.StaticText(self, wx.ID_ANY, '', wx.DefaultPosition,
                                          wx.DefaultSize, wx.ALIGN_RIGHT)

        self.text_title = wx.StaticText(self, wx.ID_ANY, '', wx.DefaultPosition,
                                          wx.Size(150, -1), wx.ALIGN_LEFT)

        staticline1 = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        staticline2 = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)
        staticline3 = wx.StaticLine(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL)

        self.sizer_top = wx.BoxSizer(wx.HORIZONTAL)

        # self.global_sizer.Add(self.text_title, 0, wx.EXPAND | wx.ALL, 5)
        self.sizer_top.Add(self.text_title, 2, wx.EXPAND | wx.ALL, 5)
        self.sizer_top.Add(self.text_progress, 1, wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT, 5)

        self.global_sizer.Add(self.sizer_top, 0, wx.EXPAND | wx.ALL, 5)

        self.global_sizer.Add(staticline1, 0, wx.EXPAND | wx.ALL, 5)
        self.global_sizer.Add(self.sizer_items, 1, wx.ALL | wx.EXPAND, 3)
        self.global_sizer.Add(staticline2, 0, wx.EXPAND | wx.ALL, 5)
        self.global_sizer.Add(self.sizer_blocks, 0, wx.ALL | wx.EXPAND, 5)
        self.global_sizer.Add(staticline3, 0, wx.EXPAND | wx.ALL, 5)
        self.global_sizer.Add(self.sizer_total, 0, wx.ALL | wx.EXPAND, 5)

        self.menu_bar = MainMenuBar(0)
        self.SetMenuBar(self.menu_bar)

        self.SetSizer(self.global_sizer)
        self.Layout()
        self.Center(wx.BOTH)

        self.items_list = []
        self.items_dict = {}
        self.block_list = []

        self.timer = wx.Timer()

        self.timer.SetOwner(self, wx.ID_ANY)