From 18bba7b70be1f225009931937a8a52d342308593 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 Dec 2023 15:01:15 +0100 Subject: [PATCH] Document correct way of handling wxAuiNotebookEvents They need to be handled at wxAuiNotebook level as they are all processed there and don't propagate up to the parent. Closes #24118. --- interface/wx/aui/auibook.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/interface/wx/aui/auibook.h b/interface/wx/aui/auibook.h index c8d6510f78..d00f54140e 100644 --- a/interface/wx/aui/auibook.h +++ b/interface/wx/aui/auibook.h @@ -114,6 +114,9 @@ enum wxAuiNotebookOption Double clicked on the tabs background area. Processes a @c wxEVT_AUINOTEBOOK_BG_DCLICK event. @endEventTable + Please see the note in wxAuiNotebookEvent documentation about handling + these events. + @library{wxaui} @category{aui} */ @@ -712,6 +715,13 @@ public: This class is used by the events generated by wxAuiNotebook. + Please note that most events generated by wxAuiNotebook are handled by the + notebook object itself, i.e. they do _not_ propagate upwards to the + notebook parent window, in spite of being command events. In order to + handle these events you should use wxEvtHandler::Bind() to connect to the + events on the notebook object itself and don't forget to use + wxEvent::Skip() to ensure that the notebook still processes them too. + @beginEventEmissionTable{wxAuiNotebookEvent} @event{EVT_AUINOTEBOOK_PAGE_CLOSE(id, func)} A page is about to be closed. Processes a @c wxEVT_AUINOTEBOOK_PAGE_CLOSE event.