]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Main.py
added inline plural form of wxGetTranslation to wxUSE_INTL=0 case for use with non...
[wxWidgets.git] / wxPython / demo / Main.py
index 64b08bba9b56b6b04e4191147b689733bf304405..2c99409724a78a7a1aa3f8745435756bc1509a05 100644 (file)
@@ -47,29 +47,6 @@ import images
 _treeList = [
     # new stuff
     ('Recent Additions/Updates', [
-        'RichTextCtrl',
-        'Treebook',
-        'Toolbook',
-        'BitmapFromBuffer',
-        'RawBitmapAccess',
-        'DragScroller',
-        'DelayedResult',
-        'ExpandoTextCtrl',
-        'ButtonPanel',
-        'FlatNotebook',
-        'CustomTreeCtrl',
-        'AboutBox',
-        'AlphaDrawing',
-        'GraphicsContext',
-        'CollapsiblePane',
-        'ComboCtrl',
-        'OwnerDrawnComboBox',
-        'BitmapComboBox',
-        'I18N',
-        'Img2PyArtProvider',
-        'SearchCtrl',
-        'SizedControls',
-        'AUI_MDI',
         ]),
 
     # managed windows == things with a (optional) caption you can close
@@ -214,6 +191,7 @@ _treeList = [
         'Throbber',
         'Ticker',
         'TimeCtrl',
+        'TreeMixin',
         'VListBox',
         ]),
 
@@ -729,7 +707,7 @@ class DemoCodePanel(wx.Panel):
                 os.makedirs(GetModifiedDirectory())
                 if not os.path.exists(GetModifiedDirectory()):
                     wx.LogMessage("BUG: Created demo directory but it still doesn't exist")
-                    raise AssetionError
+                    raise AssertionError
             except:
                 wx.LogMessage("Error creating demo directory: %s" % GetModifiedDirectory())
                 return
@@ -1374,6 +1352,7 @@ class wxPythonDemo(wx.Frame):
     #---------------------------------------------
     
     def RecreateTree(self, evt=None):
+        self.tree.Freeze()
         self.tree.DeleteAllItems()
         self.root = self.tree.AddRoot("wxPython Overview")
         firstChild = None
@@ -1393,6 +1372,7 @@ class wxPythonDemo(wx.Frame):
             self.tree.Expand(firstChild)
         if filter:
             self.tree.ExpandAll()
+        self.tree.Thaw()
     
     def WriteText(self, text):
         if text[-1:] == '\n':
@@ -1685,9 +1665,17 @@ class wxPythonDemo(wx.Frame):
 
 
     def OnOpenWidgetInspector(self, evt):
-        # Activate the widget inspector that was mixed in with the
-        # app, see MyApp and MyApp.OnInit below.
-        wx.GetApp().ShowInspectionTool()
+        # Activate the widget inspection tool
+        from wx.lib.inspection import InspectionTool
+        if not InspectionTool().initialized:
+            InspectionTool().Init()
+
+        # Find a widget to be selected in the tree.  Use either the
+        # one under the cursor, if any, or this frame.
+        wnd = wx.FindWindowAtPointer()
+        if not wnd:
+            wnd = self
+        InspectionTool().Show(wnd, True)
 
         
     #---------------------------------------------
@@ -1789,8 +1777,7 @@ class MySplashScreen(wx.SplashScreen):
             self.Raise()
 
         
-import wx.lib.mixins.inspect
-class MyApp(wx.App, wx.lib.mixins.inspect.InspectionMixin):
+class MyApp(wx.App):
     def OnInit(self):
         """
         Create and show the splash screen.  It will then create and show
@@ -1811,9 +1798,6 @@ class MyApp(wx.App, wx.lib.mixins.inspect.InspectionMixin):
         splash = MySplashScreen()
         splash.Show()
 
-        # Setup the InspectionMixin
-        self.Init()
-        
         return True