+//=========================================================================
+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)
+{
+ Package::Pointer k;
+ std::map< std::string, BlackBoxDescriptor::Pointer> mapDesc;
+ BlackBoxDescriptor::Pointer descriptor;
+ k = GetBBTKFactory()->GetPackage(packageName);
+ mapDesc = k->GetDescriptorMap();
+ descriptor = mapDesc[boxType];
+
+ bool result=false;
+
+ if (
+ ((descriptor->IsTypeOfScript_Application()==true) && (scriptApplication==true))
+ ||
+ ((descriptor->IsTypeOfScript_ComplexBox()==true) && (scriptComplexBox==true))
+ )
+ {
+ result=true;
+ OpenScript(descriptor->GetScriptFileName(),boxType);
+ }
+
+ return result;
+}
+