X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FEditorGraphicBBS%2FbbsWxGUIEditorGraphic%2FbbtkwxGUIEditorGraphicBBS.cxx;h=cb3231b87cd2bae070306cc4821441059f8ef675;hb=66d85963bdb3dea88f7d8e8931855d092629b37c;hp=376db524ed548aef9142b2164c4d26e68206d7b3;hpb=03c876d54db1d0e92c9ffeec760ff716b77c58e1;p=bbtkGEditor.git diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index 376db52..cb3231b 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -44,6 +44,9 @@ namespace bbtk wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent) : wxFrame(parent, -1, _T("bbtkGEditor"),wxDefaultPosition, wxSize(1200,800)) { + + printf ("EED %p wxGUIEditorGraphicBBS()\n" , this ); + _frameAUIMgr = new wxAuiManager(this); @@ -80,7 +83,13 @@ namespace bbtk //========================================================================= wxGUIEditorGraphicBBS::~wxGUIEditorGraphicBBS() { - _frameAUIMgr->UnInit(); + printf ("EED %p ~wxGUIEditorGraphicBBS()\n" , this ); + +//EED02JUIN2010 delete _tabsMgr; + + _frameAUIMgr->UnInit(); + + } //========================================================================= @@ -141,7 +150,7 @@ namespace bbtk //========================================================================= void wxGUIEditorGraphicBBS::initMenu() { - // create a menu bar + // Create File menu and its items wxMenu *fileMenu = new wxMenu(); fileMenu->Append(ID_NEW, _T("New diagram"), _T("New")); fileMenu->Append(ID_SAVE_AS_DIAGRAM, _T("Save diagram"), _T("Save diagram")); @@ -155,16 +164,23 @@ namespace bbtk Connect(ID_SAVE_AS_COMPLEXBOX,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnSaveActualComplexBox)); Connect(wxID_EXIT,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnExit)); - // the "About" item should be in the help menu + // Create Help menu and its items + wxMenu *editMenu = new wxMenu; + editMenu->Append(ID_COPY_TO_COMPLEXDIAGRAM, _T("Copy selected to complex box"), _T("Creates a new complex box diagram with selected boxes")); + + Connect(ID_COPY_TO_COMPLEXDIAGRAM,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram)); + + // Create Help menu and its items wxMenu *helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About")); - // now append the freshly created menu to the menu bar... + // Append the created menu to the menu bar wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu, _T("&File")); + menuBar->Append(editMenu, _T("&Edit")); menuBar->Append(helpMenu, _T("&Help")); - // attach this menu bar to the frame + // Attach this menu bar to the frame SetMenuBar(menuBar); } @@ -345,7 +361,10 @@ namespace bbtk #endif //command += ConfigurationFile::GetInstance().Get_bin_path(); - command +="C:/temp/bbtkBIN/RelWithDebInfo//"; +//EED command +="C:/temp/bbtkBIN/RelWithDebInfo//"; +//EED command +="C:/Program Files/CreaTools/bbtk-0.9.5/bin"; + command +="."; + #ifdef MACOSX command += separator + "bbi.app/Contents/MacOS/bbi\" "; @@ -458,7 +477,7 @@ namespace bbtk void wxGUIEditorGraphicBBS::OnSaveActualDiagram(wxCommandEvent& event) { - wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual diagram"),wxEmptyString,wxT("NewDiagram"),wxT("*.bbd"),wxSAVE|wxOVERWRITE_PROMPT); + wxFileDialog * saveFileDialog = new wxFileDialog(this,wxT("Save actual diagram"),wxEmptyString,wxT("NewDiagram"),wxT("*.bbg"),wxSAVE|wxOVERWRITE_PROMPT); if (saveFileDialog->ShowModal() == wxID_OK) { wxString fileName = saveFileDialog->GetPath(); @@ -471,7 +490,7 @@ namespace bbtk // writing file header content += "# ----------------------------------\n"; - content += "# - BBTKGEditor v 1.0 BBD BlackBox Diagram file\n"; + content += "# - BBTKGEditor v 1.0 BBG BlackBox Diagram file\n"; content += "# - "; //EED content += fileName; @@ -512,6 +531,16 @@ namespace bbtk GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_COMPLEXBOX,false); GetMenuBar()->GetMenu(0)->Enable(ID_SAVE_AS_BBS,true); } + + if(_tabsMgr->getNumActualSelectedObjects()>0) + { + GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM,true); + } + else + { + ///TODO Fix the possibility to say from the SceneManager to the GUI to refresh the options + GetMenuBar()->GetMenu(1)->Enable(ID_COPY_TO_COMPLEXDIAGRAM,true); + } } @@ -538,7 +567,7 @@ namespace bbtk void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event) { - wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open diagram"),wxEmptyString,wxT(""),wxT("*.bbd"),wxOPEN|wxFILE_MUST_EXIST); + wxFileDialog * openFileDialog = new wxFileDialog(this,wxT("Open diagram"),wxEmptyString,wxT(""),wxT("*.bbg"),wxOPEN|wxFILE_MUST_EXIST); if (openFileDialog->ShowModal() == wxID_OK) { wxString fileName = openFileDialog->GetPath(); @@ -609,6 +638,13 @@ namespace bbtk //========================================================================= + void wxGUIEditorGraphicBBS::OnCopySelectedToComplexDiagram(wxCommandEvent& event) + { + _tabsMgr->copySelectedBBoxesToComplexDiagram(); + } + + //========================================================================= + void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event) { Close(true);