]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/bbtkwxGUIEditorGraphicBBS.cxx
#3249 Change FontSize - Box graphic scale
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / bbtkwxGUIEditorGraphicBBS.cxx
index 4b9c0e5f0abcaefa0877995d2aff861386b46297..dda5bce5d86da8aae7dd4e081701721cb86b6c3f 100644 (file)
@@ -96,8 +96,8 @@ wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent)
        initToolbar();
        initPackageBrowser();
        initTabPanelsManager();
-        // JGGR & CM  initHelpHTMLBrowser();
-        _helpHtmlBrowser = NULL;
+    // JGGR & CM  initHelpHTMLBrowser();
+    _helpHtmlBrowser = NULL;
        CreateStatusBar();
        _frameAUIMgr->Update();
        _actualPkgBrowserBoxName = "";
@@ -107,7 +107,7 @@ wxGUIEditorGraphicBBS::wxGUIEditorGraphicBBS(wxFrame *parent)
        /////////////////////////////////
        /// IMPORTANT!! FOR SAVE&LOAD PROCESSES THE VERSION IS VERY IMPORTANT.
        /// RaC 2012 2nd Hackfest
-       _currentBBGversion="1.4";
+       _currentBBGversion="1.5";
 }
 
 //=========================================================================
@@ -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,
@@ -566,6 +568,11 @@ void wxGUIEditorGraphicBBS::executeScript(std::string script) {
        command += " & ";
 #endif
 
+#ifdef __APPLE__
+    command = "source ~/.bbtk/profile_creatools; "+command;
+#endif
+
+
        printf("RaC wxGUIEditorGraphicBBS::executeScript %s \n", command.c_str());
        system(command.c_str());
 }
@@ -675,18 +682,16 @@ void wxGUIEditorGraphicBBS::OnEditDiagramProperties(wxCommandEvent& event)
 }
 
 //=========================================================================
-
-void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event) {
+void wxGUIEditorGraphicBBS::OnExecuteActualDiagram(wxCommandEvent& event)
+{
        std::string script1 = _tabsMgr->getActualDiagramBBS(true);
        cout << endl << "RaC wxGUIEditorGraphicBBS::executeActualDiagram SCRIPT"
                        << endl << endl;
        cout << script1 << endl;
-
        std::string script2 = _tabsMgr->getActualDiagramBBS(false);
        executeScript(script2);
 }
 
-       
 //=========================================================================
 void wxGUIEditorGraphicBBS::OpenBBS(std::string filePathName, std::string fileName) 
 {
@@ -1558,16 +1563,21 @@ bool wxGUIEditorGraphicBBS::TryToOpenScript(std::string packageName ,std::string
        descriptor      = mapDesc[boxType];
 
        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;
+                       OpenScript(descriptor->GetScriptFileName(),boxType);
+               } // 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
        
        return result;
 }