From 5e5f878db0541dcb679c8127bc28c249385bc5d2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 Jul 2018 18:54:19 +0200 Subject: [PATCH] Improve wxWindow::FindWindowByName() documentation Mention that the "name" is interpreted as the label if no window with such name is found. Also document that both this and FindWindowByLabel() functions do recurse into child TLWs, unlike FindWindow(). --- interface/wx/window.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/interface/wx/window.h b/interface/wx/window.h index 6cdd4974c8..9d47f7246c 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -3825,7 +3825,9 @@ public: or panel item label. If @a parent is @NULL, the search will start from all top-level frames and dialog boxes; if non-@NULL, the search will be limited to the given window hierarchy. - The search is recursive in both cases. + + The search is recursive in both cases and, unlike with FindWindow(), + recurses into top level child windows too. @see FindWindow() @@ -3842,10 +3844,14 @@ public: and dialog boxes; if non-@NULL, the search will be limited to the given window hierarchy. - The search is recursive in both cases. If no window with such name is found, - FindWindowByLabel() is called. + The search is recursive in both cases and, unlike FindWindow(), + recurses into top level child windows too. - @see FindWindow() + If no window with such name is found, FindWindowByLabel() is called, + i.e. the name is interpreted as (internal) name first but if this + fails, it's internal as (user-visible) label. As this behaviour may be + confusing, it is usually better to use either the FindWindow() overload + taking the name or FindWindowByLabel() directly. @return Window with the given @a name or @NULL if not found. */