//=========================================================================
wxGEditorTabPanel::~wxGEditorTabPanel()
{
-printf ("EED %p ~wxGEditorTabPanel()\n" , this );
+printf ("EED %p ~wxGEditorTabPanel() START \n" , this );
//ED02JUIN2010 _sceneManager->disconnectDrop();
_panelsManager->VerifyLastTabPanel();
delete _panelAUIMgr;
delete _sceneManager;
+ printf ("EED %p ~wxGEditorTabPanel() END\n" , this );
+
}
//=========================================================================
_notebook = _parent->getAuiNotebook();
addNewTab();
_notebook->Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED,wxAuiNotebookEventHandler(wxTabPanelsManager::OnTabChanged),0,this);
+ _notebook->Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE,wxAuiNotebookEventHandler(wxTabPanelsManager::OnTabClose),0,this);
+
}
//=========================================================================
newPanel->setPanelsManager(this);
_panels[_lastId] = newPanel;
_actual = newPanel;
+
_notebook->AddPage(newPanel, tabName ,true);
+
printf("EED wxTabPanelsManager::addNewTab 1\n");
}
+
+
+
+
//=========================================================================
wxAuiNotebook* wxTabPanelsManager::getAuiNotebook()
{
}
//=========================================================================
+
+ void wxTabPanelsManager::OnTabClose(wxAuiNotebookEvent& event)
+ {
+
+ std::cout<<"RaC wxTabPanelsManager::OnTabClose Start... "<<_panels.size()<<std::endl;
+ int index = event.GetSelection();
+
+ if(_panels.size()>0)
+ {
+ wxGEditorTabPanel* tab = (wxGEditorTabPanel*)_notebook->GetPage(index);
+ int id = tab->getPanelId();
+ tab->deleteAllBoxes();
+ _panels.erase(id);
+
+ _notebook->RemovePage(index);
+
+ std::cout<<"RaC wxTabPanelsManager::OnTabClose IMPORTANT. The complete tab is not erased from memory... "<<std::endl;
+ //////////////////////////////
+ // TO FIX . RaC May 2012 - IMPORTANT. The complete tab is not erased from memory.
+ // Only the objects are deleted and the tab is hidden
+ // Execution problems when a tab is deleted using delete or DeletePage
+ // delete tab;
+
+ map<int, wxGEditorTabPanel*>::iterator it = _panels.begin() ;
+ _actual=(*it).second;
+
+ std::cout<<"RaC wxTabPanelsManager::OnTabClose End..."<< std::endl;
+ }
+ }
+
+ //=========================================================================
std::string wxTabPanelsManager::GetCbName()
{
return _actual->GetCbName();