X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e19b71646053a07255b308b24321837f8ea76176..c25a510b30bd87f26deaf3532a48d29a158f0aea:/utils/wxPython/demo/Main.py diff --git a/utils/wxPython/demo/Main.py b/utils/wxPython/demo/Main.py index 5df81877ac..d9483a9e51 100644 --- a/utils/wxPython/demo/Main.py +++ b/utils/wxPython/demo/Main.py @@ -13,7 +13,7 @@ import sys, os from wxPython.wx import * - +from wxPython.lib.splashscreen import SplashScreen #--------------------------------------------------------------------------- @@ -21,6 +21,10 @@ _useSplitter = true _useNestedSplitter = true _treeList = [ + ('New since last release', ['wxMVCTree', 'wxVTKRenderWindow', + 'FileBrowseButton', #'wxToggleButton', + 'GenericButtons']), + ('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']), ('Non-Managed Windows', ['wxGrid', 'wxSashWindow', @@ -36,7 +40,8 @@ _treeList = [ ('Controls', ['wxButton', 'wxCheckBox', 'wxCheckListBox', 'wxChoice', 'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'wxTextCtrl', 'wxTreeCtrl', 'wxSpinButton', 'wxStaticText', 'wxStaticBitmap', - 'wxRadioBox', 'wxSlider']), + 'wxRadioBox', 'wxSlider', #'wxToggleButton' + ]), ('Window Layout', ['wxLayoutConstraints', 'Sizers', 'OldSizers']), @@ -47,7 +52,8 @@ _treeList = [ ('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog', 'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar', - 'PyShell', 'wxCalendar']), + 'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow', + 'FileBrowseButton', 'GenericButtons']), ('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']), @@ -59,6 +65,8 @@ class wxPythonDemo(wxFrame): def __init__(self, parent, id, title): wxFrame.__init__(self, parent, -1, title, size = (725, 550)) + self.cwd = os.getcwd() + if wxPlatform == '__WXMSW__': self.icon = wxIcon('bitmaps/mondrian.ico', wxBITMAP_TYPE_ICO) self.SetIcon(self.icon) @@ -130,13 +138,16 @@ class wxPythonDemo(wxFrame): self.treeMap = {} self.tree = wxTreeCtrl(splitter, tID) root = self.tree.AddRoot("Overview") + firstChild = None for item in _treeList: child = self.tree.AppendItem(root, item[0]) + if not firstChild: firstChild = child for childItem in item[1]: theDemo = self.tree.AppendItem(child, childItem) self.treeMap[childItem] = theDemo self.tree.Expand(root) + self.tree.Expand(firstChild) EVT_TREE_ITEM_EXPANDED (self.tree, tID, self.OnItemExpanded) EVT_TREE_ITEM_COLLAPSED (self.tree, tID, self.OnItemCollapsed) EVT_TREE_SEL_CHANGED (self.tree, tID, self.OnSelChanged) @@ -236,6 +247,7 @@ class wxPythonDemo(wxFrame): #--------------------------------------------- def RunDemo(self, itemText): + os.chdir(self.cwd) if self.nb.GetPageCount() == 3: if self.nb.GetSelection() == 2: self.nb.SetSelection(0) @@ -353,7 +365,16 @@ class MyApp(wxApp): wxImage_AddHandler(wxJPEGHandler()) wxImage_AddHandler(wxPNGHandler()) wxImage_AddHandler(wxGIFHandler()) - frame = wxPythonDemo(NULL, -1, "wxPython: (A Demonstration)") + + self.splash = SplashScreen(None, bitmapfile='bitmaps/splash.gif', + duration=4000, callback=self.AfterSplash) + self.splash.Show(true) + wxYield() + return true + + def AfterSplash(self): + self.splash.Close(true) + frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)") frame.Show(true) self.SetTopWindow(frame) return true