]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Main.py
demo tweaks
[wxWidgets.git] / wxPython / demo / Main.py
index a31707912be8faaca1f691e0aab7b0be1900eef7..25cd0792779d7badc9d2797fef7544a7dc225347 100644 (file)
@@ -47,8 +47,8 @@ import images
 _treeList = [
     # new stuff
     ('Recent Additions/Updates', [
-        'StandardPaths',
-        'MediaCtrl',
+        'FoldPanelBar',
+        'GIFAnimationCtrl',
         ]),
 
     # managed windows == things with a (optional) caption you can close
@@ -68,6 +68,7 @@ _treeList = [
         'FindReplaceDialog',
         'FontDialog',
         'MessageDialog',
+        'MultiChoiceDialog',
         'PageSetupDialog',
         'PrintDialog',
         'ProgressDialog',
@@ -112,6 +113,7 @@ _treeList = [
         'SpinCtrl',
         'SplitterWindow',
         'StaticBitmap',
+        'StaticBox',
         'StaticText',
         'StatusBar',
         'StockButtons',
@@ -144,12 +146,15 @@ _treeList = [
         'Calendar',
         'CalendarCtrl',
         'ContextHelp',
+        'DatePickerCtrl',
         'DynamicSashWindow',
         'EditableListBox',
         'FancyText',
         'FileBrowseButton',
         'FloatBar',  
         'FloatCanvas',
+        'FoldPanelBar',
+        'GIFAnimationCtrl',
         'HtmlWindow',
         'IntCtrl',
         'MediaCtrl',
@@ -193,7 +198,7 @@ _treeList = [
         'PythonEvents',
         'Threads',
         'Timer',
-        ##'infoframe',    # needs better explaination and some fixing
+        ##'infoframe',    # needs better explanation and some fixing
         ]),
 
     # Clipboard and DnD
@@ -208,6 +213,7 @@ _treeList = [
         'ArtProvider',
         'Cursor',
         'DragImage',
+        'GIFAnimationCtrl',
         'Image',
         'ImageAlpha',
         'ImageFromStream',
@@ -218,11 +224,12 @@ _treeList = [
     # Other stuff
     ('Miscellaneous', [
         'ColourDB',
-        ##'DialogUnits',   # needs more explainations
+        ##'DialogUnits',   # needs more explanations
         'DrawXXXList',
         'FileHistory',
         'FontEnumerator',
         'Joystick',
+        'MouseGestures',
         'OGL',
         'PrintFramework',
         'ShapedWindow',
@@ -318,7 +325,7 @@ class MessagePanel(wx.Panel):
         box.Add((10,10), 2)
 
         self.SetSizer(box)
-        
+        self.Fit()
         
 
 #---------------------------------------------------------------------------
@@ -667,7 +674,7 @@ class DemoCodePanel(wx.Panel):
             try:
                 os.makedirs(GetModifiedDirectory())
                 if not os.path.exists(GetModifiedDirectory()):
-                    wx.LogMessage("BUG: Created demo directory but it still doesn't exit")
+                    wx.LogMessage("BUG: Created demo directory but it still doesn't exist")
                     raise AssetionError
             except:
                 wx.LogMessage("Error creating demo directory: %s" % GetModifiedDirectory())
@@ -1105,6 +1112,7 @@ class wxPythonDemo(wx.Frame):
         self.codePage = None
         self.shell = None
         self.firstTime = True
+        self.finddlg = None
 
         icon = images.getWXPdemoIcon()
         self.SetIcon(icon)
@@ -1191,9 +1199,11 @@ class wxPythonDemo(wx.Frame):
         self.Bind(wx.EVT_MENU, self.OnHelpAbout, helpItem)
         self.Bind(wx.EVT_MENU, self.OnHelpFind,  findItem)
         self.Bind(wx.EVT_MENU, self.OnFindNext,  findnextItem)
-        self.Bind(wx.EVT_COMMAND_FIND, self.OnFind)
-        self.Bind(wx.EVT_COMMAND_FIND_NEXT, self.OnFind)
-        self.Bind(wx.EVT_COMMAND_FIND_CLOSE, self.OnFindClose)
+        self.Bind(wx.EVT_FIND, self.OnFind)
+        self.Bind(wx.EVT_FIND_NEXT, self.OnFind)
+        self.Bind(wx.EVT_FIND_CLOSE, self.OnFindClose)
+        self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateFindItems, findItem)
+        self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateFindItems, findnextItem)
         self.mainmenu.Append(menu, '&Help')
         self.SetMenuBar(self.mainmenu)
 
@@ -1510,6 +1520,9 @@ class wxPythonDemo(wx.Frame):
         about.Destroy()
 
     def OnHelpFind(self, event):
+        if self.finddlg != None:
+            return
+        
         self.nb.SetSelection(1)
         self.finddlg = wx.FindReplaceDialog(self, self.finddata, "Find",
                         wx.FR_NOUPDOWN |
@@ -1517,6 +1530,11 @@ class wxPythonDemo(wx.Frame):
                         wx.FR_NOWHOLEWORD)
         self.finddlg.Show(True)
 
+
+    def OnUpdateFindItems(self, evt):
+        evt.Enable(self.finddlg == None)
+
+
     def OnFind(self, event):
         editor = self.codePage.editor
         self.nb.SetSelection(1)
@@ -1541,6 +1559,7 @@ class wxPythonDemo(wx.Frame):
                 return
             else:
                 self.finddlg.Destroy()
+                self.finddlg = None
         editor.ShowPosition(loc)
         editor.SetSelection(loc, loc + len(findstring))
 
@@ -1554,6 +1573,7 @@ class wxPythonDemo(wx.Frame):
 
     def OnFindClose(self, event):
         event.GetDialog().Destroy()
+        self.finddlg = None
 
 
     def OnOpenShellWindow(self, evt):
@@ -1673,6 +1693,8 @@ class MyApp(wx.App):
         the main frame when it is time to do so.
         """
 
+        wx.SystemOptions.SetOptionInt("mac.window-plain-transition", 1)
+
         # For debugging
         #self.SetAssertMode(wx.PYAPP_ASSERT_DIALOG)