X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4276dc529d44f9107748f2ed6ca36f8ddfce12f4..8179a16812e66ff0ac32bb09803e95756350c76c:/wxPython/demo/Main.py diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index fe35bbfdca..d57aebbb36 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,7 @@ _treeList = [ # dialogs from libraries ('More Dialogs', [ - 'ErrorDialogs', + ##'ErrorDialogs', 'ImageBrowser', 'MultipleChoiceDialog', 'ScrolledMessageDialog', @@ -75,6 +79,7 @@ _treeList = [ # core controls ('Core Windows/Controls', [ + 'BitmapButton', 'Button', 'CheckBox', 'CheckListBox', @@ -124,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', @@ -135,7 +143,7 @@ _treeList = [ 'FloatBar', 'FloatCanvas', 'HtmlWindow', - 'IEHtmlWin', + ##'IEHtmlWin', 'IntCtrl', 'MVCTree', 'MaskedEditControls', @@ -172,7 +180,7 @@ _treeList = [ ('Process and Events', [ 'EventManager', 'KeyEvents', - 'OOR', + ##'OOR', 'Process', 'PythonEvents', 'Threads', @@ -193,6 +201,7 @@ _treeList = [ 'Cursor', 'DragImage', 'Image', + 'ImageAlpha', 'ImageFromStream', 'Mask', 'Throbber', @@ -216,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 ]), @@ -263,7 +272,7 @@ try: from StyledTextCtrl_2 import PythonSTC class DemoCodeViewer(PythonSTC): def __init__(self, parent, ID): - PythonSTC.__init__(self, parent, ID) + PythonSTC.__init__(self, parent, ID, wx.BORDER_NONE) self.SetUpEditor() # Some methods to make it compatible with how the wxTextCtrl is used @@ -431,6 +440,7 @@ class wxPythonDemo(wx.Frame): def __init__(self, parent, id, title): wx.Frame.__init__(self, parent, -1, title, size = (800, 600), style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE) + self.cwd = os.getcwd() self.curOverview = "" @@ -490,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 @@ -684,7 +700,6 @@ class wxPythonDemo(wx.Frame): if itemText == self.overviewText: self.LoadDemoSource('Main.py') self.SetOverview(self.overviewText, overview) -## self.nb.Refresh(); self.window = None else: @@ -703,21 +718,17 @@ class wxPythonDemo(wx.Frame): wx.EndBusyCursor() self.tree.Refresh() - # in case runTest is modal, make sure things look right... -## self.nb.Refresh(); -## wx.SafeYield() - self.window = module.runTest(self, self.nb, self) ### if self.window is not None: self.nb.AddPage(self.window, 'Demo') self.nb.SetSelection(2) -## self.nb.Refresh() # without this wxMac has troubles showing the just added page else: self.ovr.SetPage("") self.txt.Clear() self.window = None + self.tree.SetFocus() #--------------------------------------------- @@ -746,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)