本文整理汇总了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
#============================================================================
示例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()
示例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()
示例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
示例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
#============================================================================
示例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
示例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)
示例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
示例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()
示例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
示例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)
示例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)
示例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())
示例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
示例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