diff --git a/include/wx/utils.h b/include/wx/utils.h index 099530b3d0..8e0996f24a 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -15,6 +15,7 @@ // headers // ---------------------------------------------------------------------------- +#include "wx/windowid.h" #include "wx/object.h" #include "wx/list.h" #include "wx/filefn.h" @@ -274,13 +275,13 @@ inline bool wxPlatformIs(int platform) { return wxPlatform::Is(platform); } // ---------------------------------------------------------------------------- // Ensure subsequent IDs don't clash with this one -WXDLLIMPEXP_BASE void wxRegisterId(int id); +WXDLLIMPEXP_BASE void wxRegisterId(wxWindowID id); // Return the current ID -WXDLLIMPEXP_BASE int wxGetCurrentId(); +WXDLLIMPEXP_BASE wxWindowID wxGetCurrentId(); // Generate a unique ID -WXDLLIMPEXP_BASE int wxNewId(); +WXDLLIMPEXP_BASE wxWindowID wxNewId(); // ---------------------------------------------------------------------------- // Various conversions diff --git a/interface/wx/utils.h b/interface/wx/utils.h index 6b508f9686..9b7336d3e6 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -484,7 +484,7 @@ int wxFindMenuItemId(wxFrame* frame, const wxString& menuString, @header{wx/utils.h} */ -int wxNewId(); +wxWindowID wxNewId(); /** Ensures that Ids subsequently generated by wxNewId() do not clash with the @@ -492,7 +492,7 @@ int wxNewId(); @header{wx/utils.h} */ -void wxRegisterId(int id); +void wxRegisterId(wxWindowID id); /** Opens the @a document in the application associated with the files of this diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index a3acd27b51..33eb302186 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -697,9 +697,9 @@ long wxExecute(const wxString& command, // ---------------------------------------------------------------------------- // Id generation -static int wxCurrentId = 100; +static wxWindowID wxCurrentId = 100; -int wxNewId() +wxWindowID wxNewId() { // skip the part of IDs space that contains hard-coded values: if (wxCurrentId == wxID_LOWEST) @@ -708,11 +708,11 @@ int wxNewId() return wxCurrentId++; } -int +wxWindowID wxGetCurrentId(void) { return wxCurrentId; } void -wxRegisterId (int id) +wxRegisterId (wxWindowID id) { if (id >= wxCurrentId) wxCurrentId = id + 1;