From 95b1f7b7ea0f300220ee70acfea92c2659cc09c4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 10 Mar 2020 23:34:06 +0100 Subject: [PATCH] Document wxAuiToolBar::DeleteTool() and DeleteByIndex() The behaviour of these functions for the tools containing controls is counter-intuitive but changing it now would silently break existing code working around the current semantics, so just document it instead. See #16552. --- interface/wx/aui/auibar.h | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/interface/wx/aui/auibar.h b/interface/wx/aui/auibar.h index 899b956ff2..a3e23752d7 100644 --- a/interface/wx/aui/auibar.h +++ b/interface/wx/aui/auibar.h @@ -722,8 +722,32 @@ public: void ClearTools(); void Clear(); + + /** + Removes the tool with the given ID from the tool bar. + + Note that if this tool was added by AddControl(), the associated + control is @e not deleted and must either be reused (e.g. by + reparenting it under a different window) or destroyed by caller. + + @param tool_id ID of a previously added tool. + @return @true if the tool was removed or @false otherwise, e.g. if the + tool with the given ID was not found. + */ bool DeleteTool(int tool_id); - bool DeleteByIndex(int tool_id); + + /** + Removes the tool at the given position from the tool bar. + + Note that if this tool was added by AddControl(), the associated + control is @e not deleted and must either be reused (e.g. by + reparenting it under a different window) or destroyed by caller. + + @param idx The index, or position, of a previously added tool. + @return @true if the tool was removed or @false otherwise, e.g. if the + provided index is out of range. + */ + bool DeleteByIndex(int idx); size_t GetToolCount() const; int GetToolPos(int tool_id) const;