X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cdf14688f51fa5a242df70f86c7af229fe64fd4f..922ba68045d84789ab1dfceb4d1aa1b6e2c5e810:/wxPython/src/_extras.py diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 48bdc72a0d..f841b51f64 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -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) @@ -579,12 +581,7 @@ NULL = None # For backwards compatibility only. You should really be wxColor = wxColour wxNamedColor = wxNamedColour - -wxPyListCtrlPtr = wxListCtrlPtr -wxPyTreeCtrlPtr = wxTreeCtrlPtr -wxGenericDragImagePtr = wxDragImagePtr -wxPyProcessPtr = wxProcessPtr - +wxPen = wxPyPen # backwards compatibility wxNoRefBitmap = wxBitmap @@ -592,6 +589,7 @@ wxPyDefaultPosition = wxDefaultPosition wxPyDefaultSize = wxDefaultSize +#---------------------------------------------------------------------- # 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: @@ -601,6 +599,19 @@ except: pass + +#---------------------------------------------------------------------- +# wxWindows version numbers. wxPython version is in __version__. + +wxMAJOR_VERSION = wxc.wxMAJOR_VERSION +wxMINOR_VERSION = wxc.wxMINOR_VERSION +wxRELEASE_NUMBER = wxc.wxRELEASE_NUMBER +wxVERSION_STRING = wxc.wxVERSION_STRING +wxVERSION_NUMBER = wxc.wxVERSION_NUMBER + +wxVERSION = (wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) + + #---------------------------------------------------------------------- # This helper function will take a wxPython object and convert it to # another wxPython object type. This will not be able to create objects @@ -628,7 +639,8 @@ def wxPyTypeCast(obj, typeStr): theClass = globals()[typeStr+"Ptr"] typeStr = __wxPyPtrTypeMap.get(typeStr, typeStr) if hasattr(obj, "this"): - if obj.__class__ is theClass: # if already the right type then just return it + # if already the right type then just return it + if isinstance(obj, theClass) or obj.__class__ is theClass: return obj newPtr = ptrcast(obj.this, typeStr+"_p") else: