/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : WindowManager.pkg */ /* Version : 16 juin 2000 */ /* Windows manager struct and basic functions */ /* */ /***************************************************************************************/ typeof scriptList = [[[I r1] S] r1];; fun WINMANAG_InitPackage (list, code) = if list == nil then nil else let hd list -> [codeList scri] in if is_in_list codeList code then _script scri else WINMANAG_InitPackage tl list code ;; var WINMANAG_VISIBLE = 1;; var WINMANAG_UNVISIBLE = 2;; /* WIN DEFAULT NAME LIST */ fun MainWinNameList () = [1 (strcat " " _locSCS "windowmanager-MODLKED" nil)]:: [2 (strcat " " _locSCS "windowmanager-CLIZONE" nil)]:: [3 (strcat " " _locSCS "windowmanager-SERZONE" nil)]:: nil;; fun WINMANAG_GetMainName (list, code) = if list == nil then nil else let hd list -> [codeL value] in if codeL == code then value else WINMANAG_GetMainName tl list code ;; fun WINMANAG_SetMainTitle () = let WINMANAG_GetMainName MainWinNameList SCSGUI_GetCurrentView -> name in if name == nil then 0 else ( let if SITE_GetModificationState SELECT_GetSite then "(*)" else "" -> modified in let strcatn name::" - "::(_locSCS "windowmanager-SITE" nil):: " : "::(SITE_GetCompleteName SELECT_GetSite)::nil -> title in ( _SETcontainerName scsgui.SCSGUIwindowManager.WINMANAGmainCont title; _SETcompText scsgui.SCSGUIwindowManager.WINMANAGtitle title nil nil nil; _PAINTobjNode _CONVERTcompTextToObjNode scsgui.SCSGUIwindowManager.WINMANAGtitle; 1 ) ) ;; fun WINMANAG_CompareCode (winelt, code) = let winelt -> [currcode _ _] in currcode == code ;; fun WINMANAG_SearchWin (code) = search_in_list scsgui.SCSGUIwindowManager.WINMANAGwinList @WINMANAG_CompareCode code ;; fun WINMANAG_SearchWindow (code) = let WINMANAG_SearchWin code -> [_ cont _] in cont ;; fun WINMANAG_DestroyWinElt (winelt, param) = let winelt -> [code cont visibility] in if code < 10 then MAINWIN_Destroy cont else if code < 20 then POPUPWIN_Destroy cont else /* MSGWIN_Destroy cont */ nil /* MAC ICI */ ;; fun WINMANAG_Destroy () = let scsgui.SCSGUIwindowManager -> wmng in let _GETcontainerExPositionSize wmng.WINMANAGmainCont -> [popx popy popw poph] in ( /* Save pos and size */ PARAMS_SetI SCSparameters "POPUP_MAINWIN_POSITION_X" popx ; PARAMS_SetI SCSparameters "POPUP_MAINWIN_POSITION_Y" popy ; PARAMS_SetI SCSparameters "POPUP_MAINWIN_WIDTH" popw ; PARAMS_SetI SCSparameters "POPUP_MAINWIN_HEIGHT" poph ; apply_on_list wmng.WINMANAGwinList @WINMANAG_DestroyWinElt nil; _DScontainer wmng.WINMANAGmainCont; set wmng.WINMANAGwinList = nil; set wmng.WINMANAGmainCont = nil; 1 ) ;; fun WINMANAG_AddWin (code, cont) = if cont == nil then nil else let scsgui.SCSGUIwindowManager -> wmng in let [code cont WINMANAG_UNVISIBLE] -> winelt in ( set wmng.WINMANAGwinList = winelt::wmng.WINMANAGwinList; winelt ) ;; fun WINMANAG_Hide (winelt) = let winelt -> [code cont visibility] in if visibility == WINMANAG_UNVISIBLE then nil else ( set scsgui.SCSGUIwindowManager.WINMANAGwinList = f_replace_in_list scsgui.SCSGUIwindowManager.WINMANAGwinList @WINMANAG_CompareCode code [code cont WINMANAG_UNVISIBLE]; if code > 10 then MENU_ChangeState scsgui.SCSGUIwindowManager.WINMANAGmenu code else nil; _SHOWcontainer cont CONTAINER_HIDDEN ) ;; fun WINMANAG_HideAllMainBut (list, code) = if list == nil then nil else let hd list -> winelt in let winelt -> [currcode _ _] in ( if (currcode < 10) && (currcode != code) then WINMANAG_Hide winelt else nil; WINMANAG_HideAllMainBut tl list code; 0 ) ;; fun WINMANAG_Show (winelt) = let winelt -> [code cont visibility] in ( if visibility == WINMANAG_UNVISIBLE then let scsgui.SCSGUIwindowManager -> wmng in ( set wmng.WINMANAGwinList = f_replace_in_list wmng.WINMANAGwinList @WINMANAG_CompareCode code [code cont WINMANAG_VISIBLE]; _SHOWcontainer cont CONTAINER_UNHIDDEN; _TOPcontainer cont; if code < 10 then ( WINMANAG_HideAllMainBut wmng.WINMANAGwinList code; nil ) else MENU_ChangeState scsgui.SCSGUIwindowManager.WINMANAGmenu code; ) else nil; cont ) ;; fun WINMANAG_CreateWin (code) = WINMANAG_InitPackage scriptList code; let scsgui.SCSGUIwindowManager -> wmng in if code < 10 then /* main win */ ( WINMANAG_AddWin code MAINWIN_Create scsgui.SCSGUIchannel wmng.WINMANAGmainCont code; SCSGUI_SetCurrentView code; nil ) else /* popup win */ let WINMANAG_AddWin code POPUPWIN_Create scsgui.SCSGUIchannel wmng.WINMANAGmainCont code -> winelt in WINMANAG_Show winelt ;; fun WINMANAG_HideWin (code) = let WINMANAG_SearchWin code -> winelt in if winelt == nil then nil else WINMANAG_Hide winelt; 0 ;; fun WINMANAG_CreateOrShow(code) = { let WINMANAG_SearchWin code -> winelt in if winelt == nil then /* not shown yet */ WINMANAG_CreateWin code else let winelt -> [code cont visibility] in if code < 10 then ( SCSGUI_SetCurrentView code; nil ) else if visibility == WINMANAG_UNVISIBLE then WINMANAG_Show winelt else nil ; } ;; fun WINMANAG_OnlyShow (code) = let WINMANAG_SearchWin code -> winelt in if winelt == nil then /* not shown yet */ WINMANAG_CreateWin code else let winelt -> [code cont visibility] in if visibility == WINMANAG_UNVISIBLE then WINMANAG_Show winelt else nil; 1 ;; fun WINMANAG_InvertVisibility (code) = let WINMANAG_SearchWin code -> winelt in if winelt == nil then /* not shown yet */ WINMANAG_CreateWin code else let winelt -> [code cont visibility] in if code < 10 then ( SCSGUI_SetCurrentView code; nil ) else if visibility == WINMANAG_UNVISIBLE then WINMANAG_Show winelt else WINMANAG_Hide winelt; 1 ;; fun WINMANAG_Create (Channel) = POPUP_Ini Channel; set scriptList = [POPUPWIN_PROPERTIES::nil "_load \"Dms/scs2/Gui/PopUp/Properties/PopupProperties.pkg\"\n _load \"Dms/scs2/Gui/PopUp/Properties/PropertiesAssociation.pkg\"\n _load \"Dms/scs2/Gui/PopUp/Properties/PropertiesLink.pkg\"\n _load \"Dms/scs2/Gui/PopUp/Properties/PropertiesModule.pkg\"\n _load \"Dms/scs2/Gui/PopUp/Properties/PositionChart.pkg\"\n _load \"Dms/scs2/Gui/PopUp/Properties/PropertiesZone.pkg\"\n"]:: [POPUPWIN_CREATIONTREE::nil "_load \"Dms/scs2/Gui/PopUp/CreationTree/ZoneAssociationTree.pkg\"\n _load \"Dms/scs2/Gui/PopUp/CreationTree/PopupCreationTree.pkg\"\n"]:: [POPUPWIN_TOOLBAR::nil nil]:: [POPUPWIN_SITETREE::nil "_load \"Dms/scs2/Gui/PopUp/SiteTree/PopupSiteTree.pkg\"\n"]:: [POPUPWIN_SITESERVERS::nil "_load \"Dms/scs2/Gui/PopUp/SiteServers/PopupSiteServers.pkg\"\n"]:: [POPUPWIN_SITEOPTIONS::nil "_load \"Dms/scs2/Gui/PopUp/SiteOptions/PopupSiteOptions.pkg\"\n"]:: /* [POPUPWIN_ERRORLOG::nil "_load \"Dms/scs2/Gui/PopUp/ErrorLog/PopupErrorLog.pkg\"\n"]::*/ [POPUPWIN_HISTORYLOG::nil "_load \"Dms/scs2/Gui/PopUp/HistoryLog/PopUpHistoryLog.pkg\"\n"]:: [POPUPWIN_SCSPREF::nil "_load \"Dms/scs2/Gui/PopUp/ConfigSCSParams/PopupConfigSCSParams.pkg\"\n"]:: nil; let MAINWIN_CreateMain Channel -> [cont comptext] in let MENU_Create Channel cont -> menuTree in mkWindowManager [nil cont comptext menuTree] ;; fun WINMANAG_FinalChangeView (view) = WINMANAG_Show WINMANAG_SearchWin view; 1 ;;