]> git.saurik.com Git - wxWidgets.git/blobdiff - utils/wxPython/src/_extras.py
it is now possible to add custom buttons into wxHtmlHelpFrame's toolbar
[wxWidgets.git] / utils / wxPython / src / _extras.py
index aa94aefeedb7a56463430630e1f625634086bef5..cad11d21a1cbf7892b7039deb30de587ac8ca816 100644 (file)
@@ -146,6 +146,20 @@ def EVT_ICONIZE(win, func):
 def EVT_NAVIGATION_KEY(win, func):
     win.Connect(-1, -1, wxEVT_NAVIGATION_KEY, func)
 
+def EVT_PALETTE_CHANGED(win, func):
+    win.Connect(-1, -1, wxEVT_PALETTE_CHANGED, func)
+
+def EVT_QUERY_NEW_PALETTE(win, func):
+    win.Connect(-1, -1, wxEVT_QUERY_NEW_PALETTE, func)
+
+def EVT_WINDOW_CREATE(win, func):
+    win.Connect(-1, -1, wxEVT_CREATE, func)
+
+def EVT_WINDOW_DESTROY(win, func):
+    win.Connect(-1, -1, wxEVT_DESTROY, func)
+
+
+
 def EVT_IDLE(win, func):
     win.Connect(-1, -1, wxEVT_IDLE, func)
 
@@ -390,15 +404,25 @@ def EVT_COMBOBOX(win, id, func):
 def EVT_TOOL(win, id, func):
     win.Connect(id, -1, wxEVT_COMMAND_TOOL_CLICKED, func)
 
+def EVT_TOOL_RANGE(win, id, id2, func):
+    win.Connect(id, id2, wxEVT_COMMAND_TOOL_CLICKED, func)
+
 def EVT_TOOL_RCLICKED(win, id, func):
     win.Connect(id, -1, wxEVT_COMMAND_TOOL_RCLICKED, func)
 
+def EVT_TOOL_RCLICKED_RANGE(win, id, id2, func):
+    win.Connect(id, id2, wxEVT_COMMAND_TOOL_RCLICKED, func)
+
 def EVT_TOOL_ENTER(win, id, func):
     win.Connect(id, -1, wxEVT_COMMAND_TOOL_ENTER, func)
 
 def EVT_CHECKLISTBOX(win, id, func):
     win.Connect(id, -1, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, func)
 
+def EVT_SPINCTRL(win, id, func):
+    win.Connect(id, -1, wxEVT_COMMAND_SPINCTRL_UPDATED, func)
+
+
 
 # Generic command events
 
@@ -709,15 +733,18 @@ class wxPyOnDemandOutputWindow:
         self.frame  = None
         self.title  = title
 
+
     def SetParent(self, parent):
         self.parent = parent
 
+
     def OnCloseWindow(self, event):
         if self.frame != None:
             self.frame.Destroy()
         self.frame = None
         self.text  = None
 
+
     # this provides the file-like behaviour
     def write(self, str):
         if not self.frame:
@@ -729,7 +756,10 @@ class wxPyOnDemandOutputWindow:
             EVT_CLOSE(self.frame, self.OnCloseWindow)
         self.text.AppendText(str)
 
+
     def close(self):
+        if self.frame != None:
+            self.frame.Destroy()
         self.frame = None
         self.text  = None
 
@@ -765,19 +795,22 @@ class wxApp(wxPyApp):
     def SetTopWindow(self, frame):
         if self.stdioWin:
             self.stdioWin.SetParent(frame)
-            sys.stdout = self.stdioWin #sys.stderr =
+            sys.stderr = sys.stdout = self.stdioWin
         wxPyApp.SetTopWindow(self, frame)
 
+
     def MainLoop(self):
         wxPyApp.MainLoop(self)
         self.RestoreStdio()
 
+
     def RedirectStdio(self, filename):
         if filename:
             sys.stdout = sys.stderr = open(filename, 'a')
         else:
             self.stdioWin = self.outputWindowClass() # wxPyOnDemandOutputWindow
 
+
     def RestoreStdio(self):
         sys.stdout, sys.stderr = self.saveStdio
         if self.stdioWin != None: