当前位置: 首页>>代码示例>>Python>>正文


Python wx.TextEntryDialog方法代码示例

本文整理汇总了Python中wx.TextEntryDialog方法的典型用法代码示例。如果您正苦于以下问题:Python wx.TextEntryDialog方法的具体用法?Python wx.TextEntryDialog怎么用?Python wx.TextEntryDialog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wx的用法示例。


在下文中一共展示了wx.TextEntryDialog方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: decrypt_doc

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def decrypt_doc():
    # let user enter document password
    pw = None
    dlg = wx.TextEntryDialog(None, 'Please enter password below:',
             'Document is password protected', '',
             style = wx.TextEntryDialogStyle|wx.TE_PASSWORD)
    while pw is None:
        rc = dlg.ShowModal()
        if rc == wx.ID_OK:
            pw = str(dlg.GetValue().encode("utf-8"))
            PDFcfg.doc.authenticate(pw)
        else:
            return
        if PDFcfg.doc.isEncrypted:
            pw = None
            dlg.SetTitle("Wrong password. Enter correct password or cancel.")
    return

#==============================================================================
# Write the changed PDF file
#============================================================================ 
开发者ID:ActiveState,项目名称:code,代码行数:23,代码来源:recipe-580623.py

示例2: OnAddSubindexMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def OnAddSubindexMenu(self, event):
        if self.Editable:
            selected = self.IndexList.GetSelection()
            if selected != wx.NOT_FOUND:
                index = self.ListIndex[selected]
                if self.Manager.IsCurrentEntry(index):
                    dialog = wx.TextEntryDialog(self, _("Number of subindexes to add:"),
                                 _("Add subindexes"), "1", wx.OK|wx.CANCEL)
                    if dialog.ShowModal() == wx.ID_OK:
                        try:
                            number = int(dialog.GetValue())
                            self.Manager.AddSubentriesToCurrent(index, number)
                            self.ParentWindow.RefreshBufferState()
                            self.RefreshIndexList()
                        except:
                            message = wx.MessageDialog(self, _("An integer is required!"), _("ERROR"), wx.OK|wx.ICON_ERROR)
                            message.ShowModal()
                            message.Destroy()
                    dialog.Destroy() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:21,代码来源:subindextable.py

示例3: OnDeleteSubindexMenu

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def OnDeleteSubindexMenu(self, event):
        if self.Editable:
            selected = self.IndexList.GetSelection()
            if selected != wx.NOT_FOUND:
                index = self.ListIndex[selected]
                if self.Manager.IsCurrentEntry(index):
                    dialog = wx.TextEntryDialog(self, _("Number of subindexes to delete:"),
                                 _("Delete subindexes"), "1", wx.OK|wx.CANCEL)
                    if dialog.ShowModal() == wx.ID_OK:
                        try:
                            number = int(dialog.GetValue())
                            self.Manager.RemoveSubentriesFromCurrent(index, number)
                            self.ParentWindow.RefreshBufferState()
                            self.RefreshIndexList()
                        except:
                            message = wx.MessageDialog(self, _("An integer is required!"), _("ERROR"), wx.OK|wx.ICON_ERROR)
                            message.ShowModal()
                            message.Destroy()
                    dialog.Destroy() 
开发者ID:jgeisler0303,项目名称:CANFestivino,代码行数:21,代码来源:subindextable.py

示例4: decrypt_doc

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def decrypt_doc(self):
        # let user enter document password
        pw = None
        dlg = wx.TextEntryDialog(self, 'Please enter password below:',
                 'Document needs password to open', '',
                 style = wx.TextEntryDialogStyle|wx.TE_PASSWORD)
        while pw is None:
            rc = dlg.ShowModal()
            if rc == wx.ID_OK:
                pw = str(dlg.GetValue().encode("utf-8"))
                self.doc.authenticate(pw)
            else:
                return
            if self.doc.isEncrypted:
                pw = None
                dlg.SetTitle("Wrong password. Enter correct one or cancel.")
        return

#==============================================================================
# main program
#------------------------------------------------------------------------------
# Show a standard FileSelect dialog to choose a file for display
#==============================================================================
# Wildcard: offer all supported filetypes for display 
开发者ID:pymupdf,项目名称:PyMuPDF-Utilities,代码行数:26,代码来源:PDFdisplay.py

示例5: decrypt_doc

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def decrypt_doc():
    # let user enter document password
    pw = None
    dlg = wx.TextEntryDialog(None, 'Please enter the password below:',
             'Document is password protected', '',
             style = wx.TextEntryDialogStyle|wx.TE_PASSWORD)
    while pw is None:
        rc = dlg.ShowModal()
        if rc == wx.ID_OK:
            pw = dlg.GetValue().encode("latin-1")
            spad.doc.authenticate(pw)
        else:
            return
        if spad.doc.isEncrypted:
            pw = None
            dlg.SetTitle("Wrong password. Enter correct one or cancel.")
    return

#==============================================================================
# Write the changed PDF file
#============================================================================ 
开发者ID:pymupdf,项目名称:PyMuPDF-Utilities,代码行数:23,代码来源:PDFoutline.py

示例6: decrypt_doc

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def decrypt_doc(self):
        # let user enter document password
        pw = None
        dlg = wx.TextEntryDialog(self, 'Please Enter Password',
                 'Document needs password to open', '',
                 style = wx.TextEntryDialogStyle|wx.TE_PASSWORD)
        while pw is None:
            rc = dlg.ShowModal()
            if rc == wx.ID_OK:
                pw = str(dlg.GetValue().encode("utf-8"))
                self.doc.authenticate(pw)
            else:
                return
            if self.doc.isEncrypted:
                pw = None
                dlg.SetTitle("Wrong password. Enter correct one or cancel.")
        return

#==============================================================================
# main program
#------------------------------------------------------------------------------
# Show a standard FileSelect dialog to choose a file
#==============================================================================
# Wildcard: only offer PDF files 
开发者ID:pymupdf,项目名称:PyMuPDF-Utilities,代码行数:26,代码来源:PDFLinkMaint.py

示例7: enter_torrent_url

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def enter_torrent_url(self, widget):
        s = ''
        if wx.TheClipboard.Open():
            do = wx.TextDataObject()
            if wx.TheClipboard.GetData(do):
                t = do.GetText()
                t = t.strip()
                if "://" in t or os.path.sep in t or (os.path.altsep and os.path.altsep in t):
                    s = t
            wx.TheClipboard.Close()
        d = wx.TextEntryDialog(parent=self.main_window,
                               message=_("Enter the URL of a torrent file to open:"),
                               caption=_("Enter torrent URL"),
                               defaultValue = s,
                               style=wx.OK|wx.CANCEL,
                               )
        if d.ShowModal() == wx.ID_OK:
            path = d.GetValue()
            df = self.open_torrent_arg_with_callbacks(path) 
开发者ID:kenorb-contrib,项目名称:BitTorrent,代码行数:21,代码来源:DownloadManager.py

示例8: AskPassword

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def AskPassword(parentWin, msg, caption, withRememberCheck=False):
#    dlg=wx.PasswordEntryDialog(parentWin, msg, caption)
# We might support "Remember" here
#    dlg=wx.TextEntryDialog(parentWin, msg, caption)
    dlg=PasswordDlg(parentWin, msg, caption)
    if not withRememberCheck:
      dlg['Remember'].Hide()
    passwd=None
    remember=False
    if dlg.ShowModal() == wx.ID_OK:
      passwd=dlg.Password
      remember=dlg.Remember
      
    dlg.Destroy()
    if withRememberCheck:
      return passwd, remember
    else:
      return passwd 
开发者ID:andreas-p,项目名称:admin4,代码行数:20,代码来源:adm.py

示例9: OnSubclass

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def OnSubclass(self, evt):
        selected = tree.selection
        xxx = tree.GetPyData(selected).treeObject()
        elem = xxx.element
        subclass = xxx.subclass
        dlg = wx.TextEntryDialog(self, 'Subclass:', defaultValue=subclass)
        if dlg.ShowModal() == wx.ID_OK:
            subclass = dlg.GetValue()
            if subclass:
                elem.setAttribute('subclass', subclass)
            elif elem.hasAttribute('subclass'):
                elem.removeAttribute('subclass')
            self.SetModified()
            xxx.subclass = elem.getAttribute('subclass')
            tree.SetItemText(selected, xxx.treeName())
            panel.pages[0].box.SetLabel(xxx.panelName())
        dlg.Destroy() 
开发者ID:andreas-p,项目名称:admin4,代码行数:19,代码来源:xrced.py

示例10: OnExecute

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def OnExecute(parentWin, parentNode):
    if isinstance(parentNode, Zone):
      txt=xlt("Sub zone name")
    else:
      txt=xlt("Zone name")
    dlg=wx.TextEntryDialog(parentWin, txt, xlt("Register new Zone"))
    if dlg.ShowModal() == wx.ID_OK:
      dlg.Hide()
      parentWin.SetFocus()
      if isinstance(parentNode, Zone):
        name="%s.%s" % (dlg.GetValue(), parentNode.name)
      else:
        name=dlg.GetValue()
      zone=Zone(parentNode, name)
      if zone.name not in parentNode.zones:
        parentNode.AddZone(zone)
        return True
    return False 
开发者ID:andreas-p,项目名称:admin4,代码行数:20,代码来源:Zone.py

示例11: on_test_button_click

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def on_test_button_click(self, event):
        dlg = wx.TextEntryDialog(
            None, _('Enter your test tweet.'), caption=_('Test Twitter integration'), value=_('Staaaay fresh!'))
        r = dlg.ShowModal()
        s = dlg.GetValue()
        dlg.Destroy()

        if r != wx.ID_OK:
            return

        response = self.tweet(s)
        if response.status_code != 200:
            IkaUtils.dprint('%s: Failed to post tweet. Review your settings.' % self) 
开发者ID:hasegaw,项目名称:IkaLog,代码行数:15,代码来源:twitter.py

示例12: name_new_profile

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def name_new_profile(self, event=None, extra_profile_data={}):
        """Prompt for the new miner's name."""
        dialog = wx.TextEntryDialog(self, _("Name this miner:"), _("New miner"))
        if dialog.ShowModal() == wx.ID_OK:
            name = dialog.GetValue().strip()
            if not name: name = _("Untitled")
            data = extra_profile_data.copy()
            data['name'] = name
            self.add_profile(data) 
开发者ID:theRealTacoTime,项目名称:poclbm,代码行数:11,代码来源:guiminer.py

示例13: rename_miner

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def rename_miner(self, event):
        """Change the name of a miner as displayed on the tab."""
        p = self.nb.GetPage(self.nb.GetSelection())
        if p not in self.profile_panels:
            return

        dialog = wx.TextEntryDialog(self, _("Rename to:"), _("Rename miner"))
        if dialog.ShowModal() == wx.ID_OK:
            p.set_name(dialog.GetValue().strip()) 
开发者ID:theRealTacoTime,项目名称:poclbm,代码行数:11,代码来源:guiminer.py

示例14: makePopUp

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def makePopUp(self, prompt, title):
        pp = wx.TextEntryDialog(self, prompt, title)
        pp.ShowModal()
        r = pp.GetValue()
        pp.Destroy()
        pp.Show()
        return r 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:9,代码来源:convertQuotation.py

示例15: makePopUpDate

# 需要导入模块: import wx [as 别名]
# 或者: from wx import TextEntryDialog [as 别名]
def makePopUpDate(self, prompt, title):
        pp = wx.TextEntryDialog(self, prompt, title)
        pp.ShowModal()
        r = pp.GetValue()
        pp.Destroy()
        pp.Show()
        return r 
开发者ID:104H,项目名称:HH---POS-Accounting-and-ERP-Software,代码行数:9,代码来源:backupTerminalFrontEnd.py


注:本文中的wx.TextEntryDialog方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。