Python wx.TE_PASSWORD Examples

The following are 10 code examples of wx.TE_PASSWORD(). 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: 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 #2
Source File: PasswordCtrl.py    From EventGhost with GNU General Public License v2.0 6 votes vote down vote up
def __init__(
        self,
        parent,
        id=-1,
        value="",
        pos=wx.DefaultPosition,
        size=wx.DefaultSize,
    ):
        if isinstance(value, eg.Password):
            self.password = value
        else:
            self.password = eg.Password(content=value)
        wx.TextCtrl.__init__(
            self,
            parent,
            id,
            self.password.Get(),
            pos,
            size,
            style=wx.TE_PASSWORD,
        ) 
Example #3
Source File: testWx.py    From SinaWeibo with MIT License 5 votes vote down vote up
def __init__(self, parent):
        '''构造函数'''

        wx.Frame.__init__(self, parent, -1, APP_TITLE)
        self.SetBackgroundColour(wx.Colour(224, 224, 224))
        self.SetSize((600, 400))
        self.Center()

        wx.StaticText(self, -1, u'用户名', pos=(10, 55), size=(42, -1))
        wx.StaticText(self, -1, u'密码', pos=(10, 85), size=(40, -1))

        self.tc1 = wx.TextCtrl(self, -1, '', pos=(50, 50), size=(150, -1), name='TC01', style=wx.TE_PASSWORD)
        self.tc2 = wx.TextCtrl(self, -1, '', pos=(50, 80), size=(150, -1), name='TC02', style=wx.TE_PASSWORD)

        btn_login = wx.Button(self, -1, u'登录', pos=(200, 50), size=(100, 25))
        btn_login.Bind(wx.EVT_LEFT_DOWN, self.OnLoginWeibo)

        wx.StaticText(self, -1, u'内容', pos=(10, 125), size=(40, -1))
        self.tcContent = wx.TextCtrl(self, -1, '', pos=(50, 120), size=(200, -1))

        wx.StaticText(self, -1, u'图片', pos=(10, 155), size=(40, -1))
        self.tcImage = wx.TextCtrl(self, -1, '', pos=(50, 150), size=(200, -1))

        btn_content = wx.Button(self, -1, u'发送文本微博', pos=(50, 180), size=(100, 25))
        btn_content.Bind(wx.EVT_LEFT_DOWN, self.OnPostContent)

        btn_image = wx.Button(self, -1, u'发送图文微博', pos=(150, 180), size=(100, 25))
        btn_image.Bind(wx.EVT_LEFT_DOWN, self.OnPostImage)

        btn_blog = wx.Button(self, -1, u'获取微博', pos=(250, 180), size=(100, 25))
        btn_blog.Bind(wx.EVT_LEFT_DOWN, self.OnGetBlogs)

        wx.StaticText(self, -1, u'删除ID', pos=(10, 235), size=(40, -1))
        self.tcBlogID = wx.TextCtrl(self, -1, '', pos=(50, 230), size=(200, -1))

        btn_del = wx.Button(self, -1, u'删除微博', pos=(50, 260), size=(100, 25))
        btn_del.Bind(wx.EVT_LEFT_DOWN, self.OnDelBlog) 
Example #4
Source File: text_input.py    From Gooey with MIT License 5 votes vote down vote up
def PasswordInput(_, parent, *args, **kwargs):
    style = {'style': wx.TE_PASSWORD}
    return TextInput(parent, *args, **merge(kwargs, style)) 
Example #5
Source File: optionsframe.py    From youtube-dl-gui with The Unlicense 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(GeneralTab, self).__init__(*args, **kwargs)

        self.language_label = self.crt_statictext(_("Language"))
        self.language_combobox = self.crt_bitmap_combobox(list(self.LOCALE_NAMES.items()), event_handler=self._on_language)

        self.filename_format_label = self.crt_statictext(_("Filename format"))
        self.filename_format_combobox = self.crt_combobox(list(OUTPUT_FORMATS.values()), event_handler=self._on_filename)
        self.filename_custom_format = self.crt_textctrl()
        self.filename_custom_format_button = self.crt_button("...", self._on_format)

        self.filename_opts_label = self.crt_statictext(_("Filename options"))
        self.filename_ascii_checkbox = self.crt_checkbox(_("Restrict filenames to ASCII"))

        self.more_opts_label = self.crt_statictext(_("More options"))
        self.confirm_exit_checkbox = self.crt_checkbox(_("Confirm on exit"))
        self.confirm_deletion_checkbox = self.crt_checkbox(_("Confirm item deletion"))
        self.show_completion_popup_checkbox = self.crt_checkbox(_("Inform me on download completion"))

        self.shutdown_checkbox = self.crt_checkbox(_("Shutdown on download completion"), event_handler=self._on_shutdown)
        self.sudo_textctrl = self.crt_textctrl(wx.TE_PASSWORD)

        # Build the menu for the custom format button
        self.custom_format_menu = self._build_custom_format_menu()

        self._set_layout()

        if os.name == "nt":
            self.sudo_textctrl.Hide()

        self.sudo_textctrl.SetToolTip(wx.ToolTip(_("SUDO password"))) 
Example #6
Source File: optionsframe.py    From youtube-dl-gui with The Unlicense 5 votes vote down vote up
def __init__(self, *args, **kwargs):
        super(AdvancedTab, self).__init__(*args, **kwargs)

        self.retries_label = self.crt_statictext(_("Retries"))
        self.retries_spinctrl = self.crt_spinctrl((1, 999))

        self.auth_label = self.crt_statictext(_("Authentication"))

        self.username_label = self.crt_statictext(_("Username"))
        self.username_textctrl = self.crt_textctrl()
        self.password_label = self.crt_statictext(_("Password"))
        self.password_textctrl = self.crt_textctrl(wx.TE_PASSWORD)
        self.video_pass_label = self.crt_statictext(_("Video password"))
        self.video_pass_textctrl = self.crt_textctrl(wx.TE_PASSWORD)

        self.network_label = self.crt_statictext(_("Network"))

        self.proxy_label = self.crt_statictext(_("Proxy"))
        self.proxy_textctrl = self.crt_textctrl()
        self.useragent_label = self.crt_statictext(_("User agent"))
        self.useragent_textctrl = self.crt_textctrl()
        self.referer_label = self.crt_statictext(_("Referer"))
        self.referer_textctrl = self.crt_textctrl()

        self.logging_label = self.crt_statictext(_("Logging"))

        self.enable_log_checkbox = self.crt_checkbox(_("Enable log"), self._on_enable_log)
        self.view_log_button = self.crt_button(_("View"), self._on_view)
        self.clear_log_button = self.crt_button(_("Clear"), self._on_clear)

        self._set_layout()

        if self.log_manager is None:
            self.view_log_button.Disable()
            self.clear_log_button.Disable() 
Example #7
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 #8
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, port=1024, password="", prefix="TCP"):
        text = self.text
        panel = eg.ConfigPanel()
        portCtrl = panel.SpinIntCtrl(port, max=65535)
        passwordCtrl = panel.TextCtrl(password, style=wx.TE_PASSWORD)
        eventPrefixCtrl = panel.TextCtrl(prefix)
        st1 = panel.StaticText(text.port)
        st2 = panel.StaticText(text.password)
        st3 = panel.StaticText(text.eventPrefix)
        eg.EqualizeWidths((st1, st2, st3))
        box1 = panel.BoxedGroup(text.tcpBox, (st1, portCtrl))
        box2 = panel.BoxedGroup(text.securityBox, (st2, passwordCtrl))
        box3 = panel.BoxedGroup(
            text.eventGenerationBox, (st3, eventPrefixCtrl)
        )
        panel.sizer.AddMany([
            (box1, 0, wx.EXPAND),
            (box2, 0, wx.EXPAND|wx.TOP, 10),
            (box3, 0, wx.EXPAND|wx.TOP, 10),
        ])
        while panel.Affirmed():
            panel.SetResult(
                portCtrl.GetValue(),
                passwordCtrl.GetValue(),
                eventPrefixCtrl.GetValue()
            ) 
Example #9
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, port=1025, password="", prefix="Apple"):
        text = self.text
        panel = eg.ConfigPanel()

        portCtrl = panel.SpinIntCtrl(port, max=65535)
        passwordCtrl = panel.TextCtrl(password, style=wx.TE_PASSWORD)
        eventPrefixCtrl = panel.TextCtrl(prefix)
        st1 = panel.StaticText(text.port)
        st2 = panel.StaticText(text.password)
        st3 = panel.StaticText(text.eventPrefix)
        eg.EqualizeWidths((st1, st2, st3))
        box1 = panel.BoxedGroup(text.tcpBox, (st1, portCtrl))
        box2 = panel.BoxedGroup(text.securityBox, (st2, passwordCtrl))
        box3 = panel.BoxedGroup(
            text.eventGenerationBox, (st3, eventPrefixCtrl)
        )
        panel.sizer.AddMany([
            (box1, 0, wx.EXPAND),
            (box2, 0, wx.EXPAND|wx.TOP, 10),
            (box3, 0, wx.EXPAND|wx.TOP, 10),
        ])

        while panel.Affirmed():
            panel.SetResult(
                portCtrl.GetValue(),
                passwordCtrl.GetValue(),
                eventPrefixCtrl.GetValue()
            ) 
Example #10
Source File: __init__.py    From EventGhost with GNU General Public License v2.0 5 votes vote down vote up
def Configure(self, host="127.0.0.1", port=1024, password=""):
        text = self.text
        panel = eg.ConfigPanel()
        hostCtrl = panel.TextCtrl(host)
        portCtrl = panel.SpinIntCtrl(port, max=65535)
        passwordCtrl = panel.TextCtrl(password, style=wx.TE_PASSWORD)

        st1 = panel.StaticText(text.host)
        st2 = panel.StaticText(text.port)
        st3 = panel.StaticText(text.password)
        eg.EqualizeWidths((st1, st2, st3))
        tcpBox = panel.BoxedGroup(
            text.tcpBox,
            (st1, hostCtrl),
            (st2, portCtrl),
        )
        securityBox = panel.BoxedGroup(
            text.securityBox,
            (st3, passwordCtrl),
        )

        panel.sizer.Add(tcpBox, 0, wx.EXPAND)
        panel.sizer.Add(securityBox, 0, wx.TOP|wx.EXPAND, 10)

        while panel.Affirmed():
            panel.SetResult(
                hostCtrl.GetValue(),
                portCtrl.GetValue(),
                passwordCtrl.GetValue()
            )