Python wx.StaticText() Examples

The following are 30 code examples of wx.StaticText(). 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: 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 #2
Source File: guiminer.py    From poclbm with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, title):
        style = wx.DEFAULT_DIALOG_STYLE
        vbox = wx.BoxSizer(wx.VERTICAL)
        wx.Dialog.__init__(self, parent, -1, title, style=style)
        self.user_lbl = wx.StaticText(self, -1, STR_USERNAME)
        self.txt_username = wx.TextCtrl(self, -1, "")
        self.pass_lbl = wx.StaticText(self, -1, STR_PASSWORD)
        self.txt_pass = wx.TextCtrl(self, -1, "", style=wx.TE_PASSWORD)
        grid_sizer_1 = wx.FlexGridSizer(2, 2, 5, 5)
        grid_sizer_1.Add(self.user_lbl, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)
        grid_sizer_1.Add(self.txt_username, 0, wx.EXPAND, 0)
        grid_sizer_1.Add(self.pass_lbl, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 0)
        grid_sizer_1.Add(self.txt_pass, 0, wx.EXPAND, 0)
        buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        vbox.Add(grid_sizer_1, wx.EXPAND | wx.ALL, 10)
        vbox.Add(buttons)
        self.SetSizerAndFit(vbox) 
Example #3
Source File: flagpage.py    From magpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def createControls(self):
        self.flagOptionsLabel = wx.StaticText(self, label="Flagging methods:")
        self.flagOutlierButton = wx.Button(self,-1,"Flag Outlier",size=(160,30))
        self.flagRangeButton = wx.Button(self,-1,"Flag Range",size=(160,30))
        self.flagMinButton = wx.Button(self,-1,"Flag Minimum",size=(160,30))
        self.flagMaxButton = wx.Button(self,-1,"Flag Maximum",size=(160,30))
        self.xCheckBox = wx.CheckBox(self,label="X             ")
        self.yCheckBox = wx.CheckBox(self,label="Y             ")
        self.zCheckBox = wx.CheckBox(self,label="Z             ")
        self.fCheckBox = wx.CheckBox(self,label="F             ")
        self.FlagIDText = wx.StaticText(self,label="Select Min/Max Flag ID:")
        self.FlagIDComboBox = wx.ComboBox(self, choices=self.flagidlist,
            style=wx.CB_DROPDOWN, value=self.flagidlist[3],size=(160,-1))
        self.flagSelectionButton = wx.Button(self,-1,"Flag Selection",size=(160,30))
        self.flagDropButton = wx.Button(self,-1,"Drop flagged",size=(160,30))
        self.flagLoadButton = wx.Button(self,-1,"Load flags",size=(160,30))
        self.flagSaveButton = wx.Button(self,-1,"Save flags",size=(160,30))
        self.flagClearButton = wx.Button(self,-1,"Clear flags",size=(160,30)) 
Example #4
Source File: csv.py    From IkaLog with Apache License 2.0 6 votes vote down vote up
def on_option_tab_create(self, notebook):
        self.panel = wx.Panel(notebook, wx.ID_ANY)
        self.panel_name = _('CSV')
        self.layout = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(self.layout)
        self.checkEnable = wx.CheckBox(
            self.panel, wx.ID_ANY, _('Enable CSV Log'))
        self.editCsvFilename = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')

        self.layout.Add(wx.StaticText(self.panel, wx.ID_ANY, _('Log Filename')))
        self.layout.Add(self.editCsvFilename, flag=wx.EXPAND)

        self.layout.Add(self.checkEnable)

    ##
    # Write a line to text file.
    # @param self     The Object Pointer.
    # @param record   Record (text)
    # 
Example #5
Source File: screenshot.py    From IkaLog with Apache License 2.0 6 votes vote down vote up
def on_option_tab_create(self, notebook):
        self.panel = wx.Panel(notebook, wx.ID_ANY)
        self.panel_name = _('Screenshot')
        self.layout = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(self.layout)
        self.checkResultDetailEnable = wx.CheckBox(
            self.panel, wx.ID_ANY, _('Save screenshots of game results'))
        self.editDir = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')

        self.layout.Add(wx.StaticText(
            self.panel, wx.ID_ANY, _('Folder to save screenshots')))
        self.layout.Add(self.editDir, flag=wx.EXPAND)
        self.layout.Add(self.checkResultDetailEnable)

        self.panel.SetSizer(self.layout)

    ##
    # on_result_detail_still Hook
    # @param self      The Object Pointer
    # @param context   IkaLog context
    # 
Example #6
Source File: hue.py    From IkaLog with Apache License 2.0 6 votes vote down vote up
def on_option_tab_create(self, notebook):
        self.panel = wx.Panel(notebook, wx.ID_ANY, size=(640, 360))
        self.panel_name = 'Hue'
        self.layout = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(self.layout)
        self.checkEnable = wx.CheckBox(self.panel, wx.ID_ANY, u'Hue と連携')
        self.editHueHost = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
        self.editHueUsername = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')

        try:
            layout = wx.GridSizer(2, 2)
        except:
            layout = wx.GridSizer(2)

        layout.Add(wx.StaticText(self.panel, wx.ID_ANY, u'ホスト'))
        layout.Add(self.editHueHost)
        layout.Add(wx.StaticText(self.panel, wx.ID_ANY, u'ユーザ'))
        layout.Add(self.editHueUsername)
        self.layout.Add(self.checkEnable)
        self.layout.Add(layout)

    # enhance_color and rgb2xy is imported from:
    # https://gist.githubusercontent.com/error454/6b94c46d1f7512ffe5ee/raw/73b190ce256c3d8dd540cc34e6dae43848cbce4c/gistfile1.py

    # All the rights belongs to the author. 
Example #7
Source File: fourier_demo_wx_sgskip.py    From python3_ios with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def __init__(self, parent, label, param):
        self.sliderLabel = wx.StaticText(parent, label=label)
        self.sliderText = wx.TextCtrl(parent, -1, style=wx.TE_PROCESS_ENTER)
        self.slider = wx.Slider(parent, -1)
        # self.slider.SetMax(param.maximum*1000)
        self.slider.SetRange(0, param.maximum * 1000)
        self.setKnob(param.value)

        sizer = wx.BoxSizer(wx.HORIZONTAL)
        sizer.Add(self.sliderLabel, 0,
                  wx.EXPAND | wx.ALIGN_CENTER | wx.ALL,
                  border=2)
        sizer.Add(self.sliderText, 0,
                  wx.EXPAND | wx.ALIGN_CENTER | wx.ALL,
                  border=2)
        sizer.Add(self.slider, 1, wx.EXPAND)
        self.sizer = sizer

        self.slider.Bind(wx.EVT_SLIDER, self.sliderHandler)
        self.sliderText.Bind(wx.EVT_TEXT_ENTER, self.sliderTextHandler)

        self.param = param
        self.param.attach(self) 
Example #8
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 #9
Source File: guiminer.py    From poclbm with GNU General Public License v3.0 6 votes vote down vote up
def get_summary_widgets(self, summary_panel):
        """Return a list of summary widgets suitable for sizer.AddMany."""
        self.summary_panel = summary_panel
        self.summary_name = wx.StaticText(summary_panel, -1, self.name)
        self.summary_name.Bind(wx.EVT_LEFT_UP, self.show_this_panel)

        self.summary_status = wx.StaticText(summary_panel, -1, STR_STOPPED)
        self.summary_shares_accepted = wx.StaticText(summary_panel, -1, "0")
        self.summary_shares_invalid = wx.StaticText(summary_panel, -1, "0")
        self.summary_start = wx.Button(summary_panel, -1, self.get_start_stop_state(), style=wx.BU_EXACTFIT)
        self.summary_start.Bind(wx.EVT_BUTTON, self.toggle_mining)
        self.summary_autostart = wx.CheckBox(summary_panel, -1)
        self.summary_autostart.Bind(wx.EVT_CHECKBOX, self.toggle_autostart)
        self.summary_autostart.SetValue(self.autostart)
        return [
            (self.summary_name, 0, wx.ALIGN_CENTER_HORIZONTAL),
            (self.summary_status, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
            (self.summary_shares_accepted, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
            (self.summary_shares_invalid, 0, wx.ALIGN_CENTER_HORIZONTAL, 0),
            (self.summary_start, 0, wx.ALIGN_CENTER, 0),
            (self.summary_autostart, 0, wx.ALIGN_CENTER, 0)
        ] 
Example #10
Source File: cfgdlg.py    From trelby with GNU General Public License v2.0 6 votes vote down vote up
def addMarginCtrl(self, name, parent, sizer):
        sizer.Add(wx.StaticText(parent, -1, name + ":"), 0,
                  wx.ALIGN_CENTER_VERTICAL)

        entry = wx.TextCtrl(parent, -1)
        sizer.Add(entry, 0)
        label = wx.StaticText(parent, -1, "mm")
        sizer.Add(label, 0, wx.ALIGN_CENTER_VERTICAL)

        entry2 = wx.TextCtrl(parent, -1)
        sizer.Add(entry2, 0, wx.LEFT, 20)
        label2 = wx.StaticText(parent, -1, "inch")
        sizer.Add(label2, 0, wx.ALIGN_CENTER_VERTICAL)

        setattr(self, name.lower() + "EntryMm", entry)
        setattr(self, name.lower() + "EntryInch", entry2)

        wx.EVT_TEXT(self, entry.GetId(), self.OnMarginMm)
        wx.EVT_TEXT(self, entry2.GetId(), self.OnMarginInch) 
Example #11
Source File: websocket_server.py    From IkaLog with Apache License 2.0 6 votes vote down vote up
def on_option_tab_create(self, notebook):
        self.panel = wx.Panel(notebook, wx.ID_ANY)
        self.panel_name = _('WebSocket Server')
        self.layout = wx.BoxSizer(wx.VERTICAL)

        self.check_enable = wx.CheckBox(
            self.panel, wx.ID_ANY, _('Enable WebSocket Server'))
        self.edit_port = wx.TextCtrl(self.panel, wx.ID_ANY, 'port')

        layout = wx.GridSizer(2)
        layout.Add(wx.StaticText(self.panel, wx.ID_ANY, _('Listen port')))
        layout.Add(self.edit_port)

        self.layout.Add(self.check_enable)
        self.layout.Add(wx.StaticText(
            self.panel, wx.ID_ANY,
            _('WARNING: The server is accessible by anyone.'),
        ))
        self.layout.Add(layout, flag=wx.EXPAND)

        self.panel.SetSizer(self.layout) 
Example #12
Source File: guiminer.py    From poclbm with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, title, current_language):
        style = wx.DEFAULT_DIALOG_STYLE
        vbox = wx.BoxSizer(wx.VERTICAL)
        wx.Dialog.__init__(self, parent, -1, title, style=style)
        self.lbl = wx.StaticText(self, -1,
            _("Choose language (requires restart to take full effect)"))
        vbox.Add(self.lbl, 0, wx.ALL, 10)
        self.language_choices = wx.ComboBox(self, -1,
                                            choices=sorted(LANGUAGES.keys()),
                                            style=wx.CB_READONLY)

        self.language_choices.SetStringSelection(LANGUAGES_REVERSE[current_language])

        vbox.Add(self.language_choices, 0, wx.ALL, 10)
        buttons = self.CreateButtonSizer(wx.OK | wx.CANCEL)
        vbox.Add(buttons, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 10)
        self.SetSizerAndFit(vbox) 
Example #13
Source File: developpage.py    From magpy with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def createControls(self):
        self.DrawAuxButton = wx.Button(self,-1,"Draw/Recalc")
        self.SaveAuxButton = wx.Button(self,-1,"Save data")
        self.AppendAuxButton = wx.Button(self,-1,"Append")
        self.OpenAuxButton = wx.Button(self,-1,"Open Aux file")
        self.AuxDataLabel = wx.StaticText(self, label="Auxiliary data")
        self.AuxDataTextCtrl = wx.TextCtrl(self, style=wx.TE_MULTILINE) # get this value from obsini
        self.AuxDataTextCtrl.Disable()
        self.AuxResolutionLabel = wx.StaticText(self, label="Time resolution")
        self.AuxResolutionTextCtrl = wx.TextCtrl(self, value="NaN")
        self.AuxResolutionTextCtrl.Disable()
        self.AuxStartDateTextCtrl = wx.TextCtrl(self, value="--")
        self.AuxStartDateTextCtrl.Disable()
        self.AuxEndDateTextCtrl = wx.TextCtrl(self, value="--")
        self.AuxEndDateTextCtrl.Disable()
        self.funcLabel = wx.StaticText(self, label="Apply fuctions:")
        self.removeOutliersCheckBox = wx.CheckBox(self,
            label="Remove Outliers")
        self.recoveryCheckBox = wx.CheckBox(self,
            label="Show data coverage")
        self.interpolateCheckBox = wx.CheckBox(self,
            label="Interpolate data")
        self.fitCheckBox = wx.CheckBox(self,
            label="Fit function") 
Example #14
Source File: guiminer.py    From poclbm with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent):
        wx.Dialog.__init__(self, parent, -1, _("No OpenCL devices found."))
        vbox = wx.BoxSizer(wx.VERTICAL)
        self.message = wx.StaticText(self, -1,
 _("""No OpenCL devices were found.
 If you only want to mine using CPU or CUDA, you can ignore this message.
 If you want to mine on ATI graphics cards, you may need to install the ATI Stream
 SDK, or your GPU may not support OpenCL."""))
        vbox.Add(self.message, 0, wx.ALL, 10)

        hbox = wx.BoxSizer(wx.HORIZONTAL)

        self.no_show_chk = wx.CheckBox(self, -1)
        hbox.Add(self.no_show_chk)
        self.no_show_txt = wx.StaticText(self, -1, _("Don't show this message again"))
        hbox.Add((5, 0))
        hbox.Add(self.no_show_txt)
        vbox.Add(hbox, 0, wx.ALL, 10)
        buttons = self.CreateButtonSizer(wx.OK)
        vbox.Add(buttons, 0, wx.ALIGN_BOTTOM | wx.ALIGN_CENTER_HORIZONTAL, 0)
        self.SetSizerAndFit(vbox) 
Example #15
Source File: misc.py    From trelby with GNU General Public License v2.0 6 votes vote down vote up
def addCombo(self, name, descr, parent, sizer, items, sel):
        al = wx.ALIGN_CENTER_VERTICAL | wx.RIGHT
        if sel == 1:
            al |= wx.ALIGN_RIGHT

        sizer.Add(wx.StaticText(parent, -1, descr), 0, al, 10)

        combo = wx.ComboBox(parent, -1, style = wx.CB_READONLY)
        util.setWH(combo, w = 200)

        for s in items:
            combo.Append(s)

        combo.SetSelection(sel)

        sizer.Add(combo)

        setattr(self, name + "Combo", combo) 
Example #16
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 #17
Source File: daily.py    From Bruno with MIT License 6 votes vote down vote up
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.''') 
Example #18
Source File: dialogs.py    From NVDARemote with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, parent=None, id=wx.ID_ANY):
		super().__init__(parent, id)
		sizer = wx.BoxSizer(wx.HORIZONTAL)
		# Translators: The label of an edit field in connect dialog to enter name or address of the remote computer.
		sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Host:")))
		self.host = wx.TextCtrl(self, wx.ID_ANY)
		sizer.Add(self.host)
		# Translators: Label of the edit field to enter key (password) to secure the remote connection.
		sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Key:")))
		self.key = wx.TextCtrl(self, wx.ID_ANY)
		sizer.Add(self.key)
		# Translators: The button used to generate a random key/password.
		self.generate_key = wx.Button(parent=self, label=_("&Generate Key"))
		self.generate_key.Bind(wx.EVT_BUTTON, self.on_generate_key)
		sizer.Add(self.generate_key)
		self.SetSizerAndFit(sizer) 
Example #19
Source File: dialogs.py    From NVDARemote with GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, parent=None, id=wx.ID_ANY):
		super().__init__(parent, id)
		sizer = wx.BoxSizer(wx.HORIZONTAL)
		# Translators: Used in server mode to obtain the external IP address for the server (controlled computer) for direct connection.
		self.get_IP = wx.Button(parent=self, label=_("Get External &IP"))
		self.get_IP.Bind(wx.EVT_BUTTON, self.on_get_IP)
		sizer.Add(self.get_IP)
		# Translators: Label of the field displaying the external IP address if using direct (client to server) connection.
		sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&External IP:")))
		self.external_IP = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_READONLY|wx.TE_MULTILINE)
		sizer.Add(self.external_IP)
		# Translators: The label of an edit field in connect dialog to enter the port the server will listen on.
		sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Port:")))
		self.port = wx.TextCtrl(self, wx.ID_ANY, value=str(socket_utils.SERVER_PORT))
		sizer.Add(self.port)
		sizer.Add(wx.StaticText(self, wx.ID_ANY, label=_("&Key:")))
		self.key = wx.TextCtrl(self, wx.ID_ANY)
		sizer.Add(self.key)
		self.generate_key = wx.Button(parent=self, label=_("&Generate Key"))
		self.generate_key.Bind(wx.EVT_BUTTON, self.on_generate_key)
		sizer.Add(self.generate_key)
		self.SetSizerAndFit(sizer) 
Example #20
Source File: GUI_wxPython.py    From Python-GUI-Programming-Cookbook-Second-Edition with MIT License 6 votes vote down vote up
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 )

    #---------------------------------------------------------- 
Example #21
Source File: systray.py    From p2ptv-pi with MIT License 5 votes vote down vote up
def __init__(self, bgapp, title):
        wx.Frame.__init__(self, None, title=title, pos=(50, 10), size=(1100, 450))
        self.bgapp = bgapp
        self.spewwait = clock()
        self.Bind(wx.EVT_CLOSE, self.OnClose)
        self.SetBackgroundColour(wx.Colour(255, 255, 255))
        fw = 12
        spewList = wx.ListCtrl(self, pos=(0, 0), size=(1000, 300), style=wx.LC_REPORT | wx.LC_HRULES | wx.LC_VRULES)
        spewList.InsertColumn(0, 'Optimistic Unchoke', format=wx.LIST_FORMAT_CENTER, width=fw * 2)
        spewList.InsertColumn(1, 'Peer ID', width=0)
        spewList.InsertColumn(2, 'IP', width=fw * 11)
        spewList.InsertColumn(3, 'Local/Remote', format=wx.LIST_FORMAT_CENTER, width=fw * 2)
        spewList.InsertColumn(4, 'Up', format=wx.LIST_FORMAT_RIGHT, width=fw * 2)
        spewList.InsertColumn(5, 'Interested', format=wx.LIST_FORMAT_CENTER, width=fw * 2)
        spewList.InsertColumn(6, 'Choking', format=wx.LIST_FORMAT_CENTER, width=fw * 2)
        spewList.InsertColumn(7, 'Down', format=wx.LIST_FORMAT_RIGHT, width=fw * 8)
        spewList.InsertColumn(8, 'Interesting', format=wx.LIST_FORMAT_CENTER, width=fw * 2)
        spewList.InsertColumn(9, 'Choked', format=wx.LIST_FORMAT_CENTER, width=fw * 2)
        spewList.InsertColumn(10, 'Snubbed', format=wx.LIST_FORMAT_CENTER, width=fw * 2)
        spewList.InsertColumn(11, 'Downloaded', format=wx.LIST_FORMAT_RIGHT, width=fw * 5)
        spewList.InsertColumn(12, 'Uploaded', format=wx.LIST_FORMAT_RIGHT, width=fw * 5)
        spewList.InsertColumn(13, 'Completed', format=wx.LIST_FORMAT_RIGHT, width=fw * 6)
        spewList.InsertColumn(14, 'Peer Download Speed', format=wx.LIST_FORMAT_RIGHT, width=fw * 10)
        spewList.InsertColumn(15, 'Requested Piece', format=wx.LIST_FORMAT_CENTER, width=fw * 6)
        spewList.InsertColumn(16, 'Received Piece', format=wx.LIST_FORMAT_CENTER, width=fw * 6)
        self.spewList = spewList
        labelVOD = wx.StaticText(self, -1, 'static text')
        self.labelVOD = labelVOD
        gridSizer = wx.FlexGridSizer(cols=1, vgap=5)
        gridSizer.Add(spewList, -1, wx.EXPAND)
        gridSizer.Add(labelVOD, -1, wx.EXPAND)
        self.SetSizer(gridSizer)
        self.bgapp.statFrame = self 
Example #22
Source File: gui.py    From superpaper with MIT License 5 votes vote down vote up
def create_sizer_profiles(self):
        # choice menu
        self.list_of_profiles = list_profiles()
        self.profnames = []
        for prof in self.list_of_profiles:
            self.profnames.append(prof.name)
        self.profnames.append("Create a new profile")
        self.choice_profiles = wx.Choice(self, -1, name="ProfileChoice", choices=self.profnames)
        self.choice_profiles.Bind(wx.EVT_CHOICE, self.onSelect)
        st_choice_profiles = wx.StaticText(self, -1, "Setting profiles:")
        # name txt ctrl
        st_name = wx.StaticText(self, -1, "Profile name:")
        self.tc_name = wx.TextCtrl(self, -1, size=(self.tc_width, -1))
        self.tc_name.SetMaxLength(14)
        # buttons
        self.button_new = wx.Button(self, label="New")
        self.button_save = wx.Button(self, label="Save")
        self.button_delete = wx.Button(self, label="Delete")
        self.button_new.Bind(wx.EVT_BUTTON, self.onCreateNewProfile)
        self.button_save.Bind(wx.EVT_BUTTON, self.onSave)
        self.button_delete.Bind(wx.EVT_BUTTON, self.onDeleteProfile)

        # Add elements to the sizer
        self.sizer_profiles.Add(st_choice_profiles, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_profiles.Add(self.choice_profiles, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_profiles.Add(st_name, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_profiles.Add(self.tc_name, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_profiles.Add(self.button_new, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_profiles.Add(self.button_save, 0, wx.CENTER|wx.ALL, 5)
        self.sizer_profiles.Add(self.button_delete, 0, wx.CENTER|wx.ALL, 5) 
Example #23
Source File: configuration_dialogs.py    From superpaper with MIT License 5 votes vote down vote up
def __init__(self, parent, text,
                 show_image_quality=False,
                 use_perspective=False,
                 persp_name=None,
                 style=wx.BORDER_DEFAULT):
        wx.PopupTransientWindow.__init__(self, parent, style)
        self.mainframe = parent.frame
        self.display_sys = None
            # self.mainframe = parent.parent # persp dialog
        if show_image_quality:
            self.display_sys = self.mainframe.display_sys
            self.advanced_on = self.mainframe.show_advanced_settings
            self.show_image_quality = not self.mainframe.use_multi_image
            self.use_perspective = use_perspective
            self.persp_name = persp_name
        else:
            self.advanced_on = False
            self.show_image_quality = False
            self.use_perspective = False
            self.persp_name = None
        pnl = wx.Panel(self)
        # pnl.SetBackgroundColour("CADET BLUE")

        stlist = []
        if isinstance(text, str):
            st = wx.StaticText(pnl, -1, text)
            stlist.append(st)
        else:
            for textstr in text:
                st = wx.StaticText(pnl, -1, textstr)
                stlist.append(st)
        sizer = wx.BoxSizer(wx.VERTICAL)
        for st in stlist:
            sizer.Add(st, 0, wx.ALL, 5)
        if self.show_image_quality:
            st_qual = wx.StaticText(pnl, -1, self.string_ideal_image_size())
            sizer.Add(st_qual, 0, wx.ALL, 5)
        pnl.SetSizer(sizer)
        sizer.Fit(pnl)
        sizer.Fit(self)
        self.Layout() 
Example #24
Source File: gui.py    From superpaper with MIT License 5 votes vote down vote up
def create_sizer_diaginch_override(self):
        self.sizer_setting_diaginch.Clear(True)
        # statbox_parent_diaginch = self.sizer_setting_diaginch.GetStaticBox()
        statbox_parent_diaginch = self
        self.cb_diaginch = wx.CheckBox(statbox_parent_diaginch, -1, "Input display sizes manually")
        self.cb_diaginch.Bind(wx.EVT_CHECKBOX, self.onCheckboxDiaginch)
        st_diaginch = wx.StaticText(
            statbox_parent_diaginch, -1,
            "Display diagonal sizes (inches):"
        )
        st_diaginch.Disable()
        self.sizer_setting_diaginch.Add(self.cb_diaginch, 0, wx.ALIGN_LEFT|wx.LEFT, 0)
        self.sizer_setting_diaginch.Add(st_diaginch, 0, wx.ALIGN_LEFT|wx.LEFT, 10)
        # diag size data for fields
        diags = [str(dsp.diagonal_size()[1]) for dsp in self.display_sys.disp_list]
        # sizer for textctrls
        tc_list_sizer_diag = wx.WrapSizer(wx.HORIZONTAL)
        self.tc_list_diaginch = self.list_of_textctrl(statbox_parent_diaginch, wpproc.NUM_DISPLAYS, fraction=2/5)
        for tc, diag in zip(self.tc_list_diaginch, diags):
            tc_list_sizer_diag.Add(tc, 0, wx.ALIGN_LEFT|wx.ALL, 5)
            tc.ChangeValue(diag)
            tc.Disable()
        self.button_diaginch_save = wx.Button(statbox_parent_diaginch, label="Save")
        self.button_diaginch_save.Bind(wx.EVT_BUTTON, self.onSaveDiagInch)
        tc_list_sizer_diag.Add(self.button_diaginch_save, 0, wx.ALL, 5)
        self.button_diaginch_save.Disable()
        self.sizer_setting_diaginch.Add(tc_list_sizer_diag, 0, wx.ALIGN_LEFT|wx.LEFT, 5)
        self.sizer_setting_adv.Layout()
        self.sizer_main.Layout()
        self.sizer_main.Fit(self.frame)
        # Check cb according to DisplaySystem 'use_user_diags'
        self.cb_diaginch.SetValue(self.display_sys.use_user_diags)
        # Update sizer content based on new cb state
        self.onCheckboxDiaginch(None) 
Example #25
Source File: GoSyncSelectionPage.py    From gosync with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent, sync_model):
        wx.Panel.__init__(self, parent, style=wx.RAISED_BORDER)

        headerFont = wx.Font(11.5, wx.SWISS, wx.NORMAL, wx.NORMAL)

        self.sync_model = sync_model
        self.dstc = GoSyncDriveTree(self, pos=(0,0))

        self.t1 = wx.StaticText(self, -1, "Choose the directories to sync:", pos=(0,0))
        self.t1.SetFont(headerFont)

        self.cb = wx.CheckBox(self, -1, 'Sync Everything', (10, 10))
        self.cb.SetValue(True)
        self.cb.Disable()
        self.dstc.Disable()
        self.cb.Bind(wx.EVT_CHECKBOX, self.SyncSetting)

        self.Bind(CT.EVT_TREE_ITEM_CHECKED, self.ItemChecked)

        GoSyncEventController().BindEvent(self, GOSYNC_EVENT_CALCULATE_USAGE_DONE,
                                          self.RefreshTree)
        GoSyncEventController().BindEvent(self, GOSYNC_EVENT_CALCULATE_USAGE_STARTED,
                                          self.OnUsageCalculationStarted)

        self.cb.Bind(wx.EVT_CHECKBOX, self.SyncSetting)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.t1, 0, wx.ALL)
        sizer.Add(self.cb, 0, wx.ALL)
        sizer.Add(self.dstc, 1, wx.EXPAND,2)
        self.SetSizer(sizer) 
Example #26
Source File: gui.py    From superpaper with MIT License 5 votes vote down vote up
def sizer_toggle_children(self, sizer, bool_state, toggle_cb=False):
        for child in sizer.GetChildren():
            if child.IsSizer():
                self.sizer_toggle_children(child.GetSizer(), bool_state)
            else:
                widget = child.GetWindow()
                if (
                    isinstance(widget, wx.TextCtrl) or
                    isinstance(widget, wx.StaticText) or
                    isinstance(widget, wx.Choice) or
                    isinstance(widget, wx.Button) or
                    isinstance(widget, wx.CheckBox) and toggle_cb
                ):
                    widget.Enable(bool_state) 
Example #27
Source File: fluentd.py    From IkaLog with Apache License 2.0 5 votes vote down vote up
def on_option_tab_create(self, notebook):
        self.panel = wx.Panel(notebook, wx.ID_ANY, size=(640, 360))
        self.panel_name = 'Fluentd'
        self.layout = wx.BoxSizer(wx.VERTICAL)

        self.checkEnable = wx.CheckBox(
            self.panel, wx.ID_ANY, u'Fluentd へ戦績を送信する')
        self.editHost = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
        self.editPort = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
        self.editTag = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')
        self.editUsername = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')

        try:
            layout = wx.GridSizer(2, 4)
        except:
            layout = wx.GridSizer(2)

        layout.Add(wx.StaticText(self.panel, wx.ID_ANY, u'ホスト'))
        layout.Add(self.editHost)
        layout.Add(wx.StaticText(self.panel, wx.ID_ANY, u'ポート'))
        layout.Add(self.editPort)
        layout.Add(wx.StaticText(self.panel, wx.ID_ANY, u'タグ'))
        layout.Add(self.editTag)
        layout.Add(wx.StaticText(self.panel, wx.ID_ANY, u'ユーザ名'))
        layout.Add(self.editUsername)

        self.layout.Add(self.checkEnable)
        self.layout.Add(layout)

        self.panel.SetSizer(self.layout)

    ##
    # Log a record to Fluentd.
    # @param self       The Object Pointer.
    # @param recordType Record Type (tag)
    # @param record     Record
    # 
Example #28
Source File: printjson.py    From IkaLog with Apache License 2.0 5 votes vote down vote up
def on_option_tab_create(self, notebook):
        self.panel = wx.Panel(notebook, wx.ID_ANY)
        self.panel_name = _('JSON')
        self.layout = wx.BoxSizer(wx.VERTICAL)
        self.panel.SetSizer(self.layout)
        self.checkEnable = wx.CheckBox(
            self.panel, wx.ID_ANY, _('Enable JSON Log'))
        self.editJsonFilename = wx.TextCtrl(self.panel, wx.ID_ANY, u'hoge')

        self.layout.Add(wx.StaticText(self.panel, wx.ID_ANY, _('Log Filename')))
        self.layout.Add(self.editJsonFilename, flag=wx.EXPAND)

        self.layout.Add(self.checkEnable) 
Example #29
Source File: wm_legend.py    From wafer_map with GNU General Public License v3.0 5 votes vote down vote up
def _init_ui(self):
        """Initialize UI components."""
        # Add layout management
        self.hbox = wx.BoxSizer(wx.HORIZONTAL)
        self.fgs = wx.FlexGridSizer(rows=self.n_items, cols=2, vgap=0, hgap=2)

        # Create items to add
        for _i, (key, value) in enumerate(zip(self.labels, self.colors)):
            self.label = wx.StaticText(self,
                                       label=str(key),
                                       style=wx.ALIGN_LEFT,
                                       )

            self.colorbox = csel.ColourSelect(self,
                                              _i,
                                              "",
                                              tuple(value),
                                              style=wx.NO_BORDER,
                                              size=(20, 20))

            self.Bind(csel.EVT_COLOURSELECT, self.on_color_pick, id=_i)

            self.fgs.Add(self.label, flag=wx.ALIGN_CENTER_VERTICAL)
            self.fgs.Add(self.colorbox)

        # Add our items to the layout manager and set the sizer.
        self.hbox.Add(self.fgs)
        self.SetSizer(self.hbox) 
Example #30
Source File: test_sms.py    From openplotter with GNU General Public License v2.0 5 votes vote down vote up
def __init__(self):

			self.option=sys.argv[1]
			self.text_sms=sys.argv[2]
			self.text_sms=unicode(self.text_sms,'utf-8')
			self.phone=sys.argv[3]

			self.conf = Conf()
			self.home = self.conf.home
			self.currentpath = self.home+self.conf.get('GENERAL', 'op_folder')+'/openplotter'

			Language(self.conf)

			wx.Frame.__init__(self, None, title=_('Test SMS'), size=(500,260))

			self.SetFont(wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL))
			
			self.icon = wx.Icon(self.currentpath+'/openplotter.ico', wx.BITMAP_TYPE_ICO)
			self.SetIcon(self.icon)

			self.CreateStatusBar()

			self.text=wx.StaticText(self, label=_('Error'), pos=(10, 10))

			self.output = wx.TextCtrl(self, style=wx.TE_MULTILINE|wx.TE_READONLY|wx.TE_DONTWRAP, size=(480,110), pos=(10,50))
			
			self.button_close =wx.Button(self, label=_('Close'), pos=(300, 170))
			self.Bind(wx.EVT_BUTTON, self.close, self.button_close)

			self.button_calculate =wx.Button(self, label=_('Start'), pos=(400, 170))
			self.Bind(wx.EVT_BUTTON, self.calculate, self.button_calculate)

			if self.option=='i': 
				self.text.SetLabel(_('Press start to check the settings and connect to the GSM device'))

			if self.option=='t':
				self.text.SetLabel(_('Press start to send the text "').decode('utf8')+self.text_sms+_('"\nto the number "').decode('utf8')+self.phone+'"')

			self.Centre()