From baabb37f8fbd7ac4c3e7504e95e8f5df859f29b2 Mon Sep 17 00:00:00 2001 From: catalinr Date: Wed, 3 Feb 2021 12:10:37 +0200 Subject: [PATCH 1/2] Avoid recommending deprecated wxNewId in the docs --- docs/doxygen/mainpages/const_stdevtid.h | 7 ++++--- docs/doxygen/overviews/eventhandling.h | 3 --- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/doxygen/mainpages/const_stdevtid.h b/docs/doxygen/mainpages/const_stdevtid.h index b3b2fd9bd3..b14132b426 100644 --- a/docs/doxygen/mainpages/const_stdevtid.h +++ b/docs/doxygen/mainpages/const_stdevtid.h @@ -15,8 +15,8 @@ the following two situations: @li when creating a new window you may specify @c wxID_ANY to let wxWidgets assign an unused identifier to it automatically -@li when installing an event handler using either the event table - macros or wxEvtHandler::Connect, +@li when installing an event handler using wxEvtHandler::Bind, + wxEvtHandler::Connect or the event table macros, you may use it to indicate that you want to handle the events coming from any control, regardless of its identifier @@ -27,7 +27,8 @@ wxWidgets also defines a few standard command identifiers which may be used by the user code and also are sometimes used by wxWidgets itself. These reserved identifiers are all in the range between @c wxID_LOWEST and @c wxID_HIGHEST and, accordingly, the user code should avoid defining its -own constants in this range (e.g. by using wxNewId()). +own constants in this range (e.g. by using @c wxID_ANY and retrieving the +control's id after it was created). Refer to @ref page_stockitems "the list of stock items" for the subset of standard IDs which are stock IDs as well. diff --git a/docs/doxygen/overviews/eventhandling.h b/docs/doxygen/overviews/eventhandling.h index d3019de5c7..7394832916 100644 --- a/docs/doxygen/overviews/eventhandling.h +++ b/docs/doxygen/overviews/eventhandling.h @@ -873,9 +873,6 @@ positive. See @ref page_stdevtid for the list of standard identifiers available. You can use wxID_HIGHEST to determine the number above which it is safe to define your own identifiers. Or, you can use identifiers below wxID_LOWEST. -Finally, you can allocate identifiers dynamically using wxNewId() function too. -If you use wxNewId() consistently in your application, you can be sure that -your identifiers don't conflict accidentally. @subsection overview_events_with_mouse_capture Event Handlers and Mouse Capture From bfa4dd01d7895b95bceb36c3555b36cd848c7850 Mon Sep 17 00:00:00 2001 From: catalinr Date: Wed, 3 Feb 2021 12:20:07 +0200 Subject: [PATCH 2/2] Link wxNewId() with wxRegisterId() in the docs --- interface/wx/utils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/interface/wx/utils.h b/interface/wx/utils.h index 1d17b6986e..104eaccae9 100644 --- a/interface/wx/utils.h +++ b/interface/wx/utils.h @@ -482,6 +482,8 @@ int wxFindMenuItemId(wxFrame* frame, const wxString& menuString, Generates an integer identifier unique to this run of the program. + @see wxRegisterId() + @header{wx/utils.h} */ wxWindowID wxNewId();