+//=========================================================================
+std::string wxGUIEditorGraphicBBS::getCurrentDiagramCategory()
+{
+ return _tabsMgr->GetCategory();
+}
+
+//=========================================================================
+std::string wxGUIEditorGraphicBBS::getCurrentDiagramMessageKind(){
+ return _tabsMgr->GetMessageKind();
+}
+
+//=========================================================================
+std::string wxGUIEditorGraphicBBS::getCurrentDiagramMessageLevel(){
+ return _tabsMgr->GetMessageLevel();
+}
+
+//=========================================================================
+bool wxGUIEditorGraphicBBS::isCurrentDiagramComplexBox()
+{
+ return _tabsMgr->isActualDiagramComplexBox();
+}
+
+
+//=========================================================================
+void wxGUIEditorGraphicBBS::OpenScript(std::string filePathNameBBS ,std::string boxType)
+{
+ std::string fileName = boxType+".bbg";
+ std::string filePathNameBBG = filePathNameBBS;
+ filePathNameBBG[ filePathNameBBG.length()-1 ] = 'g';
+
+ wxMessageDialog windowMessage1(NULL,_T("The system is going to open a bbg or bbs for you. Be careful if you save this file."), _T("Alert !"), wxOK);
+ windowMessage1.ShowModal();
+
+ if ( Utilities::FileExists( filePathNameBBG ) )
+ {
+ OpenDiagram( filePathNameBBG , fileName );
+ } else {
+ if ( Utilities::FileExists( filePathNameBBS ) )
+ {
+ OpenBBS( filePathNameBBS , fileName );
+ } else {
+ wxMessageDialog windowMessage1(NULL,_T("..ERROR.. loading script bbg/bbs."), _T("Alert !"), wxOK);
+ windowMessage1.ShowModal();
+ } // FileExists BBS
+ } // FieExists BBG
+} //OpenScript
+
+
+
+//=========================================================================
+bool wxGUIEditorGraphicBBS::TryToOpenScriptApplication(std::string packageName ,std::string boxType)
+{
+ return TryToOpenScript(packageName ,boxType, true, false);
+}
+
+//=========================================================================
+bool wxGUIEditorGraphicBBS::TryToOpenScriptComplexBox(std::string packageName ,std::string boxType)
+{
+ return TryToOpenScript(packageName ,boxType, false, true);
+}
+
+
+//=========================================================================
+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;
+descriptor->IsTypeOfScript_Application();
+ if (descriptor!=NULL)
+ {
+ 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;
+}
+