From: Benjamin Williams Date: Tue, 21 Nov 2006 08:53:57 +0000 (+0000) Subject: assert if user tries to add pane with same name X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2a8f8889eb5676b8b606759630f586a47aae7025?ds=sidebyside assert if user tries to add pane with same name git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 3997bf2646..7344576a2d 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -825,9 +825,14 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info) if (!window) return false; + bool already_exists = false; + // check if the pane already exists - if (GetPane(pane_info.window).IsOk()) - return false; + if (!pane_info.name.empty() && GetPane(pane_info.name).IsOk()) + { + wxFAIL_MSG(wxT("A pane with that name already exists in the manager!")); + already_exists = true; + } // if the new pane is docked then we should undo maximize if (pane_info.IsDocked()) @@ -840,8 +845,9 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info) // set the pane window pinfo.window = window; + // if the pane's name identifier is blank, create a random string - if (pinfo.name.empty()) + if (pinfo.name.empty() || already_exists) { pinfo.name.Printf(wxT("%08lx%08x%08x%08lx"), ((unsigned long)pinfo.window) & 0xffffffff,