No changes, just slightly simplify the tool insertion code.

Added a helper DoInsertNewTool() function to avoid code duplication and ensure
that we never forget to delete a new tool if inserting it into the toolbar
failed.

Also explicitly document that the tool passed to the public InsertTool() is
not owned by the toolbar and so must be deleted by the caller if its insertion
failed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62846 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-12-10 02:59:02 +00:00
parent 960615f410
commit 2600776164
3 changed files with 23 additions and 43 deletions

View File

@@ -533,6 +533,10 @@ public:
You must call Realize() for the change to take place.
@see AddTool(), InsertControl(), InsertSeparator()
@return The newly inserted tool or @NULL on failure. Notice that with
the overload taking @a tool parameter the caller is responsible for
deleting the tool in the latter case.
*/
wxToolBarToolBase* InsertTool(size_t pos, int toolId,
const wxBitmap& bitmap1,