X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a5d9c77bb86ba15dd3701b4d6a3539619f89d876..962162620ff8b78f4d25c7f4ccec88ce071dfb2b:/wxPython/demo/Main.py diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 9d2d87fd77..ddce684930 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -38,6 +38,10 @@ _treeList = [ 'GridBagSizer', 'Cursor', 'PyPlot', + 'ImageAlpha', + 'ActiveX_FlashWindow', + 'ActiveX_IEHtmlWindow', + 'ActiveX_PDFWindow', ]), # managed windows == things with a (optional) caption you can close @@ -67,7 +71,6 @@ _treeList = [ # dialogs from libraries ('More Dialogs', [ - 'ErrorDialogs', 'ImageBrowser', 'MultipleChoiceDialog', 'ScrolledMessageDialog', @@ -75,6 +78,7 @@ _treeList = [ # core controls ('Core Windows/Controls', [ + 'BitmapButton', 'Button', 'CheckBox', 'CheckListBox', @@ -124,6 +128,9 @@ _treeList = [ # controls coming from other libraries ('More Windows/Controls', [ + 'ActiveX_FlashWindow', + 'ActiveX_IEHtmlWindow', + 'ActiveX_PDFWindow', #'RightTextCtrl', deprecated as we have wxTE_RIGHT now. 'Calendar', 'CalendarCtrl', @@ -135,7 +142,6 @@ _treeList = [ 'FloatBar', 'FloatCanvas', 'HtmlWindow', - 'IEHtmlWin', 'IntCtrl', 'MVCTree', 'MaskedEditControls', @@ -172,7 +178,6 @@ _treeList = [ ('Process and Events', [ 'EventManager', 'KeyEvents', - 'OOR', 'Process', 'PythonEvents', 'Threads', @@ -193,6 +198,7 @@ _treeList = [ 'Cursor', 'DragImage', 'Image', + 'ImageAlpha', 'ImageFromStream', 'Mask', 'Throbber', @@ -206,7 +212,6 @@ _treeList = [ 'FileHistory', 'FontEnumerator', 'Joystick', - 'NewNamespace', 'OGL', 'PrintFramework', 'ShapedWindow', @@ -216,10 +221,7 @@ _treeList = [ # need libs not coming with the demo ('Objects using an external library', [ - 'ActiveXWrapper_Acrobat', - 'ActiveXWrapper_IE', 'GLCanvas', - #'PlotCanvas', # deprecated, use PyPlot ]), @@ -491,9 +493,15 @@ class wxPythonDemo(wx.Frame): # Make a File menu self.mainmenu = wx.MenuBar() menu = wx.Menu() + item = menu.Append(-1, '&Redirect Output', + 'Redirect print statements to a window', + wx.ITEM_CHECK) + self.Bind(wx.EVT_MENU, self.OnToggleRedirect, item) + item = menu.Append(-1, 'E&xit\tAlt-X', 'Get the heck outta here!') self.Bind(wx.EVT_MENU, self.OnFileExit, item) wx.App_SetMacExitMenuItemId(item.GetId()) + self.mainmenu.Append(menu, '&File') # Make a Demo menu @@ -713,6 +721,7 @@ class wxPythonDemo(wx.Frame): self.txt.Clear() self.window = None + self.tree.SetFocus() #--------------------------------------------- @@ -741,6 +750,15 @@ class wxPythonDemo(wx.Frame): def OnFileExit(self, *event): self.Close() + def OnToggleRedirect(self, event): + app = wx.GetApp() + if event.Checked(): + app.RedirectStdio() + print "Print statements and other standard output will now be directed to this window." + else: + app.RestoreStdio() + print "Print statements and other standard output will now be sent to the usual location." + def OnHelpAbout(self, event): from About import MyAboutBox about = MyAboutBox(self) @@ -798,8 +816,6 @@ class wxPythonDemo(wx.Frame): self.dying = True self.window = None self.mainmenu = None - if hasattr(self, "tbicon"): - del self.tbicon self.Destroy()