]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx
It is possible to center the view to the original point
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxGEditorTabPanel.cxx
index 93653067a8b58e6dfb875614cd0d30aeb10fa1cb..97a3d3abc45cd02e31d9e5e224f04fb96707c1d9 100644 (file)
@@ -35,7 +35,7 @@ Version:   $Revision$
 
 
 #include "wxGEditorTabPanel.h"
-
+#include "creaWx.h"
 
 namespace bbtk
 {
@@ -45,7 +45,7 @@ namespace bbtk
        }
 
        //=========================================================================
-       wxGEditorTabPanel::wxGEditorTabPanel(wxWindow *parent,int id):wxPanel(parent)
+       wxGEditorTabPanel::wxGEditorTabPanel(wxWindow *parent,int id):wxPanel(parent),wxTextDropTarget()
        {
                _id=id;
                _panelAUIMgr = new wxAuiManager(this);
@@ -57,6 +57,7 @@ namespace bbtk
        //=========================================================================
        wxGEditorTabPanel::~wxGEditorTabPanel()
        {
+               _sceneManager->disconnectDrop();
        }
        
        //=========================================================================
@@ -64,7 +65,8 @@ namespace bbtk
        {
                wxVtk3DBaseView *baseview = new wxVtk3DBaseView(this);
                baseview->Configure();
-               _sceneManager=new wxVtkSceneManager(baseview,_id);
+
+               _sceneManager=new wxVtkSceneManager(this,baseview,_id);
 
                _panelAUIMgr->AddPane((wxWindow*)baseview->GetWxVTKRenderWindowInteractor(),wxAuiPaneInfo().Fixed().CenterPane());
                _panelAUIMgr->Update();
@@ -74,10 +76,80 @@ namespace bbtk
 
        bool wxGEditorTabPanel::OnDropText(wxCoord x, wxCoord y, const wxString& data)
        {
+               std::string packageName="";
+               std::string boxName="";
+
+               wxString foo( (data) );
+               char str[150];
+               strcpy( str, (const char*)foo.mb_str(wxConvUTF8) );
+
+               char delims[] = ":";
+                char *result = NULL;
+                result = strtok( str, delims );
+                packageName += result;
+                
+                result = strtok( NULL, delims );
+                boxName += result;
+                
+               _sceneManager->createGBlackBox(x,y,packageName, boxName);
 
-               cout<<"RaC DyD:"<<data<<" x:"<<x<<" y:"<<y<<endl;
          return true;
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::setPanelsManager(wxTabPanelsManager* panelsManager)
+       {
+               _panelsManager = panelsManager;
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::displayBlackBoxInfo(std::string packageName, std::string boxName)
+       {
+               _panelsManager->displayBlackBoxInfo(packageName,boxName);
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::updateStatusBar(std::string textStatus)
+       {
+               _panelsManager->updateStatusBar(textStatus);
+       }
+
+       //=========================================================================
+
+       std::string wxGEditorTabPanel::getDiagramScript()
+       {
+               return _sceneManager->getDiagramScript();
+       }
+
+       //=========================================================================
 
+       void wxGEditorTabPanel::editBlackBox(GBlackBoxModel *bbmodel)
+       {
+               _panelsManager->editBlackBox(bbmodel);
+       }
+
+       //=========================================================================
+       
+       void wxGEditorTabPanel::editDiagramParameters(wxVtkSceneManager* scene)
+       {
+               _panelsManager->editDiagramParameters(scene);
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::deleteAllBoxes()
+       {
+               _sceneManager->deleteAllBoxes();
+       }
+
+       //=========================================================================
+
+       void wxGEditorTabPanel::centerView()
+       {
+               _sceneManager->centerView();
        }
 
        //=========================================================================
@@ -85,4 +157,3 @@ namespace bbtk
 }  // EO namespace bbtk
 
 // EOF
-