]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx
#3245 merge vtk8itk4wx3-mingw64 MACOS
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxGEditorTabPanel.cxx
index 030e52aeca52c607b13bbca5e86828f410036150..8ec6907de425efda932d4c5faae9a779cc9bd1c2 100644 (file)
@@ -75,7 +75,7 @@ namespace bbtk
        wxGEditorTabPanel::wxGEditorTabPanel(wxWindow *parent,int id, Factory::Pointer bbtkfactory)
         : wxPanel(parent),wxTextDropTarget()
        {
-               _id=id;
+               _id                             = id;
                _panelAUIMgr    = new wxAuiManager(this);
                _sceneManager   = NULL;
                _actualdo               = states.begin();
@@ -89,7 +89,7 @@ namespace bbtk
        {
 //ED02JUIN2010         _sceneManager->disconnectDrop();
 
-        _panelsManager->VerifyLastTabPanel();
+      _panelsManager->VerifyLastTabPanel();
                //FCY memory leaks
                delete _panelAUIMgr;
                delete _sceneManager;
@@ -98,7 +98,7 @@ namespace bbtk
        //=========================================================================
        void wxGEditorTabPanel::initWxVtkCanvas()
        {
-               wxVtk3DBaseView *baseview = new wxVtk3DBaseView(this);
+               wxVtk3DBaseView *baseview = new wxVtk3DBaseView(this,NULL);
                baseview->Configure();
 //EED 07 juin 2013
                baseview->GetCamera()->SetViewUp (0, 1, 0);
@@ -133,17 +133,19 @@ namespace bbtk
 
           //wxMessageBox(data);
 
-         std::string stdData = crea::wx2std(data);
 
-         //std::cout << "Text drop: '" << stdData << "'" << std::endl;
+
+               int posEndEED=data.find("<EndEED>");
+               wxString data2( data.substr(0,posEndEED) );
+               std::string stdData = crea::wx2std(data2);
 
          if(stdData.substr(0,4) == "box:")
            {
              int posT = stdData.find_first_of(':', 4);
              std::string packageName = stdData.substr(4, posT-4);
              posT = stdData.find_first_not_of(':', posT);
-             std::string boxType = stdData.substr(posT);
-
+             std::string boxType = stdData.substr(posT, data.Len()-posT );
+             
              //std::cout << "box: Package='" << packageName << "' BoxType='" << boxType << "'" <<std::endl;
              /*
                     wxString foo( (data) );
@@ -158,6 +160,8 @@ namespace bbtk
                      result = strtok( NULL, delims );
                      boxType += result;
               */
+           printf("EED wxGEditorTabPanel::OnDropText  <%s>  length %d %d \n", stdData.c_str(), stdData.length(), data.Len() ); 
+           printf("EED wxGEditorTabPanel::OnDropText  <%s>  wxString\n",(const char*)data.mb_str() ); 
              if ( _panelsManager->TryToOpenScriptApplication(packageName,boxType) == false )
                {
                  _sceneManager->createGBlackBox(x,y,packageName, boxType);
@@ -175,8 +179,14 @@ namespace bbtk
                {
                  std::string filePath = stdData.substr(7);
                  std::cout << filePath << ": ";
-                 if(wxFile::Exists(crea::std2wx(filePath)))
+
+                         FILE *ff=fopen(filePath.c_str(),"r");
+                 if(
+//                               wxFile::Exists( crea::std2wx(filePath)) 
+                                 ff!=NULL
+                                 )
                    {
+                                 fclose(ff);
                      std::cout << "File Exists." << std::endl;
                      wxFileName fileToOpen(crea::std2wx(filePath));
 
@@ -337,21 +347,22 @@ namespace bbtk
        unsigned short wxGEditorTabPanel::getUndoState( std::string &stun)
        {
                stun = "Undo";
-               if(states.size()>0)
+               if(sstates.size()>0)
                {
                        if(_actualdo == states.begin() )
+//                     if(sstates.size()==1 )
                        {
-                               
+//                             _sactualdo=sstates.begin();
                                return 0;
-                       }
-                       else
-                       {
+                       } else {
                                stun +=" - ";
-                               stun += _sactualdo->substr(0,(--_sactualdo)->find_last_of("."));
+printf("EED wxGEditorTabPanel::getUndoState This mecanisme is not working  ??????    _sactualdo sstates      _actualdo state \n");             
+//                             stun += _sactualdo->substr(0,(--_sactualdo)->find_last_of("."));                                
                                _sactualdo++;
                                return 1;
                        }
                }
+        return 0;
        }
 
        unsigned short wxGEditorTabPanel::getRedoState( std::string &stre)
@@ -515,6 +526,16 @@ namespace bbtk
        {
            return _sceneManager->GetCategory();
        }
+       //=========================================================================
+               std::string wxGEditorTabPanel::GetMessageKind()
+               {
+           return _sceneManager->GetMessageKind();
+               }
+       //=========================================================================
+     std::string wxGEditorTabPanel::GetMessageLevel()
+               {
+           return _sceneManager->GetMessageLevel();
+               }
 
        //=========================================================================
     void wxGEditorTabPanel::SetCbName(std::string cbName)
@@ -548,6 +569,18 @@ namespace bbtk
     {
         _sceneManager->SetDescription( description );
     }
+
+       //=========================================================================
+               void wxGEditorTabPanel::SetMessageKind(std::string kind)
+               {
+        _sceneManager->SetMessageKind( kind );
+    }
+
+       //=========================================================================    
+    void wxGEditorTabPanel::SetMessageLevel(std::string level)
+               {
+        _sceneManager->SetMessageLevel( level );
+    }
     //=========================================================================
        //DFCH
        void wxGEditorTabPanel::SetFullPath( const std::string& fullpath )