]> Creatis software - bbtkGEditor.git/commitdiff
no message
authordavila <>
Mon, 4 Oct 2010 17:42:52 +0000 (17:42 +0000)
committerdavila <>
Mon, 4 Oct 2010 17:42:52 +0000 (17:42 +0000)
lib/EditorGraphicBBS/bbsKernelEditorGraphic/GlobalConstants.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.h
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.h

index 54244a1cb464a7d36e52ba98806f6c94d381e914..a475fd4764f982a8ba60e2394af637476f0e6365 100644 (file)
@@ -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;
index c0892ab522855bebcf1a574512b952a8ee03b38a..592d7d01ebbd795038e2019a62a01e11a125022c 100644 (file)
@@ -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);
        }
+       
+
 
        //=========================================================================
 
index 887b7c6f98af67a6b58c2a0a8a5192667baf2649..4a608bcedaeb0469b7588a04651b0b5ca5a9c217 100644 (file)
@@ -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);
index 3d551feec6900e36cdf8fc5cd8aee482b94fecc2..3cb95f86f21e22778fb95e3f97f47a42029d7e57 100644 (file)
@@ -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<int, GObjectController*>::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;
        }
 
index 82c2052fc019088b46ccc983d2276c95ed5a13e0..3fd5a2764d053ae5691efd20171da84dadb392ee 100644 (file)
@@ -233,7 +233,7 @@ namespace bbtk
         int GetIndexInSelected(int idControler);
         void UnSelectBlackBoxes();
         GObjectController *GetGBlackBoxControlerPointedByMouse();
-
+               void CancelConnection();
 
        protected: