diff --git a/wxPython/src/_extras.py b/wxPython/src/_extras.py index 46f127b424..dbee2c12fd 100644 --- a/wxPython/src/_extras.py +++ b/wxPython/src/_extras.py @@ -595,12 +595,7 @@ wxPen = wxPyPen wxScrollbar = wxScrollBar wxPoint2D = wxPoint2DDouble -# Use Python's bool constants if available, make aliases if not -try: - True -except NameError: - True = 1==1 - False = 1==0 +wxPyAssertionError = wxc.wxPyAssertionError # backwards compatibility @@ -611,15 +606,43 @@ NULL = None wxSystemSettings_GetSystemColour = wxSystemSettings_GetColour wxSystemSettings_GetSystemFont = wxSystemSettings_GetFont wxSystemSettings_GetSystemMetric = wxSystemSettings_GetMetric -false = FALSE = False -true = TRUE = True # workarounds for bad wxRTTI names __wxPyPtrTypeMap['wxGauge95'] = 'wxGauge' -wxPyAssertionError = wxc.wxPyAssertionError + +def NewId(): + import warnings + warnings.warn("Use wxNewId instead", DeprecationWarning, 2) + return wxNewId() + +def RegisterId(ID): + import warnings + warnings.warn("Use wxRegisterId instead", DeprecationWarning, 2) + return wxRegisterId(ID) + + + +# Use Python's bool constants if available, make aliases if not +try: + True +except NameError: + True = 1==1 + False = 1==0 + +class _DeprecatedNonBool: + def __init__(self, val, txt): + self.__val = val + self.__txt = txt + def __int__(self): + import warnings + warnings.warn("Use Python's %s instead" % self.__txt, DeprecationWarning, 3) + return self.__val + +TRUE = true = _DeprecatedNonBool(True, 'True') +FALSE = false = _DeprecatedNonBool(False, 'False') #---------------------------------------------------------------------- diff --git a/wxPython/src/misc.i b/wxPython/src/misc.i index 834c805722..8887c653f1 100644 --- a/wxPython/src/misc.i +++ b/wxPython/src/misc.i @@ -511,8 +511,6 @@ public: long wxNewId(); void wxRegisterId(long id); -%name(NewId) long wxNewId(); -%name(RegisterId) void wxRegisterId(long id); long wxGetCurrentId(); void wxBell(); diff --git a/wxPython/src/windows.i b/wxPython/src/windows.i index 4236bcd14f..5b6ccf56da 100644 --- a/wxPython/src/windows.i +++ b/wxPython/src/windows.i @@ -216,6 +216,7 @@ public: void DragAcceptFiles(bool accept); #endif void Enable(bool enable); + void Disable(); // Find child window by ID or name %name(FindWindowById) wxWindow* FindWindow(long id);