/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : ScsGuiinterface.pkg */ /* Version : 20 juin 2000 */ /* Main GUI functions */ /* */ /***************************************************************************************/ /*************************************************************************************** GRAPHIC DRESSING EXTENSION put here because need utils.pkg functions not loaded by module editors ! ***************************************************************************************/ fun GD_FillCompCombo (compCombo, list, pos) = if list == nil then pos else ( _ADDcompCombo compCombo pos [hd list nil]; GD_FillCompCombo compCombo tl list pos+1 ) ;; fun GRAPHICDRESSING_FillCompCombo (compCombo, list) = if list == nil then 0 else ( GD_FillCompCombo compCombo list 0; _SETcompComboClicked compCombo 0; nil ) ;; fun GD_FillCompList (compList, list, pos) = if list == nil then pos else ( _ADDcompList compList pos [hd list nil]; GD_FillCompList compList tl list pos+1 ) ;; fun GRAPHICDRESSING_FillCompList (compList, list) = _RSTcompList compList; if list == nil then 0 else ( GD_FillCompList compList list 0; nil ) ;; fun GD_ExtractLastName (file, param) = list_last_element splitFilePath file ;; fun GD_ExtractLastName2 (file, param) = strcat GD_ExtractLastName file param "/" ;; var SELECT_DIALOG_BOX_OPEN = 0;; var SELECT_DIALOG_BOX_SAVE = 1;; fun GD_SelectDialogBoxFillPath (compList, path) = let quicksort (apply_on_list_with_return (_listofsubdir path) @GD_ExtractLastName2 nil) @filesCompare -> subDirs in GRAPHICDRESSING_FillCompList compList if (splitFilePath path) == nil then subDirs else ".."::subDirs ;; fun GD_SelectDialogBoxType (typeData) = let typeData -> [comboTYPE typeList] in let _GETcompComboClicked comboTYPE -> [pos _] in ( if pos == nil then set pos = 0 else nil; nth_list typeList pos ) ;; fun GD_SelectDialogBoxFillFile (compList, path, typeData) = let GD_SelectDialogBoxType typeData -> secondTypeList in GRAPHICDRESSING_FillCompList compList quicksort (findFileType (apply_on_list_with_return (_listoffiles path) @GD_ExtractLastName nil) secondTypeList) @filesCompare ;; fun GD_SelectDialogBoxCBreturn (cont, val, result, callback) = let callback -> [funcallback userparam] in ( _DScontainer cont; _freememory; /* MAC ICI libération de ressources */ exec funcallback with [val result userparam] ) ;; fun GD_SelectDialogBoxCBoverwrite (comprollover, param, posx, posy, btn, mask) = let param -> [ cont retval param2 ] in ( if retval == GDBOX_YES then exec @GD_SelectDialogBoxCBreturn with param2 else nil; _DScontainer cont; _freememory /* MAC ICI libération de ressources */ ) ;; fun GUI_FileNotFound (cont, filename) = GRAPHICDRESSING_MessageBox cont (_locSCS "File-Not-Found-Title" nil) nil (_locSCS "File-Not-Found" filename::nil) ;; fun GD_SelectDialogBoxCBend (comprollover, param, posx, posy, btn, mask) = let param -> [cont val textPATH textFILE callback selection type] in let if val then let _GETcompText textFILE -> file in if IsEmptyString file then nil else let GD_SelectDialogBoxType type -> typeList in ( if compareEndStringList file typeList then nil else set file = strcat file hd typeList; let _GETcompText textPATH -> path in ( if !(IsEmptyString path) && !(compareEndString path "/") then set path = strcat path "/" else nil; strcat path file ) ) else "" -> result in if result == nil then nil else if val then if selection == SELECT_DIALOG_BOX_OPEN then if (_checkpack result) == nil then ( GUI_FileNotFound cont result; nil ) else GD_SelectDialogBoxCBreturn cont val result callback else if (_checkpack result) != nil then ( GRAPHICDRESSING_ChildDialogBox cont (_locSCS "warning-title" nil) (_locSCS "warning-already-exist" nil) (_locSCS "warning-confirm-overwrite" result::nil) GDBOXFLAGS_YESNO @GD_SelectDialogBoxCBoverwrite [cont val result callback]; nil ) else GD_SelectDialogBoxCBreturn cont val result callback else GD_SelectDialogBoxCBreturn cont val result callback ;; fun GD_SelectDialogBoxCBfile (complist, param, index) = let param -> [cont textFILE] in let _GETcompListValue complist index -> [val _] in ( _SETcompText textFILE val nil nil CT_NOCHANGE; _PAINTcontainer cont ) ;; fun GD_SelectDialogBoxCBfileOk (complist, param, index) = let param -> [cont textFILE textPATH callbackdata selection type] in let _GETcompListValue complist index -> [val _] in ( _SETcompText textFILE val nil nil CT_NOCHANGE; _PAINTcontainer cont; GD_SelectDialogBoxCBend nil [cont 1 textPATH textFILE callbackdata selection type] 0 0 nil nil ) ;; fun GD_SelectDialogBoxCBpath (complist, param, index) = let param -> [cont textPATH textFILE listFILE type] in let _GETcompText textPATH -> path in let _GETcompListValue complist index -> [val _] in let if !strcmp val ".." then let list_without_last_element splitFilePath path -> tmpPath in if tmpPath == nil then "" else strcat (lineBuildSeparator tmpPath "/") "/" else strcat path val -> newPath in ( _SETcompText textPATH newPath nil nil CT_END; GD_SelectDialogBoxFillPath complist newPath; GD_SelectDialogBoxFillFile listFILE newPath type; _PAINTcontainer cont ) ;; fun GD_SelectDialogBoxCBpathText (comptext, param, valid, text) = let param -> [cont listPATH listFILE type] in ( if !(IsEmptyString text) && compareEndString text "/" then nil else ( if IsEmptyString text then set text = "" else set text = strcat text "/"; _SETcompText comptext text nil nil CT_NOCHANGE ); GD_SelectDialogBoxFillPath listPATH text; GD_SelectDialogBoxFillFile listFILE text type; _PAINTcontainer cont ) ;; fun GD_SelectDialogBoxCBtype (compcombo, param, pos) = let param -> [cont textPATH listFILE type] in ( GD_SelectDialogBoxFillFile listFILE _GETcompText textPATH type; _PAINTcontainer cont ) ;; /* File partition selection dialog box : parameter : - channel - father container - dialog box title string - callback function : fun [I S] U0 -> first parameter true if ok ! false otherwise ; second parameter is the full file path - extension file type list of list - extension file type list text - initial path - user param - selection type : SELECT_DIALOG_BOX_OPEN or SELECT_DIALOG_BOX_SAVE */ fun GRAPHICDRESSING_SelectDialogBox (chan, fathercont, sTitle, funcallback, typeList, typeTextList, path, userparam, selection) = let _GETscreenSize -> [wscreen hscreen] in let [wscreen/3 hscreen/3]-> [wboxtmp hboxtmp] in let if wboxtmp < 350 then 350 else wboxtmp -> wbox in let if hboxtmp < 290 then 290 else hboxtmp -> hbox in let GRAPHICDRESSING_CRcontainer chan fathercont [wboxtmp hboxtmp wbox hbox] [wbox hbox wbox hbox] GD_DEFAULT_BACKGROUNDCOLOR sTitle GD_FONT_BOLD [GD_WINDOWS_TITLE_COLOR1 0 1 0x50] GDWIN_CLOSE_BUTTON|GDWIN_BORDERS [nil nil nil] -> [cont compTitle compMin compMax compClose _] in let (wbox-120)/2 -> freeW in let THEME_getParamsByTheme GD_THEME "DBOX_LOGO" -> [path1 _ _ _ _ _ _ _ _ ]in let exec GD_FUNCTIONHANDLER_LOADBITMAP with [path1 chan] -> dboxlogo in ( if path == nil then set path = "" else nil; _CRcompBitmap chan cont nil [10 40] OBJ_ENABLE|OBJ_VISIBLE GD_DEFAULT_HANDLEDEVENTS dboxlogo 0 0 85 235; GRAPHICDRESSING_CRcompText chan cont nil [100 40] OBJ_ENABLE|OBJ_VISIBLE|CT_CENTER|CT_LABEL|CT_WORDWRAP GD_DEFAULT_HANDLEDEVENTS freeW 20 (GD_ExecLocaleFunction "text-PATH" nil) GD_FONT_NORMAL [GD_DEFAULT_TEXT_COLOR nil 0 0] [GD_DEFAULT_TEXT_HIGHLIGHT_COLOR 50]; GRAPHICDRESSING_CRcompText chan cont nil [110+freeW 40] OBJ_ENABLE|OBJ_VISIBLE|CT_CENTER|CT_LABEL|CT_WORDWRAP GD_DEFAULT_HANDLEDEVENTS freeW 20 (GD_ExecLocaleFunction "text-FILE" nil) GD_FONT_NORMAL [GD_DEFAULT_TEXT_COLOR nil 0 0] [GD_DEFAULT_TEXT_HIGHLIGHT_COLOR 50]; GRAPHICDRESSING_CRcompText chan cont nil [120 hbox-77] OBJ_ENABLE|OBJ_VISIBLE|CT_CENTER|CT_LABEL|CT_WORDWRAP GD_DEFAULT_HANDLEDEVENTS 80 20 (GD_ExecLocaleFunction "text-FILETYPE" nil) GD_FONT_NORMAL [GD_DEFAULT_TEXT_COLOR nil 0 0] [GD_DEFAULT_TEXT_HIGHLIGHT_COLOR 50]; let (wbox-100-160)/3 -> bspace in let GRAPHICDRESSING_CRcompRollOverWithText chan cont nil [100+bspace hbox-40] OBJ_VISIBLE|OBJ_ENABLE OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE 80 25 GD_FONT_NORMAL (GD_ExecLocaleFunction "buttonname-OK" nil) GD_DEFAULT_TEXT_BUTTON_COLOR -> buttonOK in let GRAPHICDRESSING_CRcompRollOverWithText chan cont nil [100+2*bspace+80 hbox-40] OBJ_VISIBLE|OBJ_ENABLE OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE 80 25 GD_FONT_NORMAL (GD_ExecLocaleFunction "buttonname-CANCEL" nil) GD_DEFAULT_TEXT_BUTTON_COLOR -> buttonCANCEL in let GRAPHICDRESSING_CRcompText chan cont nil [100 55] OBJ_ENABLE|OBJ_VISIBLE|CT_EDITLINE OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE freeW 20 nil GD_FONT_NORMAL [GD_DEFAULT_TEXT_COLOR nil 0 0] [GD_DEFAULT_TEXT_HIGHLIGHT_COLOR 50] -> textPATH in let GRAPHICDRESSING_CRcompText chan cont nil [110+freeW 55] OBJ_ENABLE|OBJ_VISIBLE|CT_EDITLINE OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE freeW 20 nil GD_FONT_NORMAL [GD_DEFAULT_TEXT_COLOR nil 0 0] [GD_DEFAULT_TEXT_HIGHLIGHT_COLOR 50] -> textFILE in let GRAPHICDRESSING_CRcompList chan cont nil [100 80] OBJ_ENABLE|OBJ_VISIBLE|LST_LEFT|LST_HIGHLIGHT_SELECTED OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE freeW hbox-170 10 LST_VERTICAL GD_FONT_NORMAL 0 [GD_COMPLIST_TEXT_COLOR nil 0 0] [GD_COMPLIST_HIGHLIGHT_COLOR GD_COMPLIST_HIGHLIGHT_TRANSPARENCY] -> listPATH in let GRAPHICDRESSING_CRcompList chan cont nil [110+freeW 80] OBJ_ENABLE|OBJ_VISIBLE|LST_LEFT|LST_HIGHLIGHT_SELECTED|LST_HIGHLIGHT_CLICKED OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE freeW hbox-170 10 LST_VERTICAL GD_FONT_NORMAL 0 [GD_COMPLIST_TEXT_COLOR nil 0 0] [GD_COMPLIST_HIGHLIGHT_COLOR GD_COMPLIST_HIGHLIGHT_TRANSPARENCY] -> listFILE in let GRAPHICDRESSING_CRcompCombo chan cont nil [200 hbox-80] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE wbox-220 70 GD_FONT_NORMAL [GD_COMBO_TEXT_COLOR nil 0 0] [GD_COMBO_HIGHLIGHT_COLOR 50] 10 -> comboTYPE in ( _SETcompTextForbiddenChar textPATH "\\:*?\"!<>|'`{}[]()^,;"; _SETcompTextForbiddenChar textFILE "\\/:*?\"!<>|'`{}[]()^,;"; _SETcompText textPATH path nil nil CT_NOCHANGE; _CBcompTextValidation textPATH @GD_SelectDialogBoxCBpathText [cont listPATH listFILE [comboTYPE typeList]] CT_VALIDENTER|CT_VALIDCLICK; GRAPHICDRESSING_FillCompCombo comboTYPE typeTextList; GD_SelectDialogBoxFillPath listPATH path; GD_SelectDialogBoxFillFile listFILE path [comboTYPE typeList]; _CBcompListDblClick listPATH @GD_SelectDialogBoxCBpath [cont textPATH textFILE listFILE [comboTYPE typeList]]; _CBcompListClick listFILE @GD_SelectDialogBoxCBfile [cont textFILE]; _CBcompListDblClick listFILE @GD_SelectDialogBoxCBfileOk [cont textFILE textPATH [funcallback userparam] selection [comboTYPE typeList]]; _CBcompComboClick comboTYPE @GD_SelectDialogBoxCBtype [cont textPATH listFILE [comboTYPE typeList]]; _CBcompRollOverClick buttonOK @GD_SelectDialogBoxCBend [cont 1 textPATH textFILE [funcallback userparam] selection [comboTYPE typeList]]; _CBcompRollOverClick buttonCANCEL @GD_SelectDialogBoxCBend [cont 0 textPATH textFILE [funcallback userparam] selection [comboTYPE typeList]]; _CBcompRollOverClick compClose @GD_SelectDialogBoxCBend [cont 0 textPATH textFILE [funcallback userparam] selection [comboTYPE typeList]]; _PAINTcontainer _SHOWcontainer cont CONTAINER_UNHIDDEN; /* return value */ cont ) ) ;; /***************************************************************************************/ fun GUI_DMSFileSelected (retval, filename, param) = if retval then ( let getPathFile filename "" -> [res _] in SCSGUI_SetLastDirectory res; SITE_Open filename scsgui.SCSGUIchannel ) else nil; 1 ;; fun GUI_CBopenDMI (retval, filename, param) = if retval then ( let getPathFile filename "" -> [res _] in SCSGUI_SetLastDirectory res; MODULE_Import SELECT_GetSite (SITE_GetModuleCurrentBlackBox SELECT_GetSite) filename scsgui.SCSGUIchannel ) else nil ;; /***************************************************************************************/ var GUI_bAboutBoxOpened = 0 ;; fun GUI_Show(code) = WINMANAG_CreateOrShow code ; 1 ;; fun GUI_ShowHide (code) = WINMANAG_InvertVisibility code; 1 ;; fun GUI_Open () = GRAPHICDRESSING_SelectDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "Open-Site-Title" nil) @GUI_DMSFileSelected (DMS_FILE_EXT::nil)::(OLD_DMS_FILE_EXT::nil)::nil "scs2 (*.dms)"::"scs1 (*.scs)"::nil SCSGUI_GetLastDirectory nil SELECT_DIALOG_BOX_OPEN; 1 ;; fun GUI_CBrealSave (param) = let param -> [filename [site run]] in ( SITE_Save site filename; if run == GUI_SAVERUN then let _checkpack SITE_GetScolName filename -> pack in if pack == nil then nil else _newmachineS pack (-1) 0 else if run == GUI_SAVEREMOVE then SITE_RemoveSite site else if run == GUI_SAVERUNSINGLE then SITE_RunMulti site else nil; 1 ) ;; fun GUI_ValidateCBsaveAs (comprollover, param, posx, posy, btn, mask) = let param -> [cont retval param2] in ( _DScontainer cont ; _freememory; /* MAC ICI libération de ressources */ if retval == GDBOX_YES then GUI_CBrealSave param2 else nil ) ;; fun GUI_CBsaveAs (retval, filename, param) = SITE_DialogBoxRefCountDec ; if retval then ( let getPathFile filename "" -> [res _] in SCSGUI_SetLastDirectory res; GUI_CBrealSave [filename param] ) else nil ;; fun GUI_CBsaveDMI (retval, filename, param) = if retval then ( let getPathFile filename "" -> [res _] in SCSGUI_SetLastDirectory res; MODULE_Export SELECT_GetSite (hd SELECT_GetModule REFLEX_PRIORITY_ONE) filename; ) else nil ;; fun GUI_SaveAsSite(site, run) = SITE_DialogBoxRefCountInc ; GRAPHICDRESSING_SelectDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "Save-Site-Title" nil) @GUI_CBsaveAs (DMS_FILE_EXT::nil)::nil "dms file (*.dms)"::nil SCSGUI_GetLastDirectory [site run] SELECT_DIALOG_BOX_SAVE; 1 ;; fun GUI_SaveAs () = GUI_SaveAsSite SELECT_GetSite 0; 1 ;; fun GUI_SaveSite(site, run) = let SITE_GetFileName site -> siteFilename in if siteFilename == nil then ( GUI_SaveAsSite site run; 0 ) else ( SITE_Save site siteFilename; if run == GUI_SAVERUN then let _checkpack SITE_GetScolName siteFilename -> pack in if pack == nil then nil else _newmachineS pack (-1) 0 else if run == GUI_SAVEREMOVE then SITE_RemoveSite site else if run == GUI_SAVERUNSINGLE then SITE_RunMulti site else nil; 0 ); 1 ;; /* interface functions for the site management (thy were in the SiteInterface.pkg file before!!) */ /* If site has been modified, asks the user upon quitting whether or not the site must be saved, and does so if required. RETURN VALUE : 1 if site has been modified ; 0 otherwise. */ fun GUI_SaveSiteIfNeededUponQuitting(siteList) = if (siteList == nil) then nil else let siteList -> [site Lnext] in if SITE_GetModificationState site then ( GRAPHICDRESSING_ChildDialogBox scsgui.SCSGUIwindowManager.WINMANAGmainCont strcatn (_locSCS "SiteInterface-SITE" nil)::" "::(SITE_GetCompleteName site)::nil (_locSCS "SiteInterface-SITENOTSAVED" nil) (_locSCS "SiteInterface-SITEASKFORSAVE" nil) GDBOXFLAGS_YESNOCANCEL @SITE_OnSaveUponQuittingDialogBoxClosed siteList ; SITE_DialogBoxRefCountInc ; 1 ) else GUI_SaveSiteIfNeededUponQuitting Lnext ; 1 ;; /* If site has been modified, asks the user upon quitting whether or not the site must be saved, and does so if required. RETURN VALUE : returns site ; */ fun GUI_SaveSiteIfNeededUponClosing(site) = if SITE_GetModificationState site then ( GRAPHICDRESSING_ChildDialogBox scsgui.SCSGUIwindowManager.WINMANAGmainCont strcatn (_locSCS "SiteInterface-SITE" nil)::" "::(SITE_GetCompleteName site)::nil (_locSCS "SiteInterface-SITENOTSAVED" nil) (_locSCS "SiteInterface-SITEASKFORSAVE" nil) GDBOXFLAGS_YESNOCANCEL @SITE_OnSaveUponclosingDialogBoxClosed site ; SITE_DialogBoxRefCountInc ; 0 ) else ( SITE_RemoveSite site; 0 ); site ;; fun GUI_Save () = GUI_SaveSite SELECT_GetSite 0 ;; fun GUI_Run () = let SELECT_GetSite -> site in let SITE_GetFileName site -> filename in if (SITE_GetModificationState site) || (filename == nil) then GUI_SaveSite site GUI_SAVERUN else ( SITE_SaveScol site filename; let _checkpack SITE_GetScolName filename -> pack in if pack != nil then _newmachineS pack (-1) 0 else nil; /* MAC ICI : message d'erreur */ ) ;; fun GUI_RunSingle () = let SELECT_GetSite -> site in let SITE_GetFileName site -> filename in if (SITE_GetModificationState site) || (filename == nil) || ((_checkpack filename) == nil) || ((_checkpack (SITE_GetSingleName filename)) == nil) then GUI_SaveSite site GUI_SAVERUNSINGLE else ( SITE_SaveScol site SITE_GetSingleName filename; SITE_RunMulti site ) ;; fun GUI_Close () = GUI_SaveSiteIfNeededUponClosing SELECT_GetSite; 1 ;; fun _helphtml (fic,ext)= let _getress "DefaultLanguage" -> defLang in let if (strlen defLang)<=0 then "English" else defLang -> defLang in let strcatn fic::defLang::"."::ext::nil -> Hhelp in let substr _getlongname itoa time "" "#" 1 50 -> http_clid in let if (_checkpack Hhelp)!=nil then Hhelp else if strcmp defLang "English" then strcatn fic::"English."::ext::nil else "Dms/Scs2/help/code404.html" -> Hhelp in _openbrowserhttpP _checkpack Hhelp; 0 ;; fun file_extension(fname)= let strfind "." fname 0 -> pos in if (pos==nil) then fname else file_extension substr fname pos+1 (strlen fname)-pos-1;; fun GUI_Help () = let file_extension (PARAMS_GetS SCSparameters "HELPSITE") -> ext in if (!strcmpi ext "htm")||(!strcmpi ext "html")||(!strcmpi ext "chm") then ( _helphtml substr (PARAMS_GetS SCSparameters "HELPSITE") 0 (strlen (PARAMS_GetS SCSparameters "HELPSITE"))-(strlen ext) ext; nil ) else nil; 1 ;; fun GUI_ScolWeb () = _openbrowserhttp (PARAMS_GetS SCSparameters "WEBSITE"); 1 ;; fun GUI_SCSWeb () = _openbrowserhttp (PARAMS_GetS SCSparameters "SCSWEBSITE"); 1 ;; fun GUI_OnMenuAboutClosed(comprollover, param, posx, posy, btn, mask) = let param -> [cont _ _] in ( set GUI_bAboutBoxOpened = 0; _DScontainer cont; _freememory; /* MAC ICI libération de ressources */ ); 0 ;; fun GUI_OnMenuAbout () = if GUI_bAboutBoxOpened then nil else ( set GUI_bAboutBoxOpened = 1; GRAPHICDRESSING_ChildDialogBox scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "aboutbox-TITLE" nil) (_locSCS "aboutbox-SUBTITLE" nil) (_locSCS "aboutbox-MAINTEXT" nil) GDBOXFLAGS_OK @GUI_OnMenuAboutClosed nil ); 1 ;; fun GUI_OnMenuUpload () = UPLOAD_OpenConnectDialogBox ; 1 ;; fun GUI_Cut () = let SELECT_GetSelection -> [priority select] in if select == SELECT_MODULE then MODULE_Cut SELECT_GetSite SELECT_GetModule priority else 0 ;; fun GUI_Delete () = let SELECT_GetSelection -> [priority select] in if select == SELECT_MODULE then MODULE_Destroy SELECT_GetSite SELECT_GetModule priority else if select == SELECT_LINK then MODULE_DestroyLinks SELECT_GetLink priority else if select == SELECT_ZONE then ZONE_Destroy SELECT_GetSite SELECT_GetZone priority else if select == SELECT_ASSOCIATION then ASSO_RemoveAssociation SELECT_GetSite hd SELECT_GetAssociation priority else 0 ;; fun GUI_Paste () = let SELECT_GetSelection -> [priority select] in if select == SELECT_MODULE then let SELECT_GetModule priority -> moduleList in if (tl moduleList) != nil then /* multiple module selection */ ( ERRORS_AddError 0 1 (_locSCS "errorlabel-CANNOTPASTE" nil); 0 ) else if MODULE_IsBlackBox hd moduleList then /* black-box */ ( MODULE_Paste SELECT_GetSite hd moduleList; 1 ) else ( ERRORS_AddError 0 1 (_locSCS "errorlabel-CANNOTPASTE" nil); 0 ) else 0 ;; fun GUI_Copy () = let SELECT_GetSelection -> [priority select] in if select == SELECT_MODULE then MODULE_Copy SELECT_GetSite SELECT_GetModule priority scsgui.SCSGUIchannel else 0 ;; fun GUI_Import () = GRAPHICDRESSING_SelectDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "Import-File-Title" nil) @GUI_CBopenDMI (".dme"::nil)::(".dmi"::nil)::nil "scs2 (*.dme)"::"scs1 (*.dmi)"::nil SCSGUI_GetLastDirectory nil SELECT_DIALOG_BOX_OPEN; 1 ;; fun GUI_Export () = GRAPHICDRESSING_SelectDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "Export-File-Title" nil) @GUI_CBsaveDMI (DME_FILE_EXT::nil)::nil "export file (*.dme)"::nil SCSGUI_GetLastDirectory nil SELECT_DIALOG_BOX_SAVE; 1 ;; fun GUI_Undo () = let SITE_GetHistory SELECT_GetSite -> history in HISTORY_Undo history; 0 ;; fun GUI_Redo () = let SITE_GetHistory SELECT_GetSite -> history in HISTORY_Redo history; 0 ;; fun GUI_EnterBB () = if scsgui.SCSGUIcurrentView == MAINWIN_MODULE then let hd SELECT_GetModule REFLEX_PRIORITY_ONE -> module in if (MODULE_IsBlackBox module) && ((SITE_GetModuleCurrentBlackBox SELECT_GetSite) != module) then ( SITE_SetModuleCurrentBlackBox SELECT_GetSite module; SCSGUI_ViewBBChanged; 1 ) else nil else nil ;; fun GUI_CreateZone (type) = if scsgui.SCSGUIcurrentView == MAINWIN_MODULE then nil else ZONE_Create SELECT_GetSite (hd SELECT_GetZone REFLEX_PRIORITY_ONE) type ;; fun GUI_CreateZoneOrEnterBB () = GUI_EnterBB; GUI_CreateZone ZONE_POPUP ;; fun GUI_CreateBB () = if scsgui.SCSGUIcurrentView == MAINWIN_MODULE then let SELECT_GetModule REFLEX_PRIORITY_ONE -> modules in MODULE_CreateBB SELECT_GetSite (if (hd modules) == (SITE_GetModuleCurrentBlackBox SELECT_GetSite) then hd modules else MODULE_GetFather SELECT_GetSite hd modules) modules else nil ;; fun GUI_SelectFather () = let SELECT_GetSelection -> [priority select] in if select == SELECT_MODULE then let hd SELECT_GetModule priority -> module in let MODULE_GetFather SELECT_GetSite module -> father in if father == nil then nil else SELECT_NewModule father::nil priority else if select == SELECT_ZONE then let hd SELECT_GetZone priority -> zone in let ZONE_GetFather SELECT_GetSite zone -> father in if father == nil then nil else SELECT_NewZone father priority else nil ;; /* returns the SCS main window container */ fun GUI_GetMainContainer () = scsgui.SCSGUIwindowManager.WINMANAGmainCont ;; defcom Copen=open S;; typeof registerSCSsrv = Srv;; fun GUI_LaunchServer (port) = if (set registerSCSsrv = (_setserver _envchannel scsgui.SCSGUIchannel port nil)) == nil then GUI_LaunchServer port+1 else port ;; fun __awaySetSCSParameter (param, code) = _fooS strcatn "Updating parameter "::param::" to "::code::nil; PARAMS_SetS SCSparameters param code ;; fun __awayCloseServer (param) = _fooS "Closing Server"; _closeserver registerSCSsrv ;;