Use wxWindowID in wxNewId() and related functions.
wxNewId(), wxRegisterId() and wxGetCurrentId() functions all work with window IDs, so they should use the dedicated type. Previously, they worked with long, which is not even the same type (wxWindowID is int), causing implicit type conversion warnings. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -714,9 +714,9 @@ long wxExecute(const wxString& command,
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Id generation
|
||||
static long wxCurrentId = 100;
|
||||
static wxWindowID wxCurrentId = 100;
|
||||
|
||||
long wxNewId()
|
||||
wxWindowID wxNewId()
|
||||
{
|
||||
// skip the part of IDs space that contains hard-coded values:
|
||||
if (wxCurrentId == wxID_LOWEST)
|
||||
@@ -725,11 +725,11 @@ long wxNewId()
|
||||
return wxCurrentId++;
|
||||
}
|
||||
|
||||
long
|
||||
wxWindowID
|
||||
wxGetCurrentId(void) { return wxCurrentId; }
|
||||
|
||||
void
|
||||
wxRegisterId (long id)
|
||||
wxRegisterId (wxWindowID id)
|
||||
{
|
||||
if (id >= wxCurrentId)
|
||||
wxCurrentId = id + 1;
|
||||
|
||||
Reference in New Issue
Block a user