]> git.saurik.com Git - wxWidgets.git/commitdiff
Minor demo tweaks
authorRobin Dunn <robin@alldunn.com>
Sun, 29 Jan 2006 02:34:44 +0000 (02:34 +0000)
committerRobin Dunn <robin@alldunn.com>
Sun, 29 Jan 2006 02:34:44 +0000 (02:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/GetMouseState.py
wxPython/demo/KeyEvents.py
wxPython/demo/PyPlot.py

index c010c073dc5c5346d42a0cd8020cead2b85e3cd9..f51a8741ffb7e7508b35e42dec2cb1399b3e5968 100644 (file)
@@ -110,6 +110,10 @@ class TestPanel(wx.Panel):
         self.cmd.SetLabel( str(ms.cmdDown) )
 
 
+    def ShutdownDemo(self):
+        self.timer.Stop()
+        del self.timer
+        
 #----------------------------------------------------------------------
 
 def runTest(frame, nb, log):
index 71acdf2294801ff9d8b2be85fd775b07d1e55f84..1b55200099f4311e28d9c1ab652a585fe341a36f 100644 (file)
@@ -231,6 +231,8 @@ class KeyLog(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
                 if keycode <= 127:
                     keycode = evt.GetKeyCode()
                 keyname = "\"" + unichr(evt.GetUnicodeKey()) + "\""
+                if keycode < 27:
+                    keyname = "Ctrl-%s" % chr(ord('A') + keycode-1)
                 
             elif keycode < 256:
                 if keycode == 0:
index f916dc66155bff6110aba1dd468628b262f34836..52387c5044ef0daa860dc740d34c0826a1f05643 100644 (file)
@@ -1,6 +1,12 @@
 
 import  wx
-import  wx.lib.plot
+
+hadImportError = False
+try:
+    import  wx.lib.plot
+except ImportError:
+    hadImportError = True
+    
 
 ################################################################\
 # Where's the code???                                           |
@@ -32,13 +38,27 @@ class TestPanel(wx.Panel):
 
 
 def runTest(frame, nb, log):
-    win = TestPanel(nb, log)
+    if not hadImportError:
+        win = TestPanel(nb, log)
+    else:
+        from Main import MessagePanel
+        win = MessagePanel(nb, """\
+This demo requires the Numeric or numarray module,
+which could not be imported.  It probably is not installed
+(it's not part of the standard Python distribution). See the
+Python site (http://www.python.org) for information on
+downloading source or binaries.""",
+                           'Sorry', wx.ICON_WARNING)
+    
     return win
 
 
 #----------------------------------------------------------------------
 
-overview = """\
+if hadImportError:
+    overview = ""
+else:
+    overview = """\
 <html><body>
 <center><h2>PyPlot</h2></center>