X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55d99c7a77789ff4904bf96eddca3715eb5af9b9..4455332266b332ca005c3430234f9a2b372b5764:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index c58341994f..14c2493d7d 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -224,8 +224,14 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, _T("wxStaticBox can't be used as a window parent!") ); #endif // wxUSE_STATBOX + // ids are limited to 16 bits under MSW so if you care about portability, + // it's not a good idea to use ids out of this range (and negative ids are + // reserved for wxWindows own usage) + wxASSERT_MSG( id == wxID_ANY || (id >= 0 && id < 32767), + _T("invalid id value") ); + // generate a new id if the user doesn't care about it - m_windowId = id == -1 ? NewControlId() : id; + m_windowId = id == wxID_ANY ? NewControlId() : id; SetName(name); SetWindowStyleFlag(style);