Deprecated NewId and RegisterId

Added missing Disable method


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@19487 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-03-05 04:08:08 +00:00
parent ba8a84c9d1
commit 92fea4048b
3 changed files with 33 additions and 11 deletions

View File

@@ -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')
#----------------------------------------------------------------------

View File

@@ -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();

View File

@@ -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);