From: Robin Dunn Date: Wed, 6 Oct 2004 18:34:20 +0000 (+0000) Subject: Show EVT_ACTIVATE and EVT_ACTIVATE_APP events in action. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/8412feb0287df26ef6e944927d3b6f2764a4b9a4 Show EVT_ACTIVATE and EVT_ACTIVATE_APP events in action. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index d679dc2cb6..fa4338f2fd 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -1050,6 +1050,8 @@ class wxPythonDemo(wx.Frame): self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) self.Bind(wx.EVT_ICONIZE, self.OnIconfiy) self.Bind(wx.EVT_MAXIMIZE, self.OnMaximize) + self.Bind(wx.EVT_ACTIVATE, self.OnActivate) + wx.GetApp().Bind(wx.EVT_ACTIVATE_APP, self.OnAppActivate) self.Centre(wx.BOTH) self.CreateStatusBar(1, wx.ST_SIZEGRIP) @@ -1320,9 +1322,8 @@ class wxPythonDemo(wx.Frame): self.ShutdownDemoModule() overviewText = "" - # o If the demo returns a window it is placed in a tab. - # o Otherwise, a placeholder tab is created, informing the user that the - # demo runs outside the main window, and allowing it to be reloaded. + # o The RunTest() for all samples must now return a window that can + # be palced in a tab in the main notebook. # o If an error occurs (or has occured before) an error tab is created. if module is not None: @@ -1560,7 +1561,7 @@ class wxPythonDemo(wx.Frame): #--------------------------------------------- def OnIconfiy(self, evt): - wx.LogMessage("OnIconfiy: %d" % evt.Iconized()) + wx.LogMessage("OnIconfiy: %s" % evt.Iconized()) evt.Skip() #--------------------------------------------- @@ -1568,8 +1569,15 @@ class wxPythonDemo(wx.Frame): wx.LogMessage("OnMaximize") evt.Skip() + #--------------------------------------------- + def OnActivate(self, evt): + wx.LogMessage("OnActivate: %s" % evt.GetActive()) + evt.Skip() - + #--------------------------------------------- + def OnAppActivate(self, evt): + wx.LogMessage("OnAppActivate: %s" % evt.GetActive()) + evt.Skip() #--------------------------------------------------------------------------- #---------------------------------------------------------------------------