summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
7e05f03)
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
// ----------------------------------------------------------------------------
// Ensure subsequent IDs don't clash with this one
// ----------------------------------------------------------------------------
// Ensure subsequent IDs don't clash with this one
-WXDLLIMPEXP_BASE void wxRegisterId(long id);
+WXDLLIMPEXP_BASE void wxRegisterId(wxWindowID id);
-WXDLLIMPEXP_BASE long wxGetCurrentId();
+WXDLLIMPEXP_BASE wxWindowID wxGetCurrentId();
-WXDLLIMPEXP_BASE long wxNewId();
+WXDLLIMPEXP_BASE wxWindowID wxNewId();
// ----------------------------------------------------------------------------
// Various conversions
// ----------------------------------------------------------------------------
// Various conversions
/**
Ensures that Ids subsequently generated by wxNewId() do not clash with the
/**
Ensures that Ids subsequently generated by wxNewId() do not clash with the
-void wxRegisterId(long id);
+void wxRegisterId(wxWindowID 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
// ----------------------------------------------------------------------------
// Id generation
// ----------------------------------------------------------------------------
// Id generation
-static long wxCurrentId = 100;
+static wxWindowID wxCurrentId = 100;
{
// skip the part of IDs space that contains hard-coded values:
if (wxCurrentId == wxID_LOWEST)
{
// skip the part of IDs space that contains hard-coded values:
if (wxCurrentId == wxID_LOWEST)
wxGetCurrentId(void) { return wxCurrentId; }
void
wxGetCurrentId(void) { return wxCurrentId; }
void
+wxRegisterId (wxWindowID id)
{
if (id >= wxCurrentId)
wxCurrentId = id + 1;
{
if (id >= wxCurrentId)
wxCurrentId = id + 1;