const int ID_RUN = 1003;
const int ID_DELETEALL = 1004;
const int ID_CENTERVIEW = 1005;
+
+ const int wxID_NOTEBOOK = 1010;
}
// namespace bbtk
#endif
void wxVtkSceneManager::disconnectDrop()
{
_baseView->GetWxVTKRenderWindowInteractor()->SetDropTarget(NULL);
- }
+ }
//=========================================================================
else if(control->getGObjectType()==GCONNECTOR)
{
GConnectorModel *conMod = (GConnectorModel*)control->getModel();
- cout<<"RaC wxVtkSceneManager::deleteObject id:"<<id<<" modelId:" <<conMod->getObjectId()<<endl;
controllersToRemove.push_back(conMod->getObjectId());
}
//=========================================================================
void wxGUIEditorGraphicBBS::initTabPanelsManager()
{
- _notebook = new wxAuiNotebook(this,wxID_ANY,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON);
+ _notebook = new wxAuiNotebook(this,wxID_NOTEBOOK,wxDefaultPosition,wxDefaultSize,wxAUI_NB_TOP|wxAUI_NB_TAB_MOVE|wxAUI_NB_CLOSE_ON_ACTIVE_TAB|wxAUI_NB_TAB_FIXED_WIDTH|wxAUI_NB_WINDOWLIST_BUTTON);
_tabsMgr = new wxTabPanelsManager(this);
_frameAUIMgr->AddPane(_notebook,wxAuiPaneInfo().CenterPane());
#include "wxTabPanelsManager.h"
#include "wxBlackBoxEditionDialog.h"
#include "wxVtkSceneManager.h"
+#include "GlobalConstants.h"
//#include "C:\RaC\CREATIS\bbtkGEditor\data\icons\wxart_new.xpm" // JPR
#include "wxart_new.xpm" // JPR
namespace bbtk
{
+
//=========================================================================
wxGEditorTabPanel::wxGEditorTabPanel()
{
_id=id;
_panelAUIMgr = new wxAuiManager(this);
_sceneManager = NULL;
-
initWxVtkCanvas();
}
//=========================================================================
+ int wxGEditorTabPanel::getPanelId()
+ {
+ return _id;
+ }
+
+ //=========================================================================
+
} // EO namespace bbtk
// EOF
void centerView();
void saveDiagram(std::string &content);
void loadDiagram(ifstream &inputStream);
+ int getPanelId();
//=========================================================================
_lastId = 0;
_notebook = _parent->getAuiNotebook();
addNewTab();
+ _notebook->Connect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED,wxAuiNotebookEventHandler(wxTabPanelsManager::OnTabChanged),0,this);
}
//=========================================================================
//=========================================================================
void wxTabPanelsManager::addNewTab()
{
- _lastId++;
-
+ _lastId++;
wxGEditorTabPanel *newPanel = new wxGEditorTabPanel(_notebook,_lastId);
newPanel->setPanelsManager(this);
_panels[_lastId]=newPanel;
_actual = newPanel;
-
_notebook->AddPage(newPanel,_T("Diagram"),true);
}
//=========================================================================
+ void wxTabPanelsManager::OnTabChanged(wxAuiNotebookEvent& event)
+ {
+ int index = event.GetSelection();
+ wxGEditorTabPanel* tab =(wxGEditorTabPanel*)_notebook->GetPage(index);
+ int id = tab->getPanelId();
+ _actual = _panels[id];
+ }
+
+ //=========================================================================
+
+
} // EO namespace bbtk
// EOF
class wxGEditorTabPanel;
class wxGUIEditorGraphicBBS;
- class wxTabPanelsManager
+ class wxTabPanelsManager : public wxEvtHandler
{
public:
wxTabPanelsManager(wxGUIEditorGraphicBBS *parent);
void centerViewActualDiagram();
void saveActualDiagram(std::string &content);
void loadDiagram(ifstream &inputStream);
+
+ void OnTabChanged(wxAuiNotebookEvent& event);
private:
** The map
*/
wxGUIEditorGraphicBBS *_parent;
- map<int, wxPanel*> _panels;
+ map<int, wxGEditorTabPanel*> _panels;
wxGEditorTabPanel* _actual;
wxAuiNotebook *_notebook;
int _lastId;