X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FbbtkwxGUIEditorGraphicBBS.cxx;h=ed6f61ff1d8ffdae0e026a46c95ed0c53b3985cb;hb=95b0c39bbfb922f7fb91e87f3459a91ed2323377;hp=7d6beada6e4cf14ab70541b74820a42d2666d89b;hpb=8a680b0e68359ef1d8dc810d776a4f354ffb65e5;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index 7d6bead..ed6f61f 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -47,28 +47,27 @@ namespace bbtk _frameAUIMgr = new wxAuiManager(this); - //std::string datadir( crea::System::GetExecutablePath() ); + /*std::string datadir( crea::System::GetExecutablePath() ); std::string datadir ("."); cout<<"RaC //------------------"<Update(); @@ -85,23 +84,29 @@ namespace bbtk //========================================================================= void wxGUIEditorGraphicBBS::initToolbar() - { - //std::string filename= _dataDir + "/data/icons/wxart_new.xpm"; + { wxBitmap bmp_new(new_xpm); + wxBitmap bmp_run(run_xpm); + wxBitmap bmp_delete(delete_xpm); + wxBitmap bmp_centerview(centerview_xpm); wxToolBar *_toolbar = new wxToolBar(this, wxID_ANY); //Adds a tool btn to the toolbar _toolbar->AddTool(1000,_T("New"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("New tab"), _T("Create a new panel tab")); - _toolbar->AddTool(1001,_T("Execute"),bmp_new, wxNullBitmap, wxITEM_NORMAL,_T("Execute actual diagram"), _T("Execute actual diagram")); + _toolbar->AddTool(1001,_T("Execute"),bmp_run, wxNullBitmap, wxITEM_NORMAL,_T("Execute actual diagram"), _T("Execute actual diagram")); + _toolbar->AddTool(1002,_T("Delete all"),bmp_delete, wxNullBitmap, wxITEM_NORMAL,_T("Delete all boxes"), _T("Delete all boxes")); + _toolbar->AddTool(1003,_T("Center view"),bmp_centerview, wxNullBitmap, wxITEM_NORMAL,_T("Center view"), _T("Center view")); _toolbar->SetMargins( 2, 2 ); _toolbar->Realize(); SetToolBar(_toolbar); // connect command event handlers - Connect(1000,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); - Connect(1001,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnToolLeftClick)); + Connect(1000,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCreateNewTab)); + Connect(1001,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExecuteActualDiagram)); + Connect(1002,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnDeleteAllBoxesActualDiagram)); + Connect(1003,wxEVT_COMMAND_TOOL_CLICKED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCenterViewActualDiagram)); } //========================================================================= @@ -154,14 +159,6 @@ namespace bbtk //================================================================ - void wxGUIEditorGraphicBBS::initPropertiesPanel() - { - _propertiesPanel = new wxPropertiesPanel(this); - //_frameAUIMgr->AddPane(_propertiesPanel,wxAuiPaneInfo().Right().MinSize(200,200).CloseButton(false).Floatable(false)); - } - - //================================================================ - void wxGUIEditorGraphicBBS::DoRegeneratePackageDoc( const std::string& pack ) { std::string mess("Regenerating doc for package '"); @@ -302,13 +299,8 @@ namespace bbtk //========================================================================= - void wxGUIEditorGraphicBBS::executeActualDiagram() + void wxGUIEditorGraphicBBS::executeScript(std::string script) { - std::string script = _tabsMgr->getActualDiagramScript(); - cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<addNewTab(); + } - /***************************************************** - /* HANDLERS - /*****************************************************/ + //========================================================================= - void wxGUIEditorGraphicBBS::OnToolLeftClick(wxCommandEvent& event) + void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event) { - switch (event.GetId()) - { - case 1000 : - _tabsMgr->addNewTab(); - break; + std::string script = _tabsMgr->getActualDiagramScript(); + cout<<"RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"<deleteAllBoxesActualDiagram(); } + //========================================================================= + + void wxGUIEditorGraphicBBS::OnCenterViewActualDiagram(wxCommandEvent& event) + { + _tabsMgr->centerViewActualDiagram(); + } + + //========================================================================= + void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event) { Close(true); } + } // EO namespace bbtk // EOF