From eb5820f93a06c1f844ac90ae8780d41bfbda9aad Mon Sep 17 00:00:00 2001 From: PB Date: Mon, 23 May 2022 18:40:56 +0200 Subject: [PATCH 1/3] Correct Events and Event Handling overview Change "order" to "reverse order" in "... dynamically bound handlers are searched in order of their registration ...". Use better check for C++11 in a code example. Unify whitespace usage in code examples. --- docs/doxygen/overviews/eventhandling.h | 32 +++++++++++++------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/doxygen/overviews/eventhandling.h b/docs/doxygen/overviews/eventhandling.h index 7394832916..0ff6365ae0 100644 --- a/docs/doxygen/overviews/eventhandling.h +++ b/docs/doxygen/overviews/eventhandling.h @@ -315,7 +315,7 @@ In addition to using a method of the object generating the event itself, you can use a method from a completely different object as an event handler: @code -void MyFrameHandler::OnFrameExit( wxCommandEvent & ) +void MyFrameHandler::OnFrameExit(wxCommandEvent&) { // Do something useful. } @@ -324,8 +324,8 @@ MyFrameHandler myFrameHandler; MyFrame::MyFrame() { - Bind( wxEVT_MENU, &MyFrameHandler::OnFrameExit, - &myFrameHandler, wxID_EXIT ); + Bind(wxEVT_MENU, &MyFrameHandler::OnFrameExit, + &myFrameHandler, wxID_EXIT); } @endcode @@ -339,14 +339,14 @@ To use an ordinary function or a static method as an event handler you would write something like this: @code -void HandleExit( wxCommandEvent & ) +void HandleExit(wxCommandEvent&) { // Do something useful } MyFrame::MyFrame() { - Bind( wxEVT_MENU, &HandleExit, wxID_EXIT ); + Bind(wxEVT_MENU, &HandleExit, wxID_EXIT); } @endcode @@ -357,7 +357,7 @@ handler: struct MyFunctor { - void operator()( wxCommandEvent & ) + void operator()(wxCommandEvent&) { // Do something useful } @@ -367,7 +367,7 @@ MyFunctor myFunctor; MyFrame::MyFrame() { - Bind( wxEVT_MENU, myFunctor, wxID_EXIT ); + Bind(wxEVT_MENU, myFunctor, wxID_EXIT); } @endcode @@ -389,14 +389,14 @@ Another common example of a generic functor is boost::function<> or, since C++11, std::function<>: @code -#if __cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(10) +#if wxCHECK_CXX_STD(201103L) using namespace std; using namespace std::placeholders; #else // Pre C++11 compiler using namespace boost; #endif -void MyHandler::OnExit( wxCommandEvent & ) +void MyHandler::OnExit(wxCommandEvent&) { // Do something useful } @@ -405,9 +405,9 @@ MyHandler myHandler; MyFrame::MyFrame() { - function< void ( wxCommandEvent & ) > exitHandler( bind( &MyHandler::OnExit, &myHandler, _1 )); + function exitHandler(bind(&MyHandler::OnExit, &myHandler, _1)); - Bind( wxEVT_MENU, exitHandler, wxID_EXIT ); + Bind(wxEVT_MENU, exitHandler, wxID_EXIT); } @endcode @@ -416,7 +416,7 @@ With the aid of @c bind<>() you can even use methods or functions which don't quite have the correct signature: @code -void MyHandler::OnExit( int exitCode, wxCommandEvent &, wxString goodByeMessage ) +void MyHandler::OnExit(int exitCode, wxCommandEvent&, wxString goodByeMessage) { // Do something useful } @@ -425,10 +425,10 @@ MyHandler myHandler; MyFrame::MyFrame() { - function< void ( wxCommandEvent & ) > exitHandler( - bind( &MyHandler::OnExit, &myHandler, EXIT_FAILURE, _1, "Bye" )); + function exitHandler( + bind(&MyHandler::OnExit, &myHandler, EXIT_FAILURE, _1, "Bye")); - Bind( wxEVT_MENU, exitHandler, wxID_EXIT ); + Bind(wxEVT_MENU, exitHandler, wxID_EXIT); } @endcode @@ -477,7 +477,7 @@ doesn't count as having handled the event and the search continues): checking the static event table entries, so if both a dynamic and a static event handler match the same event, the static one is never going to be used unless wxEvent::Skip() is called in the dynamic one. Also note that - the dynamically bound handlers are searched in order of their registration + the dynamically bound handlers are searched in reverse order of their registration during program run-time, i.e. later bound handlers take priority over the previously bound ones. From 97aae519fa131ef464f04ca33819317541d643eb Mon Sep 17 00:00:00 2001 From: PB Date: Mon, 23 May 2022 19:06:55 +0200 Subject: [PATCH 2/3] Add "events" category to wxEvent-derived classes docs where missing If a wxEvent-derived class documentation lacks "events" category, the class will not appear in the Events class list. The "events" category is still missing in several event classes (e.g., palette events or wxRibbonToolBarEvent), but those lack actual documentation aside from just methods declarations anyway. --- interface/wx/aui/auibar.h | 2 +- interface/wx/html/htmlwin.h | 4 ++-- interface/wx/propgrid/propgrid.h | 2 +- interface/wx/socket.h | 2 +- interface/wx/treelist.h | 3 +++ interface/wx/webrequest.h | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/interface/wx/aui/auibar.h b/interface/wx/aui/auibar.h index b876b46221..50c0f2d272 100644 --- a/interface/wx/aui/auibar.h +++ b/interface/wx/aui/auibar.h @@ -12,7 +12,7 @@ See also @ref overview_aui. @library{wxaui} - @category{aui} + @category{aui,events} */ enum wxAuiToolBarStyle { diff --git a/interface/wx/html/htmlwin.h b/interface/wx/html/htmlwin.h index caaccdef26..8bb41faef8 100644 --- a/interface/wx/html/htmlwin.h +++ b/interface/wx/html/htmlwin.h @@ -559,7 +559,7 @@ wxEventType wxEVT_HTML_LINK_CLICKED; @endEventTable @library{wxhtml} - @category{html} + @category{html,events} */ class wxHtmlLinkEvent : public wxCommandEvent { @@ -592,7 +592,7 @@ public: @endEventTable @library{wxhtml} - @category{html} + @category{html,events} */ class wxHtmlCellEvent : public wxCommandEvent { diff --git a/interface/wx/propgrid/propgrid.h b/interface/wx/propgrid/propgrid.h index 1da72c4a04..b267faa6c2 100644 --- a/interface/wx/propgrid/propgrid.h +++ b/interface/wx/propgrid/propgrid.h @@ -1332,7 +1332,7 @@ public: @endEventTable @library{wxpropgrid} - @category{propgrid} + @category{propgrid,events} */ class wxPropertyGridEvent : public wxCommandEvent { diff --git a/interface/wx/socket.h b/interface/wx/socket.h index 5d52743ba3..ad29c5a56c 100644 --- a/interface/wx/socket.h +++ b/interface/wx/socket.h @@ -479,7 +479,7 @@ public: @endEventTable @library{wxnet} - @category{net} + @category{net,events} @see wxSocketBase, wxSocketClient, wxSocketServer */ diff --git a/interface/wx/treelist.h b/interface/wx/treelist.h index 861787e13b..d6d2aa1b00 100644 --- a/interface/wx/treelist.h +++ b/interface/wx/treelist.h @@ -902,6 +902,9 @@ public: /** Event generated by wxTreeListCtrl. + @category{ctrl,events} + + @since 2.9.3 */ class wxTreeListEvent : public wxNotifyEvent diff --git a/interface/wx/webrequest.h b/interface/wx/webrequest.h index 02631c5a20..ff8f100f42 100644 --- a/interface/wx/webrequest.h +++ b/interface/wx/webrequest.h @@ -788,7 +788,7 @@ public: @since 3.1.5 @library{wxnet} - @category{net} + @category{net,events} @see wxWebRequest */ From 6f135cae70c4c249df8b71e3947d2c26bd2dab58 Mon Sep 17 00:00:00 2001 From: PB Date: Mon, 23 May 2022 20:05:02 +0200 Subject: [PATCH 3/3] Fix mistakenly added "events" category The category was added to wxAuiToolBarStyle instead wxAuiToolBarEvent/ --- interface/wx/aui/auibar.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/wx/aui/auibar.h b/interface/wx/aui/auibar.h index 50c0f2d272..3b6641b310 100644 --- a/interface/wx/aui/auibar.h +++ b/interface/wx/aui/auibar.h @@ -12,7 +12,7 @@ See also @ref overview_aui. @library{wxaui} - @category{aui,events} + @category{aui} */ enum wxAuiToolBarStyle { @@ -150,7 +150,7 @@ enum wxAuiToolBarToolTextOrientation wxAuiToolBarEvent is used for the events generated by @ref wxAuiToolBar. @library{wxaui} - @category{aui} + @category{aui,events} */ class wxAuiToolBarEvent : public wxNotifyEvent {