]> Creatis software - bbtkGEditor.git/commitdiff
#3213 bbGEditor Feature New Normal - vtk8itk4wx3-mingw64 MACOS vtk9itk4wx3-macos
authorEduardo Davila <davila@ei-ed-606.creatis.insa-lyon.fr>
Fri, 14 Sep 2018 08:38:31 +0000 (10:38 +0200)
committerEduardo Davila <davila@ei-ed-606.creatis.insa-lyon.fr>
Fri, 14 Sep 2018 08:38:31 +0000 (10:38 +0200)
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxGEditorTabPanel.cxx

index 4b9c0e5f0abcaefa0877995d2aff861386b46297..aca52c92a5597683910234a40a13c550c37bebd9 100644 (file)
@@ -139,7 +139,9 @@ void wxGUIEditorGraphicBBS::initToolbar()
        wxBitmap bmp_redo(redo_xpm);
        wxBitmap bmp_editProperties(editProperties_xpm);
        wxBitmap bmp_showTree(showTree_xpm);
-       wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
+       
+//     wxToolBar *toolbar = new wxToolBar(this, wxID_ANY);
+       wxToolBar *toolbar =    CreateToolBar();
 
        //Adds a tool btn to the toolbar
        toolbar->AddTool(ID_NEW, _T("New"), bmp_new, wxNullBitmap, wxITEM_NORMAL,
@@ -1550,24 +1552,41 @@ bool wxGUIEditorGraphicBBS::TryToOpenScriptComplexBox(std::string packageName ,s
 //=========================================================================
 bool wxGUIEditorGraphicBBS::TryToOpenScript(std::string packageName ,std::string boxType,bool scriptApplication, bool scriptComplexBox)
 {      
+       printf("EED wxGUIEditorGraphicBBS::TryToOpenScript Start\n ");
        Package::Pointer k;
        std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
        BlackBoxDescriptor::Pointer descriptor;
+       printf("EED wxGUIEditorGraphicBBS::TryToOpenScript 1\n ");
        k                       = GetBBTKFactory()->GetPackage(packageName);
+       printf("EED wxGUIEditorGraphicBBS::TryToOpenScript 2\n ");
        mapDesc         = k->GetDescriptorMap();
+       printf("EED wxGUIEditorGraphicBBS::TryToOpenScript 3\n ");
        descriptor      = mapDesc[boxType];
+       printf("EED wxGUIEditorGraphicBBS::TryToOpenScript 3.1  packageName:%s  boxType:%s \n",packageName.c_str(), boxType.c_str() );
+
+       if (descriptor==NULL) printf("EED wxGUIEditorGraphicBBS::TryToOpenScript 3.2\n  AUUCHH ");
+       printf("EED wxGUIEditorGraphicBBS::TryToOpenScript 3.2\n  ");
 
        bool result=false;
-       
-       if (
-               ((descriptor->IsTypeOfScript_Application()==true) && (scriptApplication==true))
-               ||
-               ((descriptor->IsTypeOfScript_ComplexBox()==true) && (scriptComplexBox==true))           
-               )
+descriptor->IsTypeOfScript_Application();      
+       if (descriptor!=NULL)
        {
-               result=true;
-               OpenScript(descriptor->GetScriptFileName(),boxType);
-       }
+               if ( 
+                       ((descriptor->IsTypeOfScript_Application()==true) && (scriptApplication==true))
+                       ||
+                       ((descriptor->IsTypeOfScript_ComplexBox()==true) && (scriptComplexBox==true))           
+                       )
+               {
+                       result=true;
+               printf("EED wxGUIEditorGraphicBBS::TryToOpenScript 4\n ");
+                       OpenScript(descriptor->GetScriptFileName(),boxType);
+               printf("EED wxGUIEditorGraphicBBS::TryToOpenScript 5\n ");
+               } // if descriptor Type
+       } else {
+               printf("EED ERROR wxGUIEditorGraphicBBS::TryToOpenScript >> The descriptor of this box not exists (packageName:%s  boxType:%s) this is not normal\n",packageName.c_str(), boxType.c_str() );
+       }  // if descriptor NULL
+       
+       printf("EED wxGUIEditorGraphicBBS::TryToOpenScript END\n ");
        
        return result;
 }      
index a8e2efb5bdbd7da061e442307e556952a8902752..8ec6907de425efda932d4c5faae9a779cc9bd1c2 100644 (file)
@@ -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);