X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8a88769e50fcf3c538498f6fecdd2d0c7abca6ec..70a4ef826ff45fbf06106ae3b6c3a1263eabfe73:/wxPython/demo/Main.py diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 6a2146104b..d57aebbb36 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -39,6 +39,9 @@ _treeList = [ 'Cursor', 'PyPlot', 'ImageAlpha', + 'ActiveX_FlashWindow', + 'ActiveX_IEHtmlWindow', + 'ActiveX_PDFWindow', ]), # managed windows == things with a (optional) caption you can close @@ -68,7 +71,7 @@ _treeList = [ # dialogs from libraries ('More Dialogs', [ - 'ErrorDialogs', + ##'ErrorDialogs', 'ImageBrowser', 'MultipleChoiceDialog', 'ScrolledMessageDialog', @@ -76,6 +79,7 @@ _treeList = [ # core controls ('Core Windows/Controls', [ + 'BitmapButton', 'Button', 'CheckBox', 'CheckListBox', @@ -125,6 +129,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', @@ -136,7 +143,7 @@ _treeList = [ 'FloatBar', 'FloatCanvas', 'HtmlWindow', - 'IEHtmlWin', + ##'IEHtmlWin', 'IntCtrl', 'MVCTree', 'MaskedEditControls', @@ -173,7 +180,7 @@ _treeList = [ ('Process and Events', [ 'EventManager', 'KeyEvents', - 'OOR', + ##'OOR', 'Process', 'PythonEvents', 'Threads', @@ -218,8 +225,8 @@ _treeList = [ # need libs not coming with the demo ('Objects using an external library', [ - 'ActiveXWrapper_Acrobat', - 'ActiveXWrapper_IE', + ##'ActiveXWrapper_Acrobat', + ##'ActiveXWrapper_IE', # currently has tstate problems... 'GLCanvas', #'PlotCanvas', # deprecated, use PyPlot ]), @@ -493,9 +500,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 @@ -715,6 +728,7 @@ class wxPythonDemo(wx.Frame): self.txt.Clear() self.window = None + self.tree.SetFocus() #--------------------------------------------- @@ -743,6 +757,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)