/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PropertiesModule.pkg */ /* Version : 27 juin 2000 */ /* Popup properties window modules specific functions */ /* */ /***************************************************************************************/ var PROPERTIES_CurrentLinkSelectionType = 0 ;; var PROPERTIES_bLockDialogBoxSaving = 0;; fun PROPERTIES_HideModule (propWin) = if propWin.PROPcurrentSelection == PROPERTIES_ZONE then PROPERTIES_HideModuleView propWin else if propWin.PROPcurrentSelection == PROPERTIES_LINK then ( GRAPHICDRESSING_ShowCompRollOver propWin.PROPModReportSave 0; GRAPHICDRESSING_DScompText propWin.PROPname2Text; set propWin.PROPname2Text = nil; UTILSGUI_HideText propWin.PROPmultipleLabel; UTILSGUI_HideAndEmptyCombo propWin.PROPlinkType ) else if propWin.PROPcurrentSelection == PROPERTIES_MODULES then ( UTILSGUI_HideText propWin.PROPname1Label; UTILSGUI_HideAndEmptyText propWin.PROPname1Text; ) else if propWin.PROPcurrentSelection == PROPERTIES_MODULE then ( UTILSGUI_HideText propWin.PROPmultipleLabel ) else nil; 0 ;; fun PROPERTIES_SelectLinkTypeShow (compcombo, propWin, index) = { set PROPERTIES_CurrentLinkSelectionType = index ; PROPERTIES_SelectLinksShow propWin index; /*_PAINTcontainer propWin.PROPcontainer*/ };; fun PROPERTIES_ShowOrCreateLinkType (propWin) = if propWin.PROPlinkType == nil then ( set propWin.PROPlinkType = _CBcompComboClick GRAPHICDRESSING_CRcompCombo propWin.PROPchannel propWin.PROPcontainer nil [105 80] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE 100 90 scsgui.SCSGUIsmallFont [GD_COMBO_TEXT_COLOR nil 0 0] [GD_COMBO_HIGHLIGHT_COLOR 50] 10 @PROPERTIES_SelectLinkTypeShow propWin; 1 ) else ( GRAPHICDRESSING_ShowCompCombo propWin.PROPlinkType 1; 1 ); _RSTcompCombo propWin.PROPlinkType; _ADDcompCombo propWin.PROPlinkType 1 [(_locSCS "propertieslink-ALL" nil) nil]; if propWin.PROPcurrentSelection == PROPERTIES_MODULE then ( _ADDcompCombo propWin.PROPlinkType 2 [(_locSCS "propertieslink-OUT" nil) nil]; _ADDcompCombo propWin.PROPlinkType 3 [(_locSCS "propertieslink-IN" nil) nil] ) else if propWin.PROPcurrentSelection == PROPERTIES_MODULES then ( _ADDcompCombo propWin.PROPlinkType 2 [(_locSCS "propertieslink-ALLIN" nil) nil]; _ADDcompCombo propWin.PROPlinkType 3 [(_locSCS "propertieslink-ALLEX" nil) nil]; _ADDcompCombo propWin.PROPlinkType 4 [(_locSCS "propertieslink-EXOUT" nil) nil]; _ADDcompCombo propWin.PROPlinkType 5 [(_locSCS "propertieslink-EXIN" nil) nil] ) else nil; _SETcompComboClicked propWin.PROPlinkType PROPERTIES_CurrentLinkSelectionType; 0 ;; fun PROPERTIES_ModifyServer (text, module, type, val) = MODULE_SetServer module atoi val ;; fun PROPERTIES_ModifyServerList (text, moduleList, type, val) = if IsEmptyString val then nil else MODULE_SetMultipleServer moduleList atoi val ;; fun PROPERTIES_OnCloseReportSaveDialogBox (retval, filename, Info)= if retval then ( SCSGUI_OpenLoadingDialogBox (_locSCS "site-REPORTING" nil); let getPathFile filename "" -> [res _] in SCSGUI_SetLastReportDirectory res; MODULE_ReportInFile SELECT_GetSite (SELECT_GetModule REFLEX_PRIORITY_ONE) filename; SCSGUI_CloseLoadingDialogBox ) else nil; set PROPERTIES_bLockDialogBoxSaving = 0; 0 ;; fun PROPERTIES_OnClickModReportSave (button, Info, posx, posy, buttontype, mask) = if !PROPERTIES_bLockDialogBoxSaving then ( set PROPERTIES_bLockDialogBoxSaving = 1; GRAPHICDRESSING_SelectDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "propertiesmodule-REPORTSAVE" nil) @PROPERTIES_OnCloseReportSaveDialogBox (".txt"::nil)::nil "*.txt"::nil SCSGUI_GetLastReportDirectory Info SELECT_DIALOG_BOX_SAVE ) else nil; 0 ;; fun PROPERTIES_ShowOrCreateModSaveReport (propWin) = if propWin.PROPModReportSave == nil then set propWin.PROPModReportSave = _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText propWin.PROPchannel propWin.PROPcontainer nil [50 368] OBJ_VISIBLE|OBJ_ENABLE|OBJ_LH_FLEX OBJ_KEYBOARD 200 20 scsgui.SCSGUIsmallFont (_locSCS "propertiesmodule-REPORTSAVE" nil) GD_DEFAULT_TEXT_BUTTON_COLOR @PROPERTIES_OnClickModReportSave propWin else ( GRAPHICDRESSING_ShowCompRollOver propWin.PROPModReportSave 1; nil ) ;; /**************************************************************************************** set value for properties interface element module(s) selected ****************************************************************************************/ fun PROPERTIES_SetModule (propWin, moduleList, code) = set propWin.PROPname2Label = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPname2Label strcat (_locSCS "propertiesmodule-SNB" nil) " " [10 55] [150 20] nil nil; if propWin.PROPcurrentSelection == PROPERTIES_MODULE then let hd moduleList -> module in ( set propWin.PROPname1Label = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPname1Label strcat (_locSCS "propertiesmodule-MNAME" nil) " " [10 35] [150 20] nil nil ; set propWin.PROPname1Text = UTILSGUI_SetOrCreateTextEx propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPname1Text MODULE_GetName module [160 35] [150 20] nil nil OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP|OBJ_MW_FLEX ; set propWin.PROPname2Text = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_TEXT propWin.PROPname2Text itoa MODULE_GetServer module [160 55] [150 20] @PROPERTIES_ModifyServer module ) else /* multiple modules selection */ ( set propWin.PROPmultipleLabel = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPmultipleLabel (_locSCS "propertiesmodule-MODSEL" nil) [10 35] [150 20] nil nil; let MODULE_GetCommonServer moduleList -> srvNumber in set propWin.PROPname2Text = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_TEXT propWin.PROPname2Text if srvNumber == nil then "" else itoa srvNumber [160 55] [150 20] @PROPERTIES_ModifyServerList moduleList ); PROPERTIES_ShowOrCreateModSaveReport propWin; PROPERTIES_ShowOrCreateLinksList propWin; PROPERTIES_ShowOrCreateLinkType propWin; let _GETcompComboClicked propWin.PROPlinkType -> [index _] in PROPERTIES_SelectLinksShow propWin index; 0 ;; /**************************************************************************************** callback for module selection ****************************************************************************************/ fun PROPERTIES_ModuleSelected (moduleList, code, propWin) = if (code & REFLEX_PRIORITY_ONE) then let SELECT_GetModule REFLEX_PRIORITY_ONE -> listModule in ( set propWin.PROPpreviousSelection = propWin.PROPcurrentSelection; set propWin.PROPcurrentSelection = if (tl listModule) == nil then PROPERTIES_MODULE else PROPERTIES_MODULES; if PROPERTIES_InterfaceJustChange propWin then PROPERTIES_HidePreviousInterface propWin else nil; PROPERTIES_SetModule propWin listModule code; _PAINTcontainer propWin.PROPcontainer ) else nil; 0 ;; /**************************************************************************************** callback for module modification verify if the module modification event have to be processed by properties popup window ****************************************************************************************/ fun PROPERTIES_ModuleModified (moduleList, param, propWin) = if propWin.PROPcurrentSelection == PROPERTIES_MODULE || propWin.PROPcurrentSelection == PROPERTIES_MODULES then let SELECT_GetModule REFLEX_PRIORITY_ONE -> listSelectedModules in if (tl listSelectedModules) == nil /* then single module selected */ then let (hd listSelectedModules) -> module in if is_in_list moduleList module /* selected module is modified */ then if param == REFLEX_NAME then ( _SETcompText propWin.PROPname1Text (MODULE_GetName module) scsgui.SCSGUIsmallFont nil CT_BEGIN; let _GETcompComboClicked propWin.PROPlinkType -> [index _] in PROPERTIES_SelectLinksShow propWin index; _PAINTcontainer propWin.PROPcontainer ) else if param == REFLEX_SERVER then ( _SETcompText propWin.PROPname2Text (itoa MODULE_GetServer module) scsgui.SCSGUIsmallFont nil CT_BEGIN; _PAINTcontainer propWin.PROPcontainer ) else nil else nil else nil else nil; /* not a module selection */ 0 ;;