New ErrorDialogs from Chris Fama

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2001-11-13 03:09:28 +00:00
parent 5b119149c0
commit 5e217089d4
6 changed files with 831 additions and 389 deletions

View File

@ -6,44 +6,69 @@
from wxPython.wx import *
from wxPython.lib.ErrorDialogs import *
_debug = 0
ID_BUTTON_wxPyFatalErrorDialog = 10001
ID_BUTTON_wxPyNonFatalErrorDialog = 10002
ID_BUTTON_wxPyFatalErrorDialogWithTraceback = 10003
ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback = 10004
ID_TEXT = 10000
ID_BUTTON_wxPyNonFatalError = 10001
ID_BUTTON_wxPyFatalError = 10002
ID_BUTTON_wxPyFatalErrorDialog = 10003
ID_BUTTON_wxPyNonFatalErrorDialog = 10004
ID_BUTTON_wxPyFatalErrorDialogWithTraceback = 10005
ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback = 10006
def ErrorDialogsDemoPanelFunc( parent, call_fit = true, set_sizer = true ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxStaticText( parent, -1, "Please select one of the buttons below...", wxDefaultPosition, wxDefaultSize, 0 )
item1 = wxStaticText( parent, ID_TEXT, "Please select one of the buttons below for an example using explicit errors...", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item1, 0, wxALIGN_CENTRE|wxALL, 5 )
item2 = wxFlexGridSizer( 0, 2, 0, 0 )
item6 = wxButton( parent, ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback, "wxPyNonFatalErrorDialogWithTraceback", wxDefaultPosition, wxDefaultSize, 0 )
item6.SetDefault()
item2.AddWindow( item6, 0, wxALIGN_CENTRE|wxALL, 5 )
item3 = wxButton( parent, ID_BUTTON_wxPyFatalErrorDialog, "wxPyFatalErrorDialog", wxDefaultPosition, wxDefaultSize, 0 )
item3 = wxButton( parent, ID_BUTTON_wxPyNonFatalError, "wxPyNonFatalError", wxDefaultPosition, wxDefaultSize, 0 )
item2.AddWindow( item3, 0, wxALIGN_CENTRE|wxALL, 5 )
item4 = wxButton( parent, ID_BUTTON_wxPyNonFatalErrorDialog, "wxPyNonFatalErrorDialog", wxDefaultPosition, wxDefaultSize, 0 )
item4 = wxButton( parent, ID_BUTTON_wxPyFatalError, "wxPyFatalError", wxDefaultPosition, wxDefaultSize, 0 )
item2.AddWindow( item4, 0, wxALIGN_CENTRE|wxALL, 5 )
item5 = wxButton( parent, ID_BUTTON_wxPyFatalErrorDialogWithTraceback, "wxPyFatalErrorDialogWithTraceback", wxDefaultPosition, wxDefaultSize, 0 )
item2.AddWindow( item5, 0, wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item2, 0, wxALIGN_CENTRE|wxALL, 5 )
item5 = wxStaticText( parent, ID_TEXT, "Please select one of the buttons below for interpreter errors...", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item5, 0, wxALIGN_CENTRE|wxALL, 5 )
item6 = wxFlexGridSizer( 0, 2, 0, 0 )
item7 = wxButton( parent, ID_BUTTON_wxPyFatalErrorDialog, "wxPyFatalErrorDialog", wxDefaultPosition, wxDefaultSize, 0 )
item6.AddWindow( item7, 0, wxALIGN_CENTRE|wxALL, 5 )
item8 = wxButton( parent, ID_BUTTON_wxPyNonFatalErrorDialog, "wxPyNonFatalErrorDialog", wxDefaultPosition, wxDefaultSize, 0 )
item6.AddWindow( item8, 0, wxALIGN_CENTRE|wxALL, 5 )
item9 = wxButton( parent, ID_BUTTON_wxPyFatalErrorDialogWithTraceback, "wxPyFatalErrorDialogWithTraceback", wxDefaultPosition, wxDefaultSize, 0 )
item6.AddWindow( item9, 0, wxALIGN_CENTRE|wxALL, 5 )
item10 = wxButton( parent, ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback, "wxPyNonFatalErrorDialogWithTraceback", wxDefaultPosition, wxDefaultSize, 0 )
item10.SetDefault()
item6.AddWindow( item10, 0, wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item6, 0, wxALIGN_CENTRE|wxALL, 5 )
item11 = wxFlexGridSizer( 0, 2, 0, 0 )
item0.AddSizer( item11, 0, wxALIGN_CENTRE|wxALL, 5 )
if set_sizer == true:
parent.SetAutoLayout( true )
parent.SetSizer( item0 )
if call_fit == true:
item0.Fit( parent )
item0.SetSizeHints( parent )
return item0
# End of generated bit
# Menu bar functions
# Bitmap functions
# End of generated file
class MyPanel(wxPanel):
def __init__(self,parent=None):
@ -65,6 +90,12 @@ class MyPanel(wxPanel):
EVT_BUTTON(self,
ID_BUTTON_wxPyFatalErrorDialog,
self.DoDialog)
EVT_BUTTON(self,
ID_BUTTON_wxPyNonFatalError,
self.DoDialog)
EVT_BUTTON(self,
ID_BUTTON_wxPyFatalError,
self.DoDialog)
EVT_BUTTON(self,
ID_BUTTON_wxPyFatalErrorDialogWithTraceback,
self.DoDialog)
@ -75,7 +106,7 @@ class MyPanel(wxPanel):
ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback,
self.DoDialog)
EVT_CLOSE(self,self.OnClose)
IndexFromID = {
ID_BUTTON_wxPyFatalErrorDialog: 3,
ID_BUTTON_wxPyFatalErrorDialogWithTraceback: 2,
@ -84,9 +115,28 @@ class MyPanel(wxPanel):
}
def DoDialog(self,event):
sys.stderr = self.dialogs[self.IndexFromID[event.GetId()]]
print "%s.DoDialog(): testing %s..." % (self,sys.stderr)
this_will_generate_a_NameError_exception
id = event.GetId()
if id in [ID_BUTTON_wxPyFatalError,ID_BUTTON_wxPyNonFatalError]:
if id == ID_BUTTON_wxPyFatalError:
print "%s.DoDialog(): testing explicit wxPyFatalError..."\
% self
wxPyFatalError(self,"Test Non-fatal error.<p>"
"Nearly arbitrary HTML (i.e., that which is"
" understood by <B><I>wxHtmlWindow</i></b>)."
"<p><table border=\"2\"><tr><td>This</td><td>is</td></tr>"
"<tr><td>a</td><td>table</td></tr></table></p>")
else:
print "%s.DoDialog(): testing explicit wxPyNonFatalError..."\
% self
wxPyNonFatalError(self,"Test Non-fatal error.<p>"
"Nearly arbitrary HTML (i.e., that which is"
" understood by <B><I>wxHtmlWindow</i></b>)."
"<p><table border=\"2\"><tr><td>This</td><td>is</td></tr>"
"<tr><td>a</td><td>table</td></tr></table></p>")
else:
sys.stderr = self.dialogs[self.IndexFromID[id]]
print "%s.DoDialog(): testing %s..." % (self,sys.stderr)
this_will_generate_a_NameError_exception
def OnClose(self,evt):
for d in self.dialogs:

View File

@ -0,0 +1,49 @@
"""
sorry no documentation...
Christopher J. Fama
"""
from wxPython.wx import *
from wxPython.html import *
class wxPyClickableHtmlWindow(wxHtmlWindow):
"""
Class for a wxHtmlWindow which responds to clicks on links by opening a
browser pointed at that link, and to shift-clicks by copying the link
to the clipboard.
"""
def __init__(self,parent,ID,**kw):
apply(wxHtmlWindow.__init__,(self,parent,ID),kw)
def OnLinkClicked(self,link):
self.link = wxTextDataObject(link.GetHref())
if link.GetEvent().ShiftDown():
if wxTheClipboard.Open():
wxTheClipboard.SetData(self.link)
wxTheClipboard.Close()
else:
dlg = wxMessageDialog(self,"Couldn't open clipboard!\n",wxOK)
wxBell()
dlg.ShowModal()
dlg.Destroy()
else:
if 0: # Chris's original code...
if sys.platform not in ["windows",'nt'] :
#TODO: A MORE APPROPRIATE COMMAND LINE FOR Linux
#[or rather, non-Windows platforms... as of writing,
#this MEANS Linux, until wxPython for wxMac comes along...]
command = "/usr/bin/netscape"
else:
command = "start"
command = "%s \"%s\"" % (command,
self.link.GetText ())
os.system (command)
else: # My alternative
import webbrowser
webbrowser.open(link.GetHref())

View File

@ -24,7 +24,7 @@ the sys.excepthook variable has been available, for ease and potential
backwards compatibility (or to be more realistic
backwards-PARTIAL-compatibility!), the code catches errors by
assigning a custom object to sys.stderr and monitoring calls to it's
write() method. Such calls which take place with a new value of
writ) method. Such calls which take place with a new value of
sys.last_traceback stand as evidence that at interpreter error has
just occurred; please note that this means that NO OTHER OUTPUT TO
sys.stderr WILL BE DISPLAYED. THIS INCLUDES "warnings" generated by
@ -58,12 +58,10 @@ for unhandled errors, or
returnval = wxpyNonFatalError (<frame (can be None)>,
<HTML message>
[,<OPTIONS>])
[NOTE: NOT IMPLEMENTED {IN THIS VERSION} YET...]
or
returnval = wxPyFatalError (<HTML message>,
[,<OPTIONS, an extra one of which may be
'frame=' <frame (defaults to None)>>])
[NOTE: NOT IMPLEMENTED {IN THIS VERSION} YET...]
or
wxPybNonWindowingError (message)
@ -146,11 +144,13 @@ FOR INTERNATIONAL [NON-ENGLISH-SPEAKING] USE:
_debug = 0
#_debug = 1 # uncomment to display some information (to stdout)
Version = 1.3
from wxPython.wx import *
import string, sys, traceback, time, rexec, operator, types, tempfile, os
import string, sys, traceback, time, rexec, operator, types, cStringIO, os
#from wxPython.lib.createandsendHTMLmail import *# now inline
import MimeWriter, mimetools, cStringIO, smtplib
#import MimeWriter, mimetools, tempfile, smtplib
import urllib, webbrowser
from ErrorDialogs_wdr import *
@ -168,8 +168,11 @@ from ErrorDialogs_wdr import *
# should be added [immediately] before the text similar to "item13 =
# wxStaticBoxSizer( item14, wxVERTICAL )", this sizer being the one
# containing the wxTextCtrl... [IMPORTANT NOTE: THIS LINE SHOULD BE
# THE ONE INSTANTIATING A wxStaticBoxSizer, *NOT* THE wxStaticBox
# ITSELF...]
# THE ONE INSTANTIATING A wxStat2icBoxSizer, *NOT* THE wxStaticBox
# ITSELF...] As of version 1.2 [November 2001], this also needs to be
# done for the {sizers around the} wxPyClickableHtmlWindow's generated in
# populate_wxPyNonFatalError and populate_wxPyFatalError--note that
# for ease this sizer is still called "sizerAroundText"...
def wxPyDestroyErrorDialogIfPresent():
if isinstance(sys.stderr,wxPyNonFatalErrorDialog):
@ -243,7 +246,7 @@ def wxPyNonWindowingError(msg,#output=None,errors=None,
#f.flush()
fl.close()
if fatal and stderr is sys.__stderr__:
if sys.platform in ["windows",'nt',"win32"]:
if sys.__stderr__ and sys.platform in ["windows",'nt',"win32"]:
sys.__stderr__.write(
"\nYou may have to manually close this window to exit.")
sys.exit()
@ -272,24 +275,25 @@ class wxPythonRExec (rexec.RExec):
class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
this_exception = 0
populate_function = populate_wxNonFatalErrorDialogWithTraceback
populate_function = populate_wxPyNonFatalErrorDialogWithTraceback
no_continue_button = false
fatal = false
modal = true
exitjustreturns = false # really only for testing!
def __init__(self, parent, id,
pos = wxPyDefaultPosition, size = wxPyDefaultSize,
style = wxDEFAULT_DIALOG_STYLE,
programname = "Python program",
version = "?",
mailto = None,
whendismissed = "",
disable_exit_button = false):
if _debug:
sys.stdout.write('\nwxPyNonFatalErrorWindow.__init__: '
'STARTING...\n\n')
pos=wxPyDefaultPosition,
size=wxPyDefaultSize,
style=wxDEFAULT_DIALOG_STYLE,
programname="Python program",
version="?",
mailto=None,
whendismissed="",
extraversioninformation="",
caption="Python error!",
versionname=None,
errorname=None,
disable_exit_button=false):
if self.fatal:
whetherNF = ""
@ -309,6 +313,15 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
self.SetProgramName(programname)
self.SetVersion(version)
if errorname:
self.FindWindowById(wxPyError_ID_TEXT1).SetLabel(str(errorname))
if versionname:
self.FindWindowById(wxPyError_ID_TEXT2).SetLabel(str(versionname))
self.FindWindowById(wxPyError_ID_VERSIONNUMBER).SetLabel(str(version))
self.FindWindowById(wxPyError_ID_EXTRA_VERSION_INFORMATION).SetLabel(str(
extraversioninformation))
if caption:
self.SetTitle(caption)
if not self.no_continue_button:
EVT_BUTTON(self, wxPyError_ID_CONTINUE, self.OnContinue)
@ -320,15 +333,12 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
EVT_BUTTON(self, wxPyError_ID_MAIL, self.OnMail)
else:
self.GetMailButton().Enable(false)
# disable the entry box for an e-mail address by default (NOT PROPERLY DOCUMENTED)
if not hasattr(self,"enable_mail_address_box"):
self.FindWindowById(wxPyError_ID_ADDRESS).Enable(false)
if not disable_exit_button:
EVT_BUTTON(self, wxPyError_ID_EXIT, self.OnExit)
self.nonwindowingerror = wxPyNonWindowingErrorHandler(file=sys.__stderr__,
fatal=0)
if _debug:
sys.stdout.write('\nwxPyNonFatalErrorWindow.__init__: '
'DONE.\n\n')
def GetExtraInformation(self):
return self.extraexceptioninformation
@ -393,7 +403,7 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
pw,ph,d,e = t = c.GetFullTextExtent(v)
if _debug:
print v, t
h = h + ph + e# + d# + e
h = h + ph + e# + d
pw = pw + wxSystemSettings_GetSystemMetric(wxSYS_VSCROLL_X)
if pw > w:
w = pw
@ -457,9 +467,9 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
def write(self,s):
if self.this_exception is not sys.last_traceback:
if not wxThread_IsMain():
# Aquire the GUI mutex before making GUI calls. Mutex is released
# when locker is deleted at the end of this function.
locker = wxMutexGuiLocker()
# Aquire the GUI mutex before making GUI calls. Mutex is released
# when locker is deleted at the end of this function.
locker = wxMutexGuiLocker()
self.this_exception = sys.last_traceback
# this is meant to be done once per traceback's sys.stderr.write's
@ -469,7 +479,7 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
wxBell()
if _debug:
sys.stdout.write(
if sys.stdout: sys.stdout.write(
'in %s.write(): ' % self)
self.exceptiontype = sys.last_type
@ -488,6 +498,7 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
self.topsizer.Fit(self)
self.topsizer.SetSizeHints(self)
self.CentreOnScreen()
if self.modal:
self.ShowModal()
@ -499,13 +510,11 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
c = cStringIO.StringIO()
c.write("[Exception occurred before data from "
"sys.last_traceback available]")
## c2 = cStringIO.StringIO()
## traceback.print_exception(None,c2)
wxPyNonWindowingError("Warning: "
"a %s error was encountered trying to "
"handle the exception\n%s\nThis was:"#%s\n"
% (sys.exc_type, c.getvalue()),#, c2.getvalue()),
stderr=sys.__stderr__,
stderr=sys.stdout,
last=0)
@ -517,13 +526,13 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
parent = self.parent # so whendismissed can refer to "parent"
if 1:
if _debug:
sys.stdout.write("exec '''%s''': "
if sys.stdout: sys.stdout.write("exec '''%s''': "
% (self.whendismissed))
exec self.whendismissed
if _debug: print "\n",
else:
if _debug:
sys.stdout.write("wxPythonRExec(%s).r_exec('''%s'''): "
if sys.stdout: sys.stdout.write("wxPythonRExec(%s).r_exec('''%s'''): "
% (self.securityhole,
self.whendismissed))
wxPythonRExec(self.securityhole).r_exec(self.whendismissed)
@ -548,13 +557,32 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
"a %s(%s) error was encountered trying to "
"handle the exception)\n\n"
% tuple(sys.exc_info()[:2]),
stderr=sys.__stderr__,
stderr=sys.stdout,
last=0)
MessageTemplate = "<head>"\
"</head>"\
'<body text="#000000" bgcolor="#FFFFFF">'\
"<p>"\
PlainMessageTemplate = \
"Hello,\n\n"\
'%(programname)s'\
" error.\n\n"\
"I encountered the following error when running your "\
'program %(programname)s,'\
"at %(date)s.\n\n"\
"(The following has been automatically generated...)\n"\
'%(traceback)s\n\n'\
"More information follows:\n\n"\
'[Insert more '\
"information about the error here, such as what you were "\
"trying to do at the time of the error. Please "\
"understand that failure to fill in this field will be "\
"interpreted as an invitation to consign this e-mail "\
"straight to the trash can!]\n\n"\
'Yours sincerely,\n'\
"[insert your name here]\n"
HTMLMessageTemplate = \
'<html>\n'\
'<body>'\
"<p>\n"\
"<i><b>Hello,</b></i>\n<p>\n"\
'<p><h2><font color="#CC6C00">%(programname)s</font>'\
" error.</h2>\n"\
@ -576,8 +604,10 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
'<i><b>Yours sincerely,</b></i>\n<p>'\
'<font color="#CC6C00">'\
"[insert your name here]\n"\
"</font>"\
"</body>"
"</font>\n"\
"</body>\n"\
"</html>\n"
# text="#000000" bgcolor="#FFFFFF">\n'\
def OnMail(self,event):
try:
@ -590,25 +620,24 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
programname = self.programname
traceback = self.traceback
mailto = self.mailto
message = self.MessageTemplate % vars()
subject = "Un-caught exception when running %s." % programname
if _debug:
print 'message:',message
print 'subject:,',subject
print 'sent to:',mailto
mailfrom = self.FindWindowById (wxPyError_ID_ADDRESS)
mailfrom = None#self.FindWindowById (wxPyError_ID_ADDRESS)
if mailfrom:
mailfrom = mailfrom.GetValue()
if _startmailerwithhtml(mailto,subject,message,text="",mailfrom=mailfrom):
if _startmailerwithhtml(mailto,subject,
self.HTMLMessageTemplate % vars(),
text=self.PlainMessageTemplate % vars(),
mailfrom=mailfrom):
if not (hasattr(self,"fatal") and self.fatal):
self.OnContinue(event) # if ok, then act as if "Continue" selected
except:
wxPyNonWindowingError("Warning: the following exception information"
wxPyNonWindowingError("Warning: the following exception information"
" may not be the full story... (because "
"a %s error was encountered trying to "
"handle the original exception)\n\n"#%s"
% (sys.exc_type,),#self.msg),
stderr=sys.__stderr__,
stderr=sys.stdout,
last=0)
def OnExit(self, event):
@ -618,46 +647,52 @@ class wxPyNonFatalErrorDialogWithTraceback(wxDialog):
return
wxGetApp().ExitMainLoop()
## if isinstance(sys.stderr,wxPyNonFatalErrorDialogWithTraceback):
## if sys.stderr == self:
## selfdestroyed = 1
## sys.stderr.Destroy()
## sys.stderr = wxPyNonWindowingErrorHandler(sys.__stderr__)
## wxSafeYield() # so remaining events are processed...
## if self.parent not in [None,NULL]:
## self.parent.Destroy()
## elif "selfdestroyed" not in locals().keys():
## self.Destroy()
def SetText(self,number,string):
self.FindWindowById(eval("wxPyError_ID_TEXT%d"
% number)).SetLabel(string)
self.topsizer.Layout()
class wxPyFatalErrorDialogWithTraceback(wxPyNonFatalErrorDialogWithTraceback):
populate_function = populate_wxFatalErrorDialogWithTraceback
populate_function = populate_wxPyFatalErrorDialogWithTraceback
no_continue_button = true
fatal = true
class wxPyNonFatalErrorDialog(wxPyNonFatalErrorDialogWithTraceback):
populate_function = populate_wxNonFatalErrorDialog
populate_function = populate_wxPyNonFatalErrorDialog
class wxPyFatalErrorDialog(wxPyFatalErrorDialogWithTraceback):
populate_function = populate_wxFatalErrorDialog
populate_function = populate_wxPyFatalErrorDialog
def _startmailerwithhtml(mailto,subject,html,text=None,mailfrom=None):
if sys.hexversion >= 0x02000000:#\
# and sys.platform in ["windows",'nt',"w is in32"]:
s = 'mailto:%s?subject=%s&body=%s' % (mailto,
urllib.quote(subject),
urllib.quote(
string.replace(text,'\n','\r\n'),
""))
def _startmailerwithhtml(mailto,subject,html,text,mailfrom=None):
if sys.platform in ["windows",'nt',"win32"] and sys.hexversion >= 0x02000000:
name = tempfile.mktemp(".eml")
f = open(name,"w")
f.write(_createhtmlmail(html,text,subject,to=mailto,
mailfrom=mailfrom))
f.close()
try:
os.startfile(name)
except WindowsError:
# probably no association with eml files
return _writehtmlmessage(mailto,subject,html,text,mailfrom=mailfrom)
# Note that RFC 2368 requires that line breaks in the body of
# a message contained in a mailto URL MUST be encoded with
# "%0D%0A"--even on Unix/Linux. Also note that there appears
# to be no way to specify that the body of a mailto tag be
# interpreted as HTML (mailto tags shouldn't stuff around with
# the MIME-Version/Content-Type headers, the RFC says, so I
# can't even be bothered trying, as the Python
# webbrowser/urllib modules quite likely won't allow
# this... anyway, a plain text message is [at least!] fine...).
if _debug:
t = urllib.quote(text)
if len(t) > 20 * 80:
t = t[0:20 * 80] + "..."
print "\nSummarizing (only shortened version of argument "\
"printed here), ",
print 'webbrowser.open("' \
'mailto:%s?subject=%s&body=%s"' % (mailto,
urllib.quote(subject),
t)
webbrowser.open(s)
return 1
else:
return _writehtmlmessage(mailto,subject,html,text,mailfrom=mailfrom)
@ -679,14 +714,14 @@ def _writehtmlmessage(mailto,subject,html,text=None,parent=None,mailfrom=None):
else:
return 0
# PLEASE NOTE THAT THE CODE BELOW FOR STARTING MAILER WITH A GIVEN
# PLEASE NOTE THAT THE CODE BELOW FOR WRITING A GIVEN
#(HTML) MESSAGE IS BY ART GILLESPIE [with slight modifications by yours truly].
def _createhtmlmail (html, text, subject, to=None, mailfrom=None):
"""Create a mime-message that will render HTML in popular
MUAs, text in better ones (if indeed text is not untrue (e.g. None)
"""
# imported above #import MimeWriter, mimetools, cStringIO
import MimeWriter, mimetools, cStringIO
out = cStringIO.StringIO() # output buffer for our message
htmlin = cStringIO.StringIO(html)
@ -741,7 +776,104 @@ def _createhtmlmail (html, text, subject, to=None, mailfrom=None):
def _sendmail(mailto,subject,html,text):# currently unused
"""For illustration only--this function is not actually used."""
import smtplib
message = _createhtmlmail(html, text, subject)
server = smtplib.SMTP("localhost")
server.sendmail(mailto, subject, message)
server.quit()
def wxPyFatalError(parent,msg,**kw):
return wxPyFatalOrNonFatalError(parent,msg,fatal=1,**kw)
def wxPyNonFatalError(parent,msg,**kw):
return wxPyFatalOrNonFatalError(parent,msg,fatal=0,**kw)
def wxPyResizeHTMLWindowToDispelScrollbar(window,
fraction,
sizer=None,
defaultfraction=0.7):
# Try to `grow' parent window (typically a dialog), only so far as
# no scrollbar is necessary, mantaining aspect ratio of display.
# Will go no further than specified fraction of display size.
w = 200
if type(fraction) == type(''):
fraction = string.atoi(fraction[:-1]) / 100.
ds = wxDisplaySize ()
c = window.GetInternalRepresentation ()
while w < ds[0] * fraction:
c.Layout(w)
if _debug:
print '(c.GetHeight() + 20, w * ds[1]/ds[0]):',\
(c.GetHeight() + 20, w * ds[1]/ds[0])
if c.GetHeight() + 20 < w * ds[1]/ds[0]:
size = (w,min(int ((w) * ds[1]/ds[0]),
c.GetHeight()))
break
w = w + 20
else:
if type(defaultfraction) == type(''):
defaultfraction = string.atoi(defaultfraction[:-1]) / 100.
defaultsize = (defaultfraction * ds[0], defaultfraction * ds[1])
if _debug:
print 'defaultsize =',defaultsize
size = defaultsize
window.SetSize(size)
if sizer is not None:
sizer.SetMinSize(size)
sizer.Fit(window)
#sizer.SetSizeHints(window)
def wxPyFatalOrNonFatalError(parent,
msg,
fatal=0,
extraversioninformation="",
caption=None,
versionname=None,
errorname=None,
version="?",
programname="Python program",
tback=None,# backwards compatibility, and for
#possible future inclusion of ability to display
#a traceback along with the given message
#"msg"... currently ignored though...
modal=0):
if not wxThread_IsMain():
# Aquire the GUI mutex before making GUI calls. Mutex is released
# when locker is deleted at the end of this function.
locker = wxMutexGuiLocker()
dlg = wxDialog(parent,-1,"Error!")
if fatal:
populate_function = populate_wxPyFatalError
else:
populate_function = populate_wxPyNonFatalError
sizer = populate_function(dlg,false,true)
window = dlg.FindWindowById(wxPyError_ID_HTML)
window.SetPage(msg)
wxPyResizeHTMLWindowToDispelScrollbar(window,
"85%",
sizer=dlg.sizerAroundText)
dlg.FindWindowById(wxPyError_ID_PROGRAMNAME).SetLabel(str(programname))
if errorname:
dlg.FindWindowById(wxPyError_ID_TEXT1).SetLabel(str(errorname))
if versionname:
dlg.FindWindowById(wxPyError_ID_TEXT2).SetLabel(str(versionname))
dlg.FindWindowById(wxPyError_ID_VERSIONNUMBER).SetLabel(str(version))
dlg.FindWindowById(wxPyError_ID_EXTRA_VERSION_INFORMATION).SetLabel(str(
extraversioninformation))
if caption:
dlg.SetTitle(caption)
sizer.Fit(dlg)
sizer.SetSizeHints(dlg)
dlg.CentreOnScreen()
if modal:
v = dlg.ShowModal()
dlg.Destroy()
return v
else:
dlg.Show(true)

View File

@ -8,6 +8,8 @@ from wxPython.wx import *
# Custom source
from wxPython.lib.PythonBitmaps import *
from wxPython.html import *
from wxPython.lib.ClickableHtmlWindow import *
# Window functions
@ -15,25 +17,26 @@ wxPyError_ID_TEXT1 = 10000
wxPyError_ID_PROGRAMNAME = 10001
wxPyError_ID_TEXT2 = 10002
wxPyError_ID_VERSIONNUMBER = 10003
wxPyError_ID_STATICBITMAP1 = 10004
wxPyError_ID_STATICBITMAP2 = 10005
wxPyError_ID_TEXT3 = 10006
wxPyError_ID_TEXT4 = 10007
wxPyError_ID_TEXTCTRL = 10008
wxPyError_ID_TEXT5 = 10009
wxPyError_ID_CONTINUE = 10010
wxPyError_ID_MAIL = 10011
wxPyError_ID_TEXT6 = 10012
wxPyError_ID_ADDRESS = 10013
wxPyError_ID_EXIT = 10014
wxPyError_ID_TEXT7 = 10015
wxPyError_ID_TEXT8 = 10016
wxPyError_ID_TEXT9 = 10017
wxPyError_ID_TEXT10 = 10018
wxPyError_ID_TEXT11 = 10019
wxPyError_ID_TEXT12 = 10020
wxPyError_ID_EXTRA_VERSION_INFORMATION = 10004
wxPyError_ID_STATICBITMAP1 = 10005
wxPyError_ID_STATICBITMAP2 = 10006
wxPyError_ID_TEXT3 = 10007
wxPyError_ID_TEXT4 = 10008
wxPyError_ID_TEXTCTRL = 10009
wxPyError_ID_TEXT5 = 10010
wxPyError_ID_CONTINUE = 10011
wxPyError_ID_MAIL = 10012
wxPyError_ID_TEXT6 = 10013
wxPyError_ID_ADDRESS = 10014
wxPyError_ID_EXIT = 10015
wxPyError_ID_TEXT7 = 10016
wxPyError_ID_TEXT8 = 10017
wxPyError_ID_TEXT9 = 10018
wxPyError_ID_TEXT10 = 10019
wxPyError_ID_TEXT11 = 10020
wxPyError_ID_TEXT12 = 10021
def populate_wxNonFatalErrorDialogWithTraceback( parent, call_fit = true, set_sizer = true ):
def populate_wxPyNonFatalErrorDialogWithTraceback( parent, call_fit = true, set_sizer = true ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxBoxSizer( wxHORIZONTAL )
@ -50,7 +53,7 @@ def populate_wxNonFatalErrorDialogWithTraceback( parent, call_fit = true, set_si
item5.SetFont( wxFont( 21, wxSCRIPT, wxNORMAL, wxBOLD ) )
item4.AddWindow( item5, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item6 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "name", wxDefaultPosition, wxDefaultSize, 0 )
item6 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "wxPyError_ID_PROGRAMNAME", wxDefaultPosition, wxDefaultSize, 0 )
item6.SetFont( wxFont( 21, wxROMAN, wxITALIC, wxNORMAL ) )
item4.AddWindow( item6, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
@ -62,99 +65,103 @@ def populate_wxNonFatalErrorDialogWithTraceback( parent, call_fit = true, set_si
item8.SetFont( wxFont( 9, wxROMAN, wxNORMAL, wxNORMAL ) )
item7.AddWindow( item8, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item9 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "?.?", wxDefaultPosition, wxDefaultSize, 0 )
item9 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "wxPyError_ID_VERSIONNUMBER", wxDefaultPosition, wxDefaultSize, 0 )
item9.SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) )
item7.AddWindow( item9, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item7, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticText( parent, wxPyError_ID_EXTRA_VERSION_INFORMATION, "wxPyError_ID_EXTRA_VERSION_INFORMATION", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item10.SetFont( wxFont( 7, wxROMAN, wxITALIC, wxNORMAL ) )
item2.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item1.AddSizer( item2, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item11, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item12 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item1, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item12 = wxStaticText( parent, wxPyError_ID_TEXT3, "The Python interpreter has encountered a so-called \"un-caught exception\".", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item13 = wxStaticText( parent, wxPyError_ID_TEXT3, "The Python interpreter has encountered a so-called \"un-caught exception\".", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item13, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item14 = wxStaticBox( parent, -1, "Traceback" )
item14.SetFont( wxFont( 6, wxSWISS, wxITALIC, wxNORMAL ) )
parent.sizerAroundText = item13 = wxStaticBoxSizer( item14, wxVERTICAL )
item15 = wxStaticBox( parent, -1, "Traceback" )
item15.SetFont( wxFont( 6, wxSWISS, wxITALIC, wxNORMAL ) )
parent.sizerAroundText = item14 = wxStaticBoxSizer( item15, wxVERTICAL )
item15 = wxStaticText( parent, wxPyError_ID_TEXT4,
item16 = wxStaticText( parent, wxPyError_ID_TEXT4,
"Please don't worry if this doesn't mean anything to you.\n"
"It will be included in the \"bug report\" mentioned below.",
wxDefaultPosition, wxDefaultSize, 0 )
item15.SetFont( wxFont( 8, wxROMAN, wxNORMAL, wxNORMAL ) )
item13.AddWindow( item15, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item16.SetFont( wxFont( 8, wxROMAN, wxNORMAL, wxNORMAL ) )
item14.AddWindow( item16, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item16 = wxTextCtrl( parent, wxPyError_ID_TEXTCTRL, "Traceback is to go here", wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_MULTILINE )
item16.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxNORMAL ) )
item16.SetToolTip( wxToolTip("A \"traceback\" reports the nature and location of a Python error.") )
item13.AddWindow( item16, 0, wxALIGN_CENTRE|wxALL, 5 )
item17 = wxTextCtrl( parent, wxPyError_ID_TEXTCTRL, "wxPyError_ID_TEXTCTRL", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY )
item17.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxNORMAL ) )
item17.SetToolTip( wxToolTip("A \"traceback\" reports the nature and location of a Python error.") )
item14.AddWindow( item17, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item0.AddSizer( item13, 1, wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item14, 1, wxALIGN_CENTRE|wxALL, 5 )
item17 = wxStaticText( parent, wxPyError_ID_TEXT5, "Please select one of the options below.", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item17.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item0.AddWindow( item17, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item18 = wxStaticText( parent, wxPyError_ID_TEXT5, "Please select one of the options below.", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item18.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item0.AddWindow( item18, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item18 = wxFlexGridSizer( 3, 0, 0, 6 )
item18.AddGrowableCol( 0 )
item18.AddGrowableCol( 1 )
item18.AddGrowableCol( 2 )
item19 = wxFlexGridSizer( 3, 0, 0, 6 )
item19.AddGrowableCol( 0 )
item19.AddGrowableCol( 1 )
item19.AddGrowableCol( 2 )
item19 = wxButton( parent, wxPyError_ID_CONTINUE, "Continue", wxDefaultPosition, wxDefaultSize, 0 )
item19.SetDefault()
item18.AddWindow( item19, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item20 = wxButton( parent, wxPyError_ID_CONTINUE, "Continue", wxDefaultPosition, wxDefaultSize, 0 )
item20.SetDefault()
item19.AddWindow( item20, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item20 = wxBoxSizer( wxHORIZONTAL )
item21 = wxBoxSizer( wxHORIZONTAL )
item21 = wxButton( parent, wxPyError_ID_MAIL, "E-mail support", wxDefaultPosition, wxDefaultSize, 0 )
item20.AddWindow( item21, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item22 = wxButton( parent, wxPyError_ID_MAIL, "E-mail support", wxDefaultPosition, wxDefaultSize, 0 )
item21.AddWindow( item22, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item22 = wxBoxSizer( wxVERTICAL )
item23 = wxBoxSizer( wxVERTICAL )
item23 = wxStaticText( parent, wxPyError_ID_TEXT6, "Your e-mail address:", wxDefaultPosition, wxDefaultSize, 0 )
item23.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item22.AddWindow( item23, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item24 = wxStaticText( parent, wxPyError_ID_TEXT6, "Your e-mail address:", wxDefaultPosition, wxDefaultSize, 0 )
item24.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item23.AddWindow( item24, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item24 = wxTextCtrl( parent, wxPyError_ID_ADDRESS, "", wxDefaultPosition, wxSize(80,-1), 0 )
item22.AddWindow( item24, 2, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item25 = wxTextCtrl( parent, wxPyError_ID_ADDRESS, "", wxDefaultPosition, wxSize(80,-1), 0 )
item23.AddWindow( item25, 2, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item20.AddSizer( item22, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item21.AddSizer( item23, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item18.AddSizer( item20, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19.AddSizer( item21, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item25 = wxButton( parent, wxPyError_ID_EXIT, "Exit immediately", wxDefaultPosition, wxDefaultSize, 0 )
item18.AddWindow( item25, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item26 = wxButton( parent, wxPyError_ID_EXIT, "Exit immediately", wxDefaultPosition, wxDefaultSize, 0 )
item19.AddWindow( item26, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item26 = wxStaticText( parent, wxPyError_ID_TEXT7, "Attempt to continue.", wxDefaultPosition, wxDefaultSize, 0 )
item18.AddWindow( item26, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item27 = wxStaticText( parent, wxPyError_ID_TEXT7, "Attempt to continue.", wxDefaultPosition, wxDefaultSize, 0 )
item19.AddWindow( item27, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item27 = wxStaticText( parent, wxPyError_ID_TEXT8, "E-mail a \"bug report\" (if this is indeed a bug!).", wxDefaultPosition, wxDefaultSize, 0 )
item18.AddWindow( item27, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item28 = wxStaticText( parent, wxPyError_ID_TEXT8, "E-mail a \"bug report\" (if this is indeed a bug!).", wxDefaultPosition, wxDefaultSize, 0 )
item19.AddWindow( item28, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item28 = wxStaticText( parent, wxPyError_ID_TEXT9, "Attempt to exit immediately.", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item18.AddWindow( item28, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item29 = wxStaticText( parent, wxPyError_ID_TEXT9, "Attempt to exit immediately.", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item19.AddWindow( item29, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item29 = wxStaticText( parent, wxPyError_ID_TEXT10, "", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item29.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item18.AddWindow( item29, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item30 = wxStaticText( parent, wxPyError_ID_TEXT11, "(Please read any accompanying documentation first!)", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item30 = wxStaticText( parent, wxPyError_ID_TEXT10, "", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item30.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item18.AddWindow( item30, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19.AddWindow( item30, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item31 = wxStaticText( parent, wxPyError_ID_TEXT12, "(Please note that no attempt to save unsaved data will be made.)", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item31 = wxStaticText( parent, wxPyError_ID_TEXT11, "(Please read any accompanying documentation first!)", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item31.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item18.AddWindow( item31, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19.AddWindow( item31, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item18, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item32 = wxStaticText( parent, wxPyError_ID_TEXT12, "(Please note that no attempt to save unsaved data will be made.)", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item32.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item19.AddWindow( item32, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item19, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
if set_sizer == true:
parent.SetAutoLayout( true )
@ -165,12 +172,13 @@ def populate_wxNonFatalErrorDialogWithTraceback( parent, call_fit = true, set_si
return item0
wxPyError_ID_EXCEPTIONNAME = 10022
wxPyError_ID_EXTRAINFORMATION = 10023
wxPyError_ID_TEXT13 = 10024
wxPyError_ID_TEXT14 = 10025
wxPyError_wxPyError_ID_TEXT3 = 10022
wxPyError_ID_EXCEPTIONNAME = 10023
wxPyError_ID_EXTRAINFORMATION = 10024
wxPyError_ID_TEXT13 = 10025
wxPyError_ID_TEXT14 = 10026
def populate_wxNonFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
def populate_wxPyNonFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxBoxSizer( wxHORIZONTAL )
@ -189,7 +197,7 @@ def populate_wxNonFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
item6.SetFont( wxFont( 21, wxSCRIPT, wxNORMAL, wxBOLD ) )
item5.AddWindow( item6, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item7 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "name", wxDefaultPosition, wxDefaultSize, 0 )
item7 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "wxPyError_ID_PROGRAMNAME", wxDefaultPosition, wxDefaultSize, 0 )
item7.SetFont( wxFont( 21, wxROMAN, wxITALIC, wxNORMAL ) )
item5.AddWindow( item7, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
@ -197,28 +205,314 @@ def populate_wxNonFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
item8 = wxBoxSizer( wxHORIZONTAL )
item9 = wxStaticText( parent, wxPyError_ID_TEXT2, "Version ", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item9 = wxStaticText( parent, wxPyError_ID_TEXT2, "Version ", wxDefaultPosition, wxDefaultSize, 0 )
item9.SetFont( wxFont( 9, wxROMAN, wxNORMAL, wxNORMAL ) )
item8.AddWindow( item9, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "?.?", wxDefaultPosition, wxDefaultSize, 0 )
item10 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "wxPyError_ID_VERSIONNUMBER", wxDefaultPosition, wxDefaultSize, 0 )
item10.SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) )
item8.AddWindow( item10, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item8.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item3.AddSizer( item8, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item11 = wxStaticText( parent, wxPyError_ID_EXTRA_VERSION_INFORMATION, "wxPyError_ID_EXTRA_VERSION_INFORMATION", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item11.SetFont( wxFont( 7, wxROMAN, wxITALIC, wxNORMAL ) )
item3.AddWindow( item11, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item3, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item2.AddWindow( item11, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item12 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item12 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item2.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item13 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item2.AddWindow( item13, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item1.AddSizer( item2, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item1, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item14 = wxStaticText( parent, wxPyError_wxPyError_ID_TEXT3, "The Python interpreter has encountered a so-called \"un-caught exception\".", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item14, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item16 = wxStaticBox( parent, -1, "Exception information" )
item16.SetFont( wxFont( 6, wxSWISS, wxITALIC, wxNORMAL ) )
item15 = wxStaticBoxSizer( item16, wxVERTICAL )
item17 = wxStaticText( parent, wxPyError_ID_TEXT4,
"Please don't worry if this doesn't mean anything to you.\n"
"It will be included in the \"bug report\" mentioned below, along with a \"stack traceback\".",
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item17.SetFont( wxFont( 8, wxROMAN, wxNORMAL, wxNORMAL ) )
item15.AddWindow( item17, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item18 = wxFlexGridSizer( 2, 0, 1, 1 )
item18.AddGrowableCol( 1 )
item19 = wxStaticText( parent, wxPyError_ID_TEXT5, "Name:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item19.SetFont( wxFont( 10, wxROMAN, wxITALIC, wxNORMAL ) )
item19.SetToolTip( wxToolTip("This gives the type of the error.") )
item18.AddWindow( item19, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item20 = wxStaticText( parent, wxPyError_ID_EXCEPTIONNAME, "wxPyError_ID_EXCEPTIONNAME", wxDefaultPosition, wxDefaultSize, 0 )
item18.AddWindow( item20, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item21 = wxStaticText( parent, wxPyError_ID_TEXT6,
"Extra\n"
"information:",
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item21.SetFont( wxFont( 10, wxROMAN, wxITALIC, wxNORMAL ) )
item18.AddWindow( item21, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item22 = wxStaticText( parent, wxPyError_ID_EXTRAINFORMATION, "wxPyError_ID_EXTRAINFORMATION", wxDefaultPosition, wxDefaultSize, 0 )
item18.AddWindow( item22, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item15.AddSizer( item18, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item0.AddSizer( item15, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 10 )
item23 = wxStaticText( parent, wxPyError_ID_TEXT7, "Please select one of the options below.", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item23.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item0.AddWindow( item23, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item24 = wxFlexGridSizer( 3, 0, 0, 6 )
item24.AddGrowableCol( 0 )
item24.AddGrowableCol( 1 )
item24.AddGrowableCol( 2 )
item25 = wxButton( parent, wxPyError_ID_CONTINUE, "Continue", wxDefaultPosition, wxDefaultSize, 0 )
item25.SetDefault()
item24.AddWindow( item25, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item26 = wxBoxSizer( wxHORIZONTAL )
item27 = wxButton( parent, wxPyError_ID_MAIL, "E-mail support", wxDefaultPosition, wxDefaultSize, 0 )
item26.AddWindow( item27, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item28 = wxBoxSizer( wxVERTICAL )
item29 = wxStaticText( parent, wxPyError_ID_TEXT8, "Your e-mail address:", wxDefaultPosition, wxDefaultSize, 0 )
item29.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item28.AddWindow( item29, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item30 = wxTextCtrl( parent, wxPyError_ID_ADDRESS, "", wxDefaultPosition, wxSize(80,-1), 0 )
item28.AddWindow( item30, 2, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item26.AddSizer( item28, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item24.AddSizer( item26, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item31 = wxButton( parent, wxPyError_ID_EXIT, "Exit immediately", wxDefaultPosition, wxDefaultSize, 0 )
item24.AddWindow( item31, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item32 = wxStaticText( parent, wxPyError_ID_TEXT9, "Attempt to continue.", wxDefaultPosition, wxDefaultSize, 0 )
item24.AddWindow( item32, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item33 = wxStaticText( parent, wxPyError_ID_TEXT10, "E-mail a \"bug report\" (if this is indeed a bug!).", wxDefaultPosition, wxDefaultSize, 0 )
item24.AddWindow( item33, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item34 = wxStaticText( parent, wxPyError_ID_TEXT11, "Attempt to exit immediately.", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item24.AddWindow( item34, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item35 = wxStaticText( parent, wxPyError_ID_TEXT12, "", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item35.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item24.AddWindow( item35, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item36 = wxStaticText( parent, wxPyError_ID_TEXT13, "(Please read any accompanying documentation first!)", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item36.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item24.AddWindow( item36, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item37 = wxStaticText( parent, wxPyError_ID_TEXT14, "(Please note that no attempt to save unsaved data will be made.)", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item37.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item24.AddWindow( item37, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item24, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
if set_sizer == true:
parent.SetAutoLayout( true )
parent.SetSizer( item0 )
if call_fit == true:
item0.Fit( parent )
item0.SetSizeHints( parent )
return item0
def populate_wxPyFatalErrorDialogWithTraceback( parent, call_fit = true, set_sizer = true ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxBoxSizer( wxHORIZONTAL )
item3 = wxStaticBox( parent, -1, "Fatal" )
item3.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxBOLD ) )
item2 = wxStaticBoxSizer( item3, wxVERTICAL )
item4 = wxBoxSizer( wxHORIZONTAL )
item5 = wxStaticText( parent, wxPyError_ID_TEXT1, "Error in ", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item5.SetForegroundColour( wxWHITE )
item5.SetBackgroundColour( wxRED )
item5.SetFont( wxFont( 21, wxSCRIPT, wxNORMAL, wxBOLD ) )
item4.AddWindow( item5, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item6 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "wxPyError_ID_PROGRAMNAME", wxDefaultPosition, wxDefaultSize, 0 )
item6.SetFont( wxFont( 21, wxROMAN, wxITALIC, wxNORMAL ) )
item4.AddWindow( item6, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item4, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item7 = wxBoxSizer( wxHORIZONTAL )
item8 = wxStaticText( parent, wxPyError_ID_TEXT2, "Version ", wxDefaultPosition, wxDefaultSize, 0 )
item8.SetFont( wxFont( 9, wxROMAN, wxNORMAL, wxNORMAL ) )
item7.AddWindow( item8, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item9 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "wxPyError_ID_VERSIONNUMBER", wxDefaultPosition, wxDefaultSize, 0 )
item9.SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) )
item7.AddWindow( item9, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item7, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticText( parent, wxPyError_ID_EXTRA_VERSION_INFORMATION, "wxPyError_ID_EXTRA_VERSION_INFORMATION", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item10.SetFont( wxFont( 7, wxROMAN, wxITALIC, wxNORMAL ) )
item2.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item1.AddSizer( item2, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item11, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item12 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item1, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item13 = wxStaticText( parent, wxPyError_ID_TEXT3, "The Python interpreter has encountered a so-called \"un-caught exception\".", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item13, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item15 = wxStaticBox( parent, -1, "Traceback" )
item15.SetFont( wxFont( 6, wxSWISS, wxITALIC, wxNORMAL ) )
parent.sizerAroundText = item14 = wxStaticBoxSizer( item15, wxVERTICAL )
item16 = wxStaticText( parent, wxPyError_ID_TEXT4,
"Please don't worry if this doesn't mean anything to you.\n"
"It will be included in the \"bug report\" mentioned below.",
wxDefaultPosition, wxDefaultSize, 0 )
item16.SetFont( wxFont( 8, wxROMAN, wxNORMAL, wxNORMAL ) )
item14.AddWindow( item16, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item17 = wxTextCtrl( parent, wxPyError_ID_TEXTCTRL, "wxPyError_ID_TEXTCTRL", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY )
item17.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxNORMAL ) )
item17.SetToolTip( wxToolTip("A \"traceback\" reports the nature and location of a Python error.") )
item14.AddWindow( item17, 0, wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item14, 0, wxALIGN_CENTRE|wxALL, 5 )
item18 = wxStaticText( parent, wxPyError_ID_TEXT5, "Please select one of the options below.", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item18.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item0.AddWindow( item18, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19 = wxFlexGridSizer( 3, 0, 0, 6 )
item19.AddGrowableCol( 0 )
item19.AddGrowableCol( 1 )
item19.AddGrowableCol( 2 )
item20 = wxBoxSizer( wxHORIZONTAL )
item21 = wxButton( parent, wxPyError_ID_MAIL, "E-mail support", wxDefaultPosition, wxDefaultSize, 0 )
item20.AddWindow( item21, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item22 = wxBoxSizer( wxVERTICAL )
item23 = wxStaticText( parent, wxPyError_ID_TEXT6, "Your e-mail address:", wxDefaultPosition, wxDefaultSize, 0 )
item23.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item22.AddWindow( item23, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item24 = wxTextCtrl( parent, wxPyError_ID_ADDRESS, "", wxDefaultPosition, wxSize(80,-1), 0 )
item22.AddWindow( item24, 2, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item20.AddSizer( item22, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19.AddSizer( item20, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item25 = wxButton( parent, wxPyError_ID_EXIT, "Exit immediately", wxDefaultPosition, wxDefaultSize, 0 )
item25.SetDefault()
item19.AddWindow( item25, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item26 = wxStaticText( parent, wxPyError_ID_TEXT7, "E-mail a \"bug report\" (if this is indeed a bug!).", wxDefaultPosition, wxDefaultSize, 0 )
item19.AddWindow( item26, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item27 = wxStaticText( parent, wxPyError_ID_TEXT8, "Attempt to exit immediately.", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item19.AddWindow( item27, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item28 = wxStaticText( parent, wxPyError_ID_TEXT9, "(Please read any accompanying documentation first!)", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item28.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item19.AddWindow( item28, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item29 = wxStaticText( parent, wxPyError_ID_TEXT10, "(Please note that no attempt to save unsaved data will be made.)", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item29.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item19.AddWindow( item29, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item19, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
if set_sizer == true:
parent.SetAutoLayout( true )
parent.SetSizer( item0 )
if call_fit == true:
item0.Fit( parent )
item0.SetSizeHints( parent )
return item0
def populate_wxPyFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxBoxSizer( wxHORIZONTAL )
item3 = wxStaticBox( parent, -1, "Fatal" )
item3.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxBOLD ) )
item2 = wxStaticBoxSizer( item3, wxVERTICAL )
item4 = wxBoxSizer( wxHORIZONTAL )
item5 = wxStaticText( parent, wxPyError_ID_TEXT1, "Error in ", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item5.SetForegroundColour( wxWHITE )
item5.SetBackgroundColour( wxRED )
item5.SetFont( wxFont( 21, wxSCRIPT, wxNORMAL, wxBOLD ) )
item4.AddWindow( item5, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item6 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "wxPyError_ID_PROGRAMNAME", wxDefaultPosition, wxDefaultSize, 0 )
item6.SetFont( wxFont( 21, wxROMAN, wxITALIC, wxNORMAL ) )
item4.AddWindow( item6, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item4, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item7 = wxBoxSizer( wxHORIZONTAL )
item8 = wxStaticText( parent, wxPyError_ID_TEXT2, "Version ", wxDefaultPosition, wxDefaultSize, 0 )
item8.SetFont( wxFont( 9, wxROMAN, wxNORMAL, wxNORMAL ) )
item7.AddWindow( item8, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item9 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "wxPyError_ID_VERSIONNUMBER", wxDefaultPosition, wxDefaultSize, 0 )
item9.SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) )
item7.AddWindow( item9, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item7, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticText( parent, wxPyError_ID_EXTRA_VERSION_INFORMATION, "wxPyError_ID_EXTRA_VERSION_INFORMATION", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item10.SetFont( wxFont( 7, wxROMAN, wxITALIC, wxNORMAL ) )
item2.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item1.AddSizer( item2, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item11, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item12 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item1, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item13 = wxStaticText( parent, wxPyError_ID_TEXT3, "The Python interpreter has encountered a so-called \"un-caught exception\".", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item13, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
@ -241,7 +535,7 @@ def populate_wxNonFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
item18.SetToolTip( wxToolTip("This gives the type of the error.") )
item17.AddWindow( item18, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19 = wxStaticText( parent, wxPyError_ID_EXCEPTIONNAME, "text", wxDefaultPosition, wxDefaultSize, 0 )
item19 = wxStaticText( parent, wxPyError_ID_EXCEPTIONNAME, "wxPyError_ID_EXCEPTIONNAME", wxDefaultPosition, wxDefaultSize, 0 )
item17.AddWindow( item19, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item20 = wxStaticText( parent, wxPyError_ID_TEXT6,
@ -251,12 +545,12 @@ def populate_wxNonFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
item20.SetFont( wxFont( 10, wxROMAN, wxITALIC, wxNORMAL ) )
item17.AddWindow( item20, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item21 = wxStaticText( parent, wxPyError_ID_EXTRAINFORMATION, "text", wxDefaultPosition, wxDefaultSize, 0 )
item21 = wxStaticText( parent, wxPyError_ID_EXTRAINFORMATION, "wxPyError_ID_EXTRAINFORMATION", wxDefaultPosition, wxDefaultSize, 0 )
item17.AddWindow( item21, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item14.AddSizer( item17, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item14.AddSizer( item17, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item0.AddSizer( item14, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 10 )
item0.AddSizer( item14, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 10 )
item22 = wxStaticText( parent, wxPyError_ID_TEXT7, "Please select one of the options below.", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item22.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
@ -267,51 +561,41 @@ def populate_wxNonFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
item23.AddGrowableCol( 1 )
item23.AddGrowableCol( 2 )
item24 = wxButton( parent, wxPyError_ID_CONTINUE, "Continue", wxDefaultPosition, wxDefaultSize, 0 )
item24.SetDefault()
item23.AddWindow( item24, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item24 = wxBoxSizer( wxHORIZONTAL )
item25 = wxBoxSizer( wxHORIZONTAL )
item25 = wxButton( parent, wxPyError_ID_MAIL, "E-mail support", wxDefaultPosition, wxDefaultSize, 0 )
item24.AddWindow( item25, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item26 = wxButton( parent, wxPyError_ID_MAIL, "E-mail support", wxDefaultPosition, wxDefaultSize, 0 )
item25.AddWindow( item26, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item26 = wxBoxSizer( wxVERTICAL )
item27 = wxBoxSizer( wxVERTICAL )
item27 = wxStaticText( parent, wxPyError_ID_TEXT8, "Your e-mail address:", wxDefaultPosition, wxDefaultSize, 0 )
item27.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item26.AddWindow( item27, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item28 = wxStaticText( parent, wxPyError_ID_TEXT8, "Your e-mail address:", wxDefaultPosition, wxDefaultSize, 0 )
item28.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item27.AddWindow( item28, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item28 = wxTextCtrl( parent, wxPyError_ID_ADDRESS, "", wxDefaultPosition, wxSize(80,-1), 0 )
item26.AddWindow( item28, 2, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item29 = wxTextCtrl( parent, wxPyError_ID_ADDRESS, "", wxDefaultPosition, wxSize(80,-1), 0 )
item27.AddWindow( item29, 2, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item24.AddSizer( item26, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item25.AddSizer( item27, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item23.AddSizer( item24, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item23.AddSizer( item25, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item29 = wxButton( parent, wxPyError_ID_EXIT, "Exit immediately", wxDefaultPosition, wxDefaultSize, 0 )
item29.SetDefault()
item23.AddWindow( item29, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item30 = wxButton( parent, wxPyError_ID_EXIT, "Exit immediately", wxDefaultPosition, wxDefaultSize, 0 )
item30 = wxStaticText( parent, wxPyError_ID_TEXT9, "E-mail a \"bug report\" (if this is indeed a bug!).", wxDefaultPosition, wxDefaultSize, 0 )
item23.AddWindow( item30, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item31 = wxStaticText( parent, wxPyError_ID_TEXT9, "Attempt to continue.", wxDefaultPosition, wxDefaultSize, 0 )
item23.AddWindow( item31, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item31 = wxStaticText( parent, wxPyError_ID_TEXT10, "Attempt to exit immediately.", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item23.AddWindow( item31, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item32 = wxStaticText( parent, wxPyError_ID_TEXT10, "E-mail a \"bug report\" (if this is indeed a bug!).", wxDefaultPosition, wxDefaultSize, 0 )
item32 = wxStaticText( parent, wxPyError_ID_TEXT11, "(Please read any accompanying documentation first!)", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item32.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item23.AddWindow( item32, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item33 = wxStaticText( parent, wxPyError_ID_TEXT11, "Attempt to exit immediately.", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item23.AddWindow( item33, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item34 = wxStaticText( parent, wxPyError_ID_TEXT12, "", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item34.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item23.AddWindow( item34, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item35 = wxStaticText( parent, wxPyError_ID_TEXT13, "(Please read any accompanying documentation first!)", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item35.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item23.AddWindow( item35, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item36 = wxStaticText( parent, wxPyError_ID_TEXT14, "(Please note that no attempt to save unsaved data will be made.)", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item36.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item23.AddWindow( item36, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item33 = wxStaticText( parent, wxPyError_ID_TEXT12, "(Please note that no attempt to save unsaved data will be made.)", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item33.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item23.AddWindow( item33, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item23, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
@ -324,13 +608,14 @@ def populate_wxNonFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
return item0
wxPyError_ID_HTML = 10027
def populate_wxFatalErrorDialogWithTraceback( parent, call_fit = true, set_sizer = true ):
def populate_wxPyNonFatalError( parent, call_fit = true, set_sizer = true ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxBoxSizer( wxHORIZONTAL )
item3 = wxStaticBox( parent, -1, "Fatal" )
item3 = wxStaticBox( parent, -1, "Non-fatal" )
item3.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxBOLD ) )
item2 = wxStaticBoxSizer( item3, wxVERTICAL )
@ -342,101 +627,64 @@ def populate_wxFatalErrorDialogWithTraceback( parent, call_fit = true, set_sizer
item5.SetFont( wxFont( 21, wxSCRIPT, wxNORMAL, wxBOLD ) )
item4.AddWindow( item5, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item6 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "Program-name", wxDefaultPosition, wxDefaultSize, 0 )
item6 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "wxPyError_ID_PROGRAMNAME", wxDefaultPosition, wxDefaultSize, 0 )
item6.SetFont( wxFont( 21, wxROMAN, wxITALIC, wxNORMAL ) )
item4.AddWindow( item6, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item4, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item2.AddSizer( item4, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item7 = wxBoxSizer( wxHORIZONTAL )
item8 = wxStaticText( parent, wxPyError_ID_TEXT2, "Version ", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item8 = wxStaticText( parent, wxPyError_ID_TEXT2, "Version ", wxDefaultPosition, wxDefaultSize, 0 )
item8.SetFont( wxFont( 9, wxROMAN, wxNORMAL, wxNORMAL ) )
item7.AddWindow( item8, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item9 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "?.?", wxDefaultPosition, wxDefaultSize, 0 )
item9 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "wxPyError_ID_VERSIONNUMBER", wxDefaultPosition, wxDefaultSize, 0 )
item9.SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) )
item7.AddWindow( item9, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item7.AddWindow( item9, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item7, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item7, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticText( parent, wxPyError_ID_EXTRA_VERSION_INFORMATION, "wxPyError_ID_EXTRA_VERSION_INFORMATION", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item10.SetFont( wxFont( 7, wxROMAN, wxITALIC, wxNORMAL ) )
item2.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item1.AddSizer( item2, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item11, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item1, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item12 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item12 = wxStaticText( parent, wxPyError_ID_TEXT3, "The Python interpreter has encountered a so-called \"un-caught exception\".", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item1, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item14 = wxStaticBox( parent, -1, "Traceback" )
item14.SetFont( wxFont( 6, wxSWISS, wxITALIC, wxNORMAL ) )
parent.sizerAroundText = item13 = wxStaticBoxSizer( item14, wxVERTICAL )
parent.sizerAroundText = item13 = wxBoxSizer( wxVERTICAL )
item15 = wxStaticText( parent, wxPyError_ID_TEXT4,
"Please don't worry if this doesn't mean anything to you.\n"
"It will be included in the \"bug report\" mentioned below.",
wxDefaultPosition, wxDefaultSize, 0 )
item15.SetFont( wxFont( 8, wxROMAN, wxNORMAL, wxNORMAL ) )
item13.AddWindow( item15, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item14 = parent.HTMLWindow = wxPyClickableHtmlWindow( parent, wxPyError_ID_HTML )
item13.AddWindow( item14, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item16 = wxTextCtrl( parent, wxPyError_ID_TEXTCTRL, "Traceback is to go here", wxDefaultPosition, wxDefaultSize, wxTE_READONLY|wxTE_MULTILINE )
item16.SetFont( wxFont( 9, wxSWISS, wxNORMAL, wxNORMAL ) )
item16.SetToolTip( wxToolTip("A \"traceback\" reports the nature and location of a Python error.") )
item13.AddWindow( item16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item0.AddSizer( item13, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item13, 0, wxALIGN_CENTRE|wxALL, 5 )
item15 = wxFlexGridSizer( 3, 0, 0, 6 )
item15.AddGrowableCol( 0 )
item15.AddGrowableCol( 1 )
item15.AddGrowableCol( 2 )
item17 = wxStaticText( parent, wxPyError_ID_TEXT5, "Please select one of the options below.", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item17.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item0.AddWindow( item17, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item16 = wxButton( parent, wxID_OK, "OK", wxDefaultPosition, wxDefaultSize, 0 )
item16.SetDefault()
item15.AddWindow( item16, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item18 = wxFlexGridSizer( 3, 0, 0, 6 )
item18.AddGrowableCol( 0 )
item18.AddGrowableCol( 1 )
item18.AddGrowableCol( 2 )
item17 = wxButton( parent, wxID_CANCEL, "Cancel", wxDefaultPosition, wxDefaultSize, 0 )
item15.AddWindow( item17, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19 = wxBoxSizer( wxHORIZONTAL )
item18 = wxStaticText( parent, wxPyError_ID_TEXT1, "", wxDefaultPosition, wxDefaultSize, 0 )
item15.AddWindow( item18, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item20 = wxButton( parent, wxPyError_ID_MAIL, "E-mail support", wxDefaultPosition, wxDefaultSize, 0 )
item19.AddWindow( item20, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19 = wxStaticText( parent, wxPyError_ID_TEXT2, "", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item15.AddWindow( item19, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item21 = wxBoxSizer( wxVERTICAL )
item22 = wxStaticText( parent, wxPyError_ID_TEXT6, "Your e-mail address:", wxDefaultPosition, wxDefaultSize, 0 )
item22.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item21.AddWindow( item22, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item23 = wxTextCtrl( parent, wxPyError_ID_ADDRESS, "", wxDefaultPosition, wxSize(80,-1), 0 )
item21.AddWindow( item23, 2, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item19.AddSizer( item21, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item18.AddSizer( item19, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item24 = wxButton( parent, wxPyError_ID_EXIT, "Exit immediately", wxDefaultPosition, wxDefaultSize, 0 )
item24.SetDefault()
item18.AddWindow( item24, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item25 = wxStaticText( parent, wxPyError_ID_TEXT7, "E-mail a \"bug report\" (if this is indeed a bug!).", wxDefaultPosition, wxDefaultSize, 0 )
item18.AddWindow( item25, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item26 = wxStaticText( parent, wxPyError_ID_TEXT8, "Attempt to exit immediately.", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item18.AddWindow( item26, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item27 = wxStaticText( parent, wxPyError_ID_TEXT9, "(Please read any accompanying documentation first!)", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item27.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item18.AddWindow( item27, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item28 = wxStaticText( parent, wxPyError_ID_TEXT10, "(Please note that no attempt to save unsaved data will be made.)", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item28.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item18.AddWindow( item28, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item18, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item15, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
if set_sizer == true:
parent.SetAutoLayout( true )
@ -448,7 +696,7 @@ def populate_wxFatalErrorDialogWithTraceback( parent, call_fit = true, set_sizer
return item0
def populate_wxFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
def populate_wxPyFatalError( parent, call_fit = true, set_sizer = true ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxBoxSizer( wxHORIZONTAL )
@ -465,119 +713,56 @@ def populate_wxFatalErrorDialog( parent, call_fit = true, set_sizer = true ):
item5.SetFont( wxFont( 21, wxSCRIPT, wxNORMAL, wxBOLD ) )
item4.AddWindow( item5, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item6 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "Program-name", wxDefaultPosition, wxDefaultSize, 0 )
item6 = wxStaticText( parent, wxPyError_ID_PROGRAMNAME, "wxPyError_ID_PROGRAMNAME", wxDefaultPosition, wxDefaultSize, 0 )
item6.SetFont( wxFont( 21, wxROMAN, wxITALIC, wxNORMAL ) )
item4.AddWindow( item6, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item4, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item4, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item7 = wxBoxSizer( wxHORIZONTAL )
item8 = wxStaticText( parent, wxPyError_ID_TEXT2, "Version ", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item8 = wxStaticText( parent, wxPyError_ID_TEXT2, "Version ", wxDefaultPosition, wxDefaultSize, 0 )
item8.SetFont( wxFont( 9, wxROMAN, wxNORMAL, wxNORMAL ) )
item7.AddWindow( item8, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item9 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "?.?", wxDefaultPosition, wxDefaultSize, 0 )
item9 = wxStaticText( parent, wxPyError_ID_VERSIONNUMBER, "wxPyError_ID_VERSIONNUMBER", wxDefaultPosition, wxDefaultSize, 0 )
item9.SetFont( wxFont( 12, wxROMAN, wxNORMAL, wxBOLD ) )
item7.AddWindow( item9, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item7.AddWindow( item9, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item2.AddSizer( item7, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticText( parent, wxPyError_ID_EXTRA_VERSION_INFORMATION, "wxPyError_ID_EXTRA_VERSION_INFORMATION", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item10.SetFont( wxFont( 7, wxROMAN, wxITALIC, wxNORMAL ) )
item2.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item1.AddSizer( item2, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item10 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item10, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item11 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP1, PythonBitmaps( 0 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item11, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item12 = wxStaticBitmap( parent, wxPyError_ID_STATICBITMAP2, PythonBitmaps( 1 ), wxDefaultPosition, wxDefaultSize )
item1.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item1, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item12 = wxStaticText( parent, wxPyError_ID_TEXT3, "The Python interpreter has encountered a so-called \"un-caught exception\".", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item12, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
parent.sizerAroundText = item13 = wxBoxSizer( wxVERTICAL )
item14 = wxStaticBox( parent, -1, "Exception information" )
item14.SetFont( wxFont( 6, wxSWISS, wxITALIC, wxNORMAL ) )
item13 = wxStaticBoxSizer( item14, wxVERTICAL )
item14 = parent.HTMLWindow = wxPyClickableHtmlWindow( parent, wxPyError_ID_HTML )
item13.AddWindow( item14, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item15 = wxStaticText( parent, wxPyError_ID_TEXT4,
"Please don't worry if this doesn't mean anything to you.\n"
"It will be included in the \"bug report\" mentioned below, along with a \"stack traceback\".",
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item15.SetFont( wxFont( 8, wxROMAN, wxNORMAL, wxNORMAL ) )
item13.AddWindow( item15, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item13, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item16 = wxFlexGridSizer( 2, 0, 1, 1 )
item16.AddGrowableCol( 1 )
item15 = wxFlexGridSizer( 2, 0, 0, 6 )
item15.AddGrowableCol( 0 )
item17 = wxStaticText( parent, wxPyError_ID_TEXT5, "Name:", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item17.SetFont( wxFont( 10, wxROMAN, wxITALIC, wxNORMAL ) )
item17.SetToolTip( wxToolTip("This gives the type of the error.") )
item16.AddWindow( item17, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item16 = wxButton( parent, wxID_OK, "OK", wxDefaultPosition, wxDefaultSize, 0 )
item16.SetDefault()
item15.AddWindow( item16, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item18 = wxStaticText( parent, wxPyError_ID_EXCEPTIONNAME, "text", wxDefaultPosition, wxDefaultSize, 0 )
item16.AddWindow( item18, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item18 = wxStaticText( parent, wxPyError_ID_TEXT3, "", wxDefaultPosition, wxDefaultSize, 0 )
item15.AddWindow( item18, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item19 = wxStaticText( parent, wxPyError_ID_TEXT6,
"Extra\n"
"information:",
wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item19.SetFont( wxFont( 10, wxROMAN, wxITALIC, wxNORMAL ) )
item16.AddWindow( item19, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item20 = wxStaticText( parent, wxPyError_ID_EXTRAINFORMATION, "text", wxDefaultPosition, wxDefaultSize, 0 )
item16.AddWindow( item20, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item13.AddSizer( item16, 0, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item0.AddSizer( item13, 1, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 10 )
item21 = wxStaticText( parent, wxPyError_ID_TEXT7, "Please select one of the options below.", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item21.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item0.AddWindow( item21, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item22 = wxFlexGridSizer( 3, 0, 0, 6 )
item22.AddGrowableCol( 0 )
item22.AddGrowableCol( 1 )
item22.AddGrowableCol( 2 )
item23 = wxBoxSizer( wxHORIZONTAL )
item24 = wxButton( parent, wxPyError_ID_MAIL, "E-mail support", wxDefaultPosition, wxDefaultSize, 0 )
item23.AddWindow( item24, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item25 = wxBoxSizer( wxVERTICAL )
item26 = wxStaticText( parent, wxPyError_ID_TEXT8, "Your e-mail address:", wxDefaultPosition, wxDefaultSize, 0 )
item26.SetFont( wxFont( 8, wxROMAN, wxITALIC, wxNORMAL ) )
item25.AddWindow( item26, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item27 = wxTextCtrl( parent, wxPyError_ID_ADDRESS, "", wxDefaultPosition, wxSize(80,-1), 0 )
item25.AddWindow( item27, 2, wxADJUST_MINSIZE|wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 )
item23.AddSizer( item25, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item22.AddSizer( item23, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item28 = wxButton( parent, wxPyError_ID_EXIT, "Exit immediately", wxDefaultPosition, wxDefaultSize, 0 )
item28.SetDefault()
item22.AddWindow( item28, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item29 = wxStaticText( parent, wxPyError_ID_TEXT9, "E-mail a \"bug report\" (if this is indeed a bug!).", wxDefaultPosition, wxDefaultSize, 0 )
item22.AddWindow( item29, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item30 = wxStaticText( parent, wxPyError_ID_TEXT10, "Attempt to exit immediately.", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item22.AddWindow( item30, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE, 5 )
item31 = wxStaticText( parent, wxPyError_ID_TEXT11, "(Please read any accompanying documentation first!)", wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE )
item31.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item22.AddWindow( item31, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item32 = wxStaticText( parent, wxPyError_ID_TEXT12, "(Please note that no attempt to save unsaved data will be made.)", wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT )
item32.SetFont( wxFont( 7, wxROMAN, wxNORMAL, wxBOLD ) )
item22.AddWindow( item32, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item22, 0, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
item0.AddSizer( item15, 1, wxADJUST_MINSIZE|wxALIGN_CENTRE|wxALL, 5 )
if set_sizer == true:
parent.SetAutoLayout( true )

View File

@ -1,6 +1,32 @@
#----------------------------------------------------------------------
# This file was generated by C:\Python21\wxPython\tools\img2py.py
# [NBNBNB with an addendum at the end]
# [NBNBNB with an addendum at the end, and...]
#----------------------------------------------------------------------------
# Name: PythonBitmaps.py
# Version: 1.0
# Created: October 2001
# Author: Chris Fama of Wholly Snakes Software,
# Chris.Fama@whollysnakes.com
#----------------------------------------------------------------------------
"""
This file was [mainly] generated by img2py. The functions of interest are:
getPythonPoweredBitmap
getPythonPoweredImage
getwxPythonBitmap
getwxPythonImage
--The meaning of these is obvious. They take no arguments.
PythonBitmaps
--This takes a single argument. If it tests true,
getPythonPoweredBitmap() is returned, else getwxPythonBitmap() is
returned.
Sorry no demo; see the demo for ErrorDialogs.py.
"""
from wxPython.wx import wxBitmapFromXPMData, wxImageFromBitmap
import cPickle, zlib
@ -824,8 +850,8 @@ def getPythonPoweredImage():
# the ..._wdr.py file...
def PythonBitmaps( index ):
if index == 0:
if index:
return getPythonPoweredBitmap()
if index == 1:
else:
return getwxPythonBitmap()
return wxNullBitmap