]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/_extras.py
wxX11:
[wxWidgets.git] / wxPython / src / _extras.py
index 0e8da6d20e07f1ba6358c4c538d2a7f6b80a253a..2c27bf0584e218b395a551e73a78c0aeaceb4b36 100644 (file)
@@ -6,7 +6,6 @@
 # Author:       Robin Dunn
 #
 # Created:      6/30/97
-# RCS-ID:       $Id$
 # Copyright:    (c) 1998 by Total Control Software
 # Licence:      wxWindows license
 #----------------------------------------------------------------------------
@@ -75,6 +74,9 @@ def EVT_SET_FOCUS(win, func):
 def EVT_KILL_FOCUS(win, func):
     win.Connect(-1, -1, wxEVT_KILL_FOCUS, func)
 
+def EVT_CHILD_FOCUS(win, func):
+    win.Connect(-1, -1, wxEVT_CHILD_FOCUS, func)
+
 def EVT_ACTIVATE(win, func):
     win.Connect(-1, -1, wxEVT_ACTIVATE, func)
 
@@ -96,6 +98,9 @@ def EVT_INIT_DIALOG(win, func):
 def EVT_SYS_COLOUR_CHANGED(win, func):
     win.Connect(-1, -1, wxEVT_SYS_COLOUR_CHANGED, func)
 
+def EVT_DISPLAY_CHANGED(win, func):
+    win.Connect(-1, -1, wxEVT_DISPLAY_CHANGED, func)
+
 def EVT_SHOW(win, func):
     win.Connect(-1, -1, wxEVT_SHOW, func)
 
@@ -568,33 +573,33 @@ class wxTimer(wxPyTimer):
             wxPyTimer.__init__(self, None)
             self.SetOwner(evtHandler, id)
 
-#----------------------------------------------------------------------
-
-NULL = None  # For backwards compatibility only.  You should really be
-             # using None now.
-
-
 #----------------------------------------------------------------------
 # aliases
 
 wxColor      = wxColour
 wxNamedColor = wxNamedColour
 wxPen        = wxPyPen
+wxScrollbar  = wxScrollBar
+
 
 # backwards compatibility
 wxNoRefBitmap       = wxBitmap
 wxPyDefaultPosition = wxDefaultPosition
 wxPyDefaultSize     = wxDefaultSize
-
+NULL                = None
+wxSystemSettings_GetSystemColour = wxSystemSettings_GetColour
+wxSystemSettings_GetSystemFont   = wxSystemSettings_GetFont
+wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric
 
 #----------------------------------------------------------------------
 # wxGTK sets the locale when initialized.  Doing this at the Python
 # level should set it up to match what GTK is doing at the C level.
-try:
-    import locale
-    locale.setlocale(locale.LC_ALL, "")
-except:
-    pass
+if wxPlatform == "__WXGTK__":
+    try:
+        import locale
+        locale.setlocale(locale.LC_ALL, "")
+    except:
+        pass
 
 
 
@@ -770,13 +775,20 @@ class wxPyWidgetTester(wxApp):
 # unloaded, the refcount on __cleanMeUp goes to zero and it calls the
 # wxApp_CleanUp function.
 
-class __wxPyCleanup:
-    def __init__(self):
-        self.cleanup = wxc.wxApp_CleanUp
-    def __del__(self):
-        self.cleanup()
+## class __wxPyCleanup:
+##     def __init__(self):
+##         self.cleanup = wxc.wxApp_CleanUp
+##     def __del__(self):
+##         self.cleanup()
+
+## __cleanMeUp = __wxPyCleanup()
+
+if sys.version[0] == '2':
+    import atexit
+    atexit.register(wxc.wxApp_CleanUp)
+else:
+    sys.exitfunc = wxc.wxApp_CleanUp
 
-__cleanMeUp = __wxPyCleanup()
 
 #----------------------------------------------------------------------------
 #----------------------------------------------------------------------------