X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/62038e5976965767ea0ec64c6992878457ddd59a..628eae0bcd7916c57847b7eab739d4cc32534ccf:/wxPython/demo/Main.py diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index 458c1a713a..a2084d2967 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -47,7 +47,9 @@ import images _treeList = [ # new stuff ('Recent Additions/Updates', [ - 'StandardPaths', + 'FoldPanelBar', + 'GIFAnimationCtrl', + 'HyperLinkCtrl', ]), # managed windows == things with a (optional) caption you can close @@ -67,6 +69,7 @@ _treeList = [ 'FindReplaceDialog', 'FontDialog', 'MessageDialog', + 'MultiChoiceDialog', 'PageSetupDialog', 'PrintDialog', 'ProgressDialog', @@ -111,6 +114,7 @@ _treeList = [ 'SpinCtrl', 'SplitterWindow', 'StaticBitmap', + 'StaticBox', 'StaticText', 'StatusBar', 'StockButtons', @@ -143,14 +147,19 @@ _treeList = [ 'Calendar', 'CalendarCtrl', 'ContextHelp', + 'DatePickerCtrl', 'DynamicSashWindow', 'EditableListBox', 'FancyText', 'FileBrowseButton', 'FloatBar', 'FloatCanvas', + 'FoldPanelBar', + 'GIFAnimationCtrl', 'HtmlWindow', + 'HyperLinkCtrl', 'IntCtrl', + 'MediaCtrl', 'MVCTree', 'MaskedEditControls', 'MaskedNumCtrl', @@ -191,7 +200,7 @@ _treeList = [ 'PythonEvents', 'Threads', 'Timer', - ##'infoframe', # needs better explaination and some fixing + ##'infoframe', # needs better explanation and some fixing ]), # Clipboard and DnD @@ -206,6 +215,7 @@ _treeList = [ 'ArtProvider', 'Cursor', 'DragImage', + 'GIFAnimationCtrl', 'Image', 'ImageAlpha', 'ImageFromStream', @@ -216,11 +226,12 @@ _treeList = [ # Other stuff ('Miscellaneous', [ 'ColourDB', - ##'DialogUnits', # needs more explainations + ##'DialogUnits', # needs more explanations 'DrawXXXList', 'FileHistory', 'FontEnumerator', 'Joystick', + 'MouseGestures', 'OGL', 'PrintFramework', 'ShapedWindow', @@ -316,7 +327,7 @@ class MessagePanel(wx.Panel): box.Add((10,10), 2) self.SetSizer(box) - + self.Fit() #--------------------------------------------------------------------------- @@ -514,13 +525,13 @@ except ImportError: def GetText(self): return self.GetValue() - def GetPositionFromLine(line): + def GetPositionFromLine(self, line): return self.XYToPosition(0,line) def GotoLine(self, line): - pos = self.editor.GetPositionFromLine(line) - self.editor.SetInsertionPoint(pos) - self.editor.ShowPosition(pos) + pos = self.GetPositionFromLine(line) + self.SetInsertionPoint(pos) + self.ShowPosition(pos) def SelectLine(self, line): start = self.GetPositionFromLine(line) @@ -665,7 +676,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()) @@ -1069,8 +1080,7 @@ class DemoTaskBarIcon(wx.TaskBarIcon): def OnTaskBarChange(self, evt): - names = [ "WXPdemo", "WXP", "Mondrian", "Test2m", - "Blom08m", "Blom10m", "Blom15m" ] + names = [ "WXPdemo", "Mondrian", "Pencil", "Carrot" ] name = names[self.imgidx] getFunc = getattr(images, "get%sImage" % name) @@ -1103,6 +1113,7 @@ class wxPythonDemo(wx.Frame): self.codePage = None self.shell = None self.firstTime = True + self.finddlg = None icon = images.getWXPdemoIcon() self.SetIcon(icon) @@ -1189,9 +1200,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) @@ -1508,6 +1521,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 | @@ -1515,6 +1531,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) @@ -1539,6 +1560,7 @@ class wxPythonDemo(wx.Frame): return else: self.finddlg.Destroy() + self.finddlg = None editor.ShowPosition(loc) editor.SetSelection(loc, loc + len(findstring)) @@ -1552,6 +1574,7 @@ class wxPythonDemo(wx.Frame): def OnFindClose(self, event): event.GetDialog().Destroy() + self.finddlg = None def OnOpenShellWindow(self, evt): @@ -1651,18 +1674,22 @@ class wxPythonDemo(wx.Frame): class MySplashScreen(wx.SplashScreen): def __init__(self): - bmp = wx.Image(opj("bitmaps/splash.gif")).ConvertToBitmap() + bmp = wx.Image(opj("bitmaps/splash.png")).ConvertToBitmap() wx.SplashScreen.__init__(self, bmp, wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, - 3000, None, -1) + 5000, None, -1) self.Bind(wx.EVT_CLOSE, self.OnClose) + wx.FutureCall(2000, self.ShowMain) def OnClose(self, evt): self.Hide() - frame = wxPythonDemo(None, "wxPython: (A Demonstration)") - frame.Show() evt.Skip() # Make sure the default handler runs too... + def ShowMain(self): + frame = wxPythonDemo(None, "wxPython: (A Demonstration)") + frame.Show() + self.Raise() + class MyApp(wx.App): def OnInit(self): @@ -1671,6 +1698,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) @@ -1679,7 +1708,7 @@ class MyApp(wx.App): # initialization, finally creating and showing the main # application window(s). In this case we have nothing else to # do so we'll delay showing the main frame until later (see - # OnClose above) so the users can see the SplashScreen effect. + # ShowMain above) so the users can see the SplashScreen effect. splash = MySplashScreen() splash.Show()