From: Václav Slavík Date: Fri, 5 Nov 2004 21:10:45 +0000 (+0000) Subject: make sure that wxNewId() doesn't return standard ID's value X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c838b68e832831f6032fc5ad57f5d0ba9aba7b8c make sure that wxNewId() doesn't return standard ID's value git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30302 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 9cf7ef1ff6..5e25ae4024 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -547,10 +547,13 @@ bool wxYieldIfNeeded() // Id generation static long wxCurrentId = 100; -long -wxNewId (void) +long wxNewId() { - return wxCurrentId++; + // skip the part of IDs space that contains hard-coded values: + if (wxCurrentId == wxID_LOWEST) + wxCurrentId = wxID_HIGHEST + 1; + + return wxCurrentId++; } long