From ac275a79f43b892b4b5182f91b980ada0c8f4926 Mon Sep 17 00:00:00 2001 From: davila <> Date: Mon, 4 Oct 2010 17:42:52 +0000 Subject: [PATCH] no message --- .../bbsKernelEditorGraphic/GlobalConstants.h | 1 + .../bbtkwxGUIEditorGraphicBBS.cxx | 21 ++++---- .../bbtkwxGUIEditorGraphicBBS.h | 1 + .../wxVtkSceneManager.cxx | 48 +++++++------------ .../bbsWxGUIEditorGraphic/wxVtkSceneManager.h | 2 +- 5 files changed, 32 insertions(+), 41 deletions(-) diff --git a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h index 54244a1..a475fd4 100644 --- a/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h +++ b/lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h @@ -174,6 +174,7 @@ namespace bbtk const int ID_SAVE_AS_COMPLEXBOX = 1011; const int ID_COPY_TO_COMPLEXDIAGRAM = 1012; const int ID_BTNBOX = 1013; + const int ID_HELP_BBEDITOR = 1014; const int wxID_NOTEBOOK = 1013; diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx index c0892ab..592d7d0 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx @@ -182,6 +182,8 @@ namespace bbtk // Create Help menu and its items wxMenu *helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About")); + helpMenu->Append(ID_HELP_BBEDITOR, _T("&Help..."), _T("Help")); + Connect(ID_HELP_BBEDITOR,wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(wxGUIEditorGraphicBBS::OnHelpBBeditor)); // Append the created menu to the menu bar wxMenuBar *menuBar = new wxMenuBar(); @@ -590,21 +592,15 @@ namespace bbtk //========================================================================= - void wxGUIEditorGraphicBBS::OnOpenDiagram(wxCommandEvent& event) { 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(); - ifstream inputStream; - //EED inputStream.open(fileName.c_str()); inputStream.open( (const char*) (fileName.mb_str()) ); - - - _tabsMgr->addNewTab(); _tabsMgr->loadDiagram(inputStream); @@ -618,8 +614,7 @@ namespace bbtk void wxGUIEditorGraphicBBS::OnClickBtnBox(wxCommandEvent& event) { - - BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected(); + BlackBoxDescriptor *bbDes = _pkgBrowser->GetActualSelected(); if (bbDes!=NULL) { std::string typeName = bbDes->GetTypeName(); @@ -694,12 +689,22 @@ namespace bbtk _tabsMgr->copySelectedBBoxesToComplexDiagram(); } + + void wxGUIEditorGraphicBBS::OnHelpBBeditor(wxCommandEvent& event) + { + printf("wxGUIEditorGraphicBBS::OnHelpBBeditor ......\n"); + } + + + //========================================================================= void wxGUIEditorGraphicBBS::OnExit(wxCommandEvent& event) { Close(true); } + + //========================================================================= diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h index 887b7c6..4a608bc 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h @@ -143,6 +143,7 @@ namespace bbtk void OnAddComplexBoxInput(wxCommandEvent& event); void OnAddComplexBoxOutput(wxCommandEvent& event); void OnExit(wxCommandEvent& event); + void OnHelpBBeditor(wxCommandEvent& event); // Edit menu events void OnCopySelectedToComplexDiagram(wxCommandEvent& event); diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx index 3d551fe..3cb95f8 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx @@ -825,22 +825,8 @@ printf("EED wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n"); if(isOverPort==false) { - _worldState=NOTHING_HAPPENS; - //int lastId = _controllers.size()-1; -//EED2Oct2010 GConnectorController *connector = (GConnectorController*)_controllers[_controllers.size()-1]; - GConnectorController *connector = (GConnectorController*)_controllers[_idConnectionInCreation]; - - connector->removeFromScene(); - unregisterController(connector); - _controllers.erase(_controllers.size()-1); - - for(it = _controllers.begin(); it != _controllers.end(); ++it) - { - GObjectController *desc = it->second; - desc->SetActive(true); - desc->getView()->setState(NOTHING_HAPPENS); - desc->getModel()->notifyObservers(_idManager); - } // for + CancelConnection(); + UnSelectBlackBoxes(); } // isOverPort } else { //_worldState @@ -897,19 +883,18 @@ printf("EED wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n"); } //========================================================================= - - bool wxVtkSceneManager::OnRightButtonUp() + void wxVtkSceneManager::CancelConnection() { if(_worldState==INIT_CREATION_CONTOUR) { _worldState=NOTHING_HAPPENS; //int lastId = _controllers.size()-1; - + GConnectorController *connector = (GConnectorController*)_controllers[_idConnectionInCreation]; connector->removeFromScene(); unregisterController(connector); _controllers.erase(_idConnectionInCreation); - + std::map::iterator it; for(it = _controllers.begin(); it != _controllers.end(); ++it) { @@ -917,21 +902,20 @@ printf("EED wxVtkSceneManager::createGComplexBoxOutputPort 900-450\n"); desc->SetActive(true); desc->getView()->setState(NOTHING_HAPPENS); desc->getModel()->notifyObservers(_idManager); - } - } - + } // for + }// if + } + + + //========================================================================= - for (int i = 0; i < (int)_selectedObjects.size(); i++) + bool wxVtkSceneManager::OnRightButtonUp() + { + if(_worldState==INIT_CREATION_CONTOUR) { - int id = _selectedObjects[i]; - GObjectController* cont = _controllers[id]; - cont->SetActive(true); - cont->getView()->setState(NOTHING_HAPPENS); - cont->getModel()->notifyObservers(_idManager); + CancelConnection(); } - - _selectedObjects.clear(); - + UnSelectBlackBoxes(); return true; } diff --git a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h index 82c2052..3fd5a27 100644 --- a/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h +++ b/lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h @@ -233,7 +233,7 @@ namespace bbtk int GetIndexInSelected(int idControler); void UnSelectBlackBoxes(); GObjectController *GetGBlackBoxControlerPointedByMouse(); - + void CancelConnection(); protected: -- 2.45.0