Use int instead of wxWindowID in wxNewId() and friends.
The functions are available in wxBase builds too, but wx/windowid.h isn't. Rather than always including that header, just use int, for which wxWindowID is a typedef. This keeps the functions available in wxBase for compatibility and is consistent with how IDs are handled in other parts of wxBase, particularly wxEvent. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
1c6a98048b
commit
19c453d0ac
@ -273,13 +273,13 @@ inline bool wxPlatformIs(int platform) { return wxPlatform::Is(platform); }
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Ensure subsequent IDs don't clash with this one
|
// Ensure subsequent IDs don't clash with this one
|
||||||
WXDLLIMPEXP_BASE void wxRegisterId(wxWindowID id);
|
WXDLLIMPEXP_BASE void wxRegisterId(int id);
|
||||||
|
|
||||||
// Return the current ID
|
// Return the current ID
|
||||||
WXDLLIMPEXP_BASE wxWindowID wxGetCurrentId();
|
WXDLLIMPEXP_BASE int wxGetCurrentId();
|
||||||
|
|
||||||
// Generate a unique ID
|
// Generate a unique ID
|
||||||
WXDLLIMPEXP_BASE wxWindowID wxNewId();
|
WXDLLIMPEXP_BASE int wxNewId();
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Various conversions
|
// Various conversions
|
||||||
|
@ -459,7 +459,7 @@ int wxFindMenuItemId(wxFrame* frame, const wxString& menuString,
|
|||||||
|
|
||||||
@header{wx/utils.h}
|
@header{wx/utils.h}
|
||||||
*/
|
*/
|
||||||
wxWindowID wxNewId();
|
int wxNewId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Ensures that Ids subsequently generated by wxNewId() do not clash with the
|
Ensures that Ids subsequently generated by wxNewId() do not clash with the
|
||||||
@ -467,7 +467,7 @@ wxWindowID wxNewId();
|
|||||||
|
|
||||||
@header{wx/utils.h}
|
@header{wx/utils.h}
|
||||||
*/
|
*/
|
||||||
void wxRegisterId(wxWindowID id);
|
void wxRegisterId(int id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Opens the @a document in the application associated with the files of this
|
Opens the @a document in the application associated with the files of this
|
||||||
|
@ -714,9 +714,9 @@ long wxExecute(const wxString& command,
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
// Id generation
|
// Id generation
|
||||||
static wxWindowID wxCurrentId = 100;
|
static int wxCurrentId = 100;
|
||||||
|
|
||||||
wxWindowID wxNewId()
|
int wxNewId()
|
||||||
{
|
{
|
||||||
// skip the part of IDs space that contains hard-coded values:
|
// skip the part of IDs space that contains hard-coded values:
|
||||||
if (wxCurrentId == wxID_LOWEST)
|
if (wxCurrentId == wxID_LOWEST)
|
||||||
@ -725,11 +725,11 @@ wxWindowID wxNewId()
|
|||||||
return wxCurrentId++;
|
return wxCurrentId++;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxWindowID
|
int
|
||||||
wxGetCurrentId(void) { return wxCurrentId; }
|
wxGetCurrentId(void) { return wxCurrentId; }
|
||||||
|
|
||||||
void
|
void
|
||||||
wxRegisterId (wxWindowID id)
|
wxRegisterId (int id)
|
||||||
{
|
{
|
||||||
if (id >= wxCurrentId)
|
if (id >= wxCurrentId)
|
||||||
wxCurrentId = id + 1;
|
wxCurrentId = id + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user