Python wx.TextEntryDialog() Examples
The following are 30
code examples of wx.TextEntryDialog().
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: adm.py From admin4 with Apache License 2.0 | 6 votes |
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
Example #2
Source File: DownloadManager.py From BitTorrent with GNU General Public License v3.0 | 6 votes |
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)
Example #3
Source File: PDFLinkMaint.py From PyMuPDF-Utilities with GNU General Public License v3.0 | 6 votes |
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
Example #4
Source File: PDFoutline.py From PyMuPDF-Utilities with GNU General Public License v3.0 | 6 votes |
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 #============================================================================
Example #5
Source File: xrced.py From admin4 with Apache License 2.0 | 6 votes |
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()
Example #6
Source File: PDFdisplay.py From PyMuPDF-Utilities with GNU General Public License v3.0 | 6 votes |
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
Example #7
Source File: subindextable.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
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()
Example #8
Source File: subindextable.py From CANFestivino with GNU Lesser General Public License v2.1 | 6 votes |
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()
Example #9
Source File: Zone.py From admin4 with Apache License 2.0 | 6 votes |
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
Example #10
Source File: recipe-580623.py From code with MIT License | 6 votes |
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 #============================================================================
Example #11
Source File: Entry.py From admin4 with Apache License 2.0 | 5 votes |
def OnExecute(parentWin, node): rdn=node.name.split('=') dlg=wx.TextEntryDialog(parentWin, xlt("rename to %s=") % rdn[0], xlt("Rename %s \"%s\"") % (node.typename, rdn[1])) dlg.SetValue(rdn[1]) if dlg.ShowModal() == wx.ID_OK: newname=dlg.GetValue() if newname != rdn[1]: newrdn="%s=%s" % (rdn[0], newname) node.GetConnection().Rename(node.dn, newrdn) node.name=newrdn return True return False
Example #12
Source File: tree.py From admin4 with Apache License 2.0 | 5 votes |
def OnAddGroup(self, evt): dlg=wx.TextEntryDialog(self, xlt("Enter group name"), xlt("New server group")) rc=dlg.ShowModal() if rc == wx.ID_OK: groupName=dlg.GetValue() self.addGroup(groupName)
Example #13
Source File: relay_board_gui.py From R421A08-rs485-8ch-relay-board with MIT License | 5 votes |
def OnBoardRenameClick(self, event=None): current_tab = self.m_notebook.GetSelection() dlg = wx.TextEntryDialog(self, 'Relay board name:', 'Set relay board name') dlg.SetValue(self.m_notebook.GetPageText(current_tab)) if dlg.ShowModal() == wx.ID_OK: self.m_notebook.SetPageText(current_tab, dlg.GetValue()) self.m_panel_changed = True self.m_statusBar.SetStatusText('Relay board renamed.') else: self.m_statusBar.SetStatusText('Relay board not renamed.') dlg.Destroy()
Example #14
Source File: _snippet.py From admin4 with Apache License 2.0 | 5 votes |
def OnRenameSnippet(self, evt): snippet=self.GetNode() if snippet: dlg=wx.TextEntryDialog(self, xlt("Name"), xlt("Rename snippet"), snippet.name) if dlg.ShowModal() == wx.ID_OK: snippet.name = dlg.GetValue() self.updateSnippet(snippet) self.SetItemText(snippet.treeitem, self.getSnippetName(snippet)) self.frame.SetStatus(xlt("Snippet renamed."))
Example #15
Source File: _snippet.py From admin4 with Apache License 2.0 | 5 votes |
def OnAddGroup(self, evt): dlg=wx.TextEntryDialog(self, xlt("Group name"), xlt("Add group")) if dlg.ShowModal() == wx.ID_OK: name=dlg.GetValue() if name: self.AppendSnippet(name, parentItem=self.GetRootItem())
Example #16
Source File: Mailbox.py From admin4 with Apache License 2.0 | 5 votes |
def OnExecute(parentWin, node): dlg=wx.TextEntryDialog(parentWin, xlt("New mailbox path"), xlt("Move mailbox %s") % node.mailboxPath) dlg.SetValue(node.mailboxPath) if dlg.ShowModal() == wx.ID_OK: newPath=dlg.GetValue() rc=node.GetConnection().RenameMailbox(node.mailboxPath, newPath) if rc: node.parentNode.Refresh() return False
Example #17
Source File: frame_parser.py From iqiyi-parser with MIT License | 5 votes |
def __init__(self, counter): wx.PyEvent.__init__(self) self.SetEventType(ID_BUTTON_PARSE_EVENT) self.counter = counter # app = wx.App() # frame_main = FrameParser(None) # wx.TextEntryDialog(frame_main, 'a', 'as').ShowModal() # frame_main.Show() # app.MainLoop()
Example #18
Source File: Beremiz_service.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, message, caption=_("Please enter text"), defaultValue="", style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition): wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) self.Tests = [] self.Bind(wx.EVT_BUTTON, self.OnOK, id=self.GetAffirmativeId())
Example #19
Source File: PouNameDialog.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, message, caption=_("Please enter text"), defaultValue="", style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition): wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) self.PouNames = [] self.Bind(wx.EVT_BUTTON, self.OnOK, self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton())
Example #20
Source File: SFCStepNameDialog.py From OpenPLC_Editor with GNU General Public License v3.0 | 5 votes |
def __init__(self, parent, message, caption=_("Please enter text"), defaultValue="", style=wx.OK | wx.CANCEL | wx.CENTRE, pos=wx.DefaultPosition): wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) self.PouNames = [] self.Variables = [] self.StepNames = [] self.Bind(wx.EVT_BUTTON, self.OnOK, self.GetSizer().GetItem(2).GetSizer().GetItem(1).GetSizer().GetAffirmativeButton())
Example #21
Source File: twitter.py From IkaLog with Apache License 2.0 | 5 votes |
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)
Example #22
Source File: wxTableExtract.py From PyMuPDF-Utilities with GNU General Public License v3.0 | 5 votes |
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 FileSelect dialog to choose a file #============================================================================== # Wildcard: offer all supported filetypes
Example #23
Source File: subindextable.py From CANFestivino with GNU Lesser General Public License v2.1 | 5 votes |
def OnRenameIndexMenu(self, event): if self.Editable: selected = self.IndexList.GetSelection() if selected != wx.NOT_FOUND: index = self.ListIndex[selected] if self.Manager.IsCurrentEntry(index): infos = self.Manager.GetEntryInfos(index) dialog = wx.TextEntryDialog(self, _("Give a new name for index 0x%04X")%index, _("Rename an index"), infos["name"], wx.OK|wx.CANCEL) if dialog.ShowModal() == wx.ID_OK: self.Manager.SetCurrentEntryName(index, dialog.GetValue()) self.ParentWindow.RefreshBufferState() self.RefreshIndexList() dialog.Destroy()
Example #24
Source File: terminalFrontEnd.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def makePopUpDate(self, prompt, title): pp = wx.TextEntryDialog(self, prompt, title) pp.ShowModal() r = pp.GetValue() pp.Destroy() pp.Show() return r
Example #25
Source File: terminalFrontEnd.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def makePopUp(self, prompt, title): pp = wx.TextEntryDialog(self, prompt, title) pp.ShowModal() r = pp.GetValue() pp.Destroy() pp.Show() return r
Example #26
Source File: terminalFrontEnd.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def makePopUpDate(self, prompt, title): pp = wx.TextEntryDialog(self, prompt, title) pp.ShowModal() r = pp.GetValue() pp.Destroy() pp.Show() return r
Example #27
Source File: terminalFrontEnd.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def makePopUp(self, prompt, title): pp = wx.TextEntryDialog(self, prompt, title) pp.ShowModal() r = pp.GetValue() pp.Destroy() pp.Show() return r
Example #28
Source File: backupTerminalFrontEnd.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def makePopUpDate(self, prompt, title): pp = wx.TextEntryDialog(self, prompt, title) pp.ShowModal() r = pp.GetValue() pp.Destroy() pp.Show() return r
Example #29
Source File: backupTerminalFrontEnd.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def makePopUp(self, prompt, title): pp = wx.TextEntryDialog(self, prompt, title) pp.ShowModal() r = pp.GetValue() pp.Destroy() pp.Show() return r
Example #30
Source File: convertQuotation.py From HH---POS-Accounting-and-ERP-Software with MIT License | 5 votes |
def makePopUp(self, prompt, title): pp = wx.TextEntryDialog(self, prompt, title) pp.ShowModal() r = pp.GetValue() pp.Destroy() pp.Show() return r