]> git.saurik.com Git - wxWidgets.git/commitdiff
Show EVT_ACTIVATE and EVT_ACTIVATE_APP events in action.
authorRobin Dunn <robin@alldunn.com>
Wed, 6 Oct 2004 18:34:20 +0000 (18:34 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 6 Oct 2004 18:34:20 +0000 (18:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/Main.py

index d679dc2cb6028537d8315970eb26b07bc2816871..fa4338f2fd25f0eee3bd80522e19f00ef41fa752 100644 (file)
@@ -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()
 
 #---------------------------------------------------------------------------
 #---------------------------------------------------------------------------