added a check for allowed id value (bug 690910)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2003-03-24 19:21:08 +00:00
parent da32743f22
commit 925f154dac

View File

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