Added a version save isinsnace function

Added wxPoint2DDouble


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-12-10 22:37:10 +00:00
parent 9b126063b3
commit ef84703240
11 changed files with 172 additions and 48 deletions

View File

@@ -587,7 +587,7 @@ wxColor = wxColour
wxNamedColor = wxNamedColour
wxPen = wxPyPen
wxScrollbar = wxScrollBar
wxPoint2D = wxPoint2DDouble
# backwards compatibility
wxNoRefBitmap = wxBitmap
@@ -601,6 +601,7 @@ wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric
wxPyAssertionError = wxc.wxPyAssertionError
#----------------------------------------------------------------------
# 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.
@@ -661,6 +662,18 @@ def wxPyTypeCast(obj, typeStr):
theObj.thisown = obj.thisown
return theObj
#----------------------------------------------------------------------------
# An isinstance for Pythons < 2.2 that can check a sequence of class objects
# like the one in 2.2 can.
def wxPy_isinstance(obj, klasses):
import types
if sys.version[:3] < "2.2" and type(klasses) in [types.TupleType, types.ListType]:
for klass in klasses:
if isinstance(obj, klass): return true
return false
else:
return isinstance(obj, klasses)
#----------------------------------------------------------------------------
_wxCallAfterId = None