diff --git a/include/wx/window.h b/include/wx/window.h index 6062504215..78b1fd342a 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -170,7 +170,7 @@ public: // generate a control id for the controls which were not given one by // user - static int NewControlId() { return ++ms_lastControlId; } + static int NewControlId() { return --ms_lastControlId; } // moving/resizing // --------------- diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 37d54450d7..153a0408af 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -57,7 +57,7 @@ // static data // ---------------------------------------------------------------------------- -int wxWindowBase::ms_lastControlId = 0; +int wxWindowBase::ms_lastControlId = -2; IMPLEMENT_ABSTRACT_CLASS(wxWindowBase, wxEvtHandler) @@ -152,8 +152,7 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, wxASSERT_MSG( m_isWindow, _T("Init() must have been called before!") ); // generate a new id if the user doesn't care about it - // No, we keep the -1 from now on. RR. -// m_windowId = id == -1 ? NewControlId() : id; + m_windowId = id == -1 ? NewControlId() : id; SetName(name); SetWindowStyleFlag(style);