/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PropertiesLink.pkg */ /* Version : 27 juin 2000 */ /* Popup properties window link specific functions */ /* */ /***************************************************************************************/ proto PROPERTIES_ChangeLinkParameter = fun [u0 [PropertiesWin Link] u1 S] I;; proto PROPERTIES_ChangeLinkCondition = fun [u0 [PropertiesWin Link] u1 S] I;; fun PROPERTIES_HideLinkData (propWin) = UTILSGUI_HideText propWin.PROPparameterLabel; UTILSGUI_HideAndEmptyText propWin.PROPparameter; UTILSGUI_HideText propWin.PROPconditionLabel; UTILSGUI_HideAndEmptyText propWin.PROPcondition; 1 ;; fun PROPERTIES_HideModuleView (propWin) = PROPERTIES_HideLinkData propWin; GRAPHICDRESSING_ShowCompRollOver propWin.PROPModReportSave 0; GRAPHICDRESSING_DScompText propWin.PROPname2Text; set propWin.PROPname2Text = nil; UTILSGUI_HideText propWin.PROPname1Label; UTILSGUI_HideAndEmptyText propWin.PROPname1Text; UTILSGUI_HideText propWin.PROPname2Label; UTILSGUI_HideText propWin.PROPlinkLabel; UTILSGUI_HideCombo propWin.PROPlinkType; UTILSGUI_HideText propWin.PROPmultipleLabel; UTILSGUI_HideList propWin.PROPlinkList ;; fun PROPERTIES_HideLink (propWin) = if propWin.PROPcurrentSelection == PROPERTIES_ZONE then PROPERTIES_HideModuleView propWin else if (propWin.PROPcurrentSelection == PROPERTIES_MODULE) then ( PROPERTIES_HideLinkData propWin; GRAPHICDRESSING_DScompText propWin.PROPname2Text; set propWin.PROPname2Text = nil; nil ) else if (propWin.PROPcurrentSelection == PROPERTIES_MODULES) then ( PROPERTIES_HideLinkData propWin; GRAPHICDRESSING_DScompText propWin.PROPname2Text; set propWin.PROPname2Text = nil; UTILSGUI_HideAndEmptyText propWin.PROPname1Label; UTILSGUI_HideAndEmptyText propWin.PROPname2Label; UTILSGUI_HideAndEmptyText propWin.PROPname1Text ) else nil; 0 ;; fun PROPERTIES_GetLinksList (propWin, index) = let SELECT_GetModule REFLEX_PRIORITY_ONE -> moduleList in if propWin.PROPcurrentSelection == PROPERTIES_MODULE then let hd moduleList -> module1 in if index == 0 /* all links */ then listList_to_list MODULE_GetLinks module1 else if index == 1 /* outgoing links */ then MODULE_GetOutgoingLinks module1 else /* incoming links */ MODULE_GetIncomingLinks module1 else if propWin.PROPcurrentSelection == PROPERTIES_MODULES then if index == 0 /* all links */ then MODULE_ListGetAllLinks moduleList else if index == 1 /* internal links */ then MODULE_GetLinksList moduleList else if index == 2 /* external links */ then MODULE_ListGetAllExternalLinks moduleList else if index == 3 /* external outgoing links */ then MODULE_ListGetAllExternalOutgoingLinks moduleList else /* external incoming links */ MODULE_ListGetAllExternalIncomingLinks moduleList else if propWin.PROPcurrentSelection == PROPERTIES_LINK then let SELECT_GetLink REFLEX_PRIORITY_TWO -> linkList in let LINK_GetSource hd linkList -> module1 in let LINK_GetDestination hd linkList -> module2 in MODULE_GetLinksByModule module1 module2 else nil ;; fun PROPERTIES_ChangeLinkParameter (text, param, type, textVal2) = let param -> [propWin link] in let _GETcompText propWin.PROPparameter -> textVal in ( _SETcompText propWin.PROPparameter (LINK_GetParameter link) scsgui.SCSGUIsmallFont nil CT_BEGIN; if (strcmpi textVal LINK_GetParameter link) && ((strcmp textVal "") || (LINK_GetParameter link) != nil) then LINK_SetParameter link textVal else nil; _PAINTobjNode _CONVERTcompTextToObjNode propWin.PROPparameter ); 1 ;; fun PROPERTIES_ChangeLinkCondition (text, param, type, textVal2) = let param -> [propWin link] in let _GETcompText propWin.PROPcondition -> textVal in ( _SETcompText propWin.PROPcondition (LINK_GetCondition link) scsgui.SCSGUIsmallFont nil CT_BEGIN; if (strcmpi textVal LINK_GetCondition link) && ((strcmp textVal "") || (LINK_GetCondition link) != nil) then LINK_SetCondition link textVal else nil; _PAINTobjNode _CONVERTcompTextToObjNode propWin.PROPcondition ); 1 ;; fun PROPERTIES_SelectLinkShow (complist, propWin, index) = let _GETcompComboClicked propWin.PROPlinkType -> [index2 _] in let PROPERTIES_GetLinksList propWin index2 -> linksList in let nth_list linksList index -> link in SELECT_NewLink link::nil REFLEX_PRIORITY_THREE; complist ;; fun PROPERTIES_AddLink (complist, link, pos) = _ADDcompList complist pos [LINK_Print link nil] ;; fun PROPERTIES_RemoveLink (complist, pos) = _DELcompList complist pos ;; fun PROPERTIES_ReplaceLink (complist, link, pos) = PROPERTIES_RemoveLink complist pos; PROPERTIES_AddLink complist link pos; 0 ;; fun PROPERTIES_AddLinksList (complist, linkList) = if linkList == nil then nil else ( let _GETcompListCount complist -> nb in PROPERTIES_AddLink complist (hd linkList) nb; PROPERTIES_AddLinksList complist tl linkList; 0 ) ;; fun PROPERTIES_SelectLinksShow (propWin, index) = let PROPERTIES_GetLinksList propWin index -> linksList in ( SELECT_ClearLink REFLEX_PRIORITY_THREE; _RSTcompList propWin.PROPlinkList; PROPERTIES_AddLinksList propWin.PROPlinkList linksList ) ;; fun PROPERTIES_CreateSpecificLinkData (propWin, link) = let _GETcontainerPositionSize propWin.PROPcontainer -> [_ _ WW _] in ( set propWin.PROPparameter = UTILSGUI_SetOrCreateTextEx propWin.PROPchannel propWin.PROPcontainer GUI_TEXT propWin.PROPparameter LINK_GetParameter link [100 270] [WW-120 45] @PROPERTIES_ChangeLinkParameter [propWin link] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_MULTIEDITLINE|OBJ_LH_FLEX|OBJ_MW_FLEX; set propWin.PROPcondition = UTILSGUI_SetOrCreateTextEx propWin.PROPchannel propWin.PROPcontainer GUI_TEXT propWin.PROPcondition LINK_GetCondition link [100 320] [WW-120 45] @PROPERTIES_ChangeLinkCondition [propWin link] OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_MULTIEDITLINE|OBJ_LH_FLEX|OBJ_MW_FLEX ); 1 ;; fun PROPERTIES_CreateLinkData (propWin) = set propWin.PROPparameterLabel = UTILSGUI_SetOrCreateTextEx propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPparameterLabel strcat (_locSCS "propertieslink-LNKPARAM" nil) " " [10 280] [85 20] nil nil OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP|OBJ_LH_FLEX; set propWin.PROPconditionLabel = UTILSGUI_SetOrCreateTextEx propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPconditionLabel strcat (_locSCS "propertieslink-LNKCOND" nil) " " [10 335] [85 20] nil nil OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP|OBJ_LH_FLEX; PROPERTIES_CreateSpecificLinkData propWin nil; PROPERTIES_HideLinkData propWin ;; fun PROPERTIES_SetLinkData (propWin, linkList) = let hd linkList -> link in ( GRAPHICDRESSING_ShowCompText propWin.PROPparameterLabel 1; GRAPHICDRESSING_ShowCompText propWin.PROPconditionLabel 1; PROPERTIES_CreateSpecificLinkData propWin link ); _PAINTcontainer propWin.PROPcontainer; 0 ;; fun PROPERTIES_ShowOrCreateLinksList (propWin) = if propWin.PROPlinkList == nil then let _GETcontainerPositionSize propWin.PROPcontainer -> [_ _ WW HH] in let GD_COMPLIST_HIGHLIGHT_TRANSPARENCY -> colortransp in let GD_COMPLIST_TEXT_COLOR -> txtcolor in let GD_COMPLIST_HIGHLIGHT_COLOR -> highlightcolor in ( set propWin.PROPlinkLabel = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPlinkLabel (_locSCS "propertiesmodule-LNKLIST" nil) [10 80] [70 20] nil nil; set propWin.PROPlinkList = GRAPHICDRESSING_CRcompList propWin.PROPchannel propWin.PROPcontainer nil [10 110] OBJ_ENABLE|OBJ_VISIBLE|LST_LEFT|LST_HIGHLIGHT_SELECTED|LST_HIGHLIGHT_CLICKED|OBJ_MW_FLEX|OBJ_MH_FLEX OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE WW-20 150 9 LST_VERTICAL scsgui.SCSGUIsmallFont 0 [txtcolor nil 0 0] [highlightcolor colortransp] ; _CBcompListClick propWin.PROPlinkList @PROPERTIES_SelectLinkShow propWin; PROPERTIES_CreateLinkData propWin; let _CONVERTcompListToObjNode propWin.PROPlinkList -> obnode in TOOLTIP_StaticLink propWin.PROPcontainer obnode scsgui.SCSGUIstaticToolTip _locSCS "LOC_TOOLTIP_PROPERTIES_CompList" nil; 1 ) else ( GRAPHICDRESSING_ShowCompText propWin.PROPlinkLabel 1; GRAPHICDRESSING_ShowCompList propWin.PROPlinkList 1; 1 ) ;; /**************************************************************************************** LINK CHANGE FUNCTIONS ****************************************************************************************/ fun PROPERTIES_LinkModification (link, param) = let param -> [propWin codeModif listSelected] in let pos_in_list listSelected link 0 -> pos in if pos != nil then if codeModif == REFLEX_SOURCE || codeModif == REFLEX_DESTINATION then PROPERTIES_ReplaceLink propWin.PROPlinkList link pos else let _GETcompListClicked propWin.PROPlinkList -> [index _] in if index == nil then nil /* modification not relevant for interface */ else let nth_list listSelected index -> linkSelected in if link == linkSelected then if codeModif == REFLEX_PARAMETER then ( _SETcompText propWin.PROPparameter (LINK_GetParameter link) scsgui.SCSGUIsmallFont nil CT_BEGIN; 0 ) else if codeModif == REFLEX_CONDITION then ( _SETcompText propWin.PROPcondition (LINK_GetCondition link) scsgui.SCSGUIsmallFont nil CT_BEGIN; 0 ) else nil else nil /* modification not relevant for interface */ else nil /* modification not relevant for interface */ ;; /**************************************************************************************** callback for link modification verify if the link modification event have to be processed by properties popup window ****************************************************************************************/ fun PROPERTIES_LinkModified (linkList, param, propWin) = let if propWin.PROPcurrentSelection == PROPERTIES_MODULE || propWin.PROPcurrentSelection == PROPERTIES_MODULES || propWin.PROPcurrentSelection == PROPERTIES_LINK then let _GETcompComboClicked propWin.PROPlinkType -> [index _] in PROPERTIES_GetLinksList propWin index else if propWin.PROPcurrentSelection == PROPERTIES_LINK then PROPERTIES_GetLinksList propWin nil else nil -> listSelected in ( apply_on_list linkList @PROPERTIES_LinkModification [propWin param listSelected]; _PAINTcontainer propWin.PROPcontainer ); 0 ;; /**************************************************************************************** callback for link deletion ****************************************************************************************/ fun PROPERTIES_LinkDeleted (linkList, param, propWin) = if propWin.PROPcurrentSelection == PROPERTIES_MODULE || propWin.PROPcurrentSelection == PROPERTIES_MODULES || propWin.PROPcurrentSelection == PROPERTIES_LINK then let _GETcompComboClicked propWin.PROPlinkType -> [index _] in ( PROPERTIES_SelectLinksShow propWin index; _PAINTcontainer propWin.PROPcontainer ) else nil; /* not a module selection */ 0 ;; fun PROPERTIES_LinkAddition (link, param) = let param -> [propWin codeModif listSelected] in let pos_in_list listSelected link 0 -> pos in if pos != nil then PROPERTIES_AddLink propWin.PROPlinkList link pos else nil /* deletion not relevant for interface */ ;; /**************************************************************************************** callback for link addition verify if the link have to be processed by properties popup window ****************************************************************************************/ fun PROPERTIES_LinkAdded (linkList, param, propWin) = if propWin.PROPcurrentSelection == PROPERTIES_MODULE || propWin.PROPcurrentSelection == PROPERTIES_MODULES || propWin.PROPcurrentSelection == PROPERTIES_LINK then let _GETcompComboClicked propWin.PROPlinkType -> [index _] in let PROPERTIES_GetLinksList propWin index -> listSelected in ( apply_on_list linkList @PROPERTIES_LinkAddition [propWin param listSelected]; _PAINTcontainer propWin.PROPcontainer ) else nil; /* not a module selection */ 0 ;; /**************************************************************************************** set value for properties interface element link(s) selected ****************************************************************************************/ fun PROPERTIES_SetLink (propWin, linkList, code) = if (code & REFLEX_SELECTION) then ( let LINK_GetSource hd linkList -> modulesource in let LINK_GetDestination hd linkList -> moduledestination in ( set propWin.PROPname1Label = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPname1Label strcat (_locSCS "propertieslink-MOD1" nil) " " [10 35] [150 20] nil nil; set propWin.PROPname1Text = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPname1Text MODULE_GetName modulesource [160 35] [150 20] nil nil; set propWin.PROPname2Label = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPname2Label strcat (_locSCS "propertieslink-MOD2" nil) " " [10 55] [150 20] nil nil; set propWin.PROPname2Text = UTILSGUI_SetOrCreateTextEx propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPname2Text MODULE_GetName moduledestination [160 55] [150 20] nil nil OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP|OBJ_MW_FLEX ); PROPERTIES_ShowOrCreateLinksList propWin; PROPERTIES_SelectLinksShow propWin nil; 0 ) else nil /* unselect ! MAC ICI */ ;; /**************************************************************************************** callback for link selection ****************************************************************************************/ fun PROPERTIES_LinkSelected (linkList, code, propWin) = if (code & REFLEX_PRIORITY_TWO) && (code & REFLEX_SELECTION) then ( set propWin.PROPpreviousSelection = propWin.PROPcurrentSelection; set propWin.PROPcurrentSelection = PROPERTIES_LINK; if PROPERTIES_InterfaceJustChange propWin then PROPERTIES_HidePreviousInterface propWin else nil; PROPERTIES_SetLink propWin linkList code; _PAINTcontainer propWin.PROPcontainer; 0 ) else if code & REFLEX_PRIORITY_THREE then if code & REFLEX_UNSELECTION then PROPERTIES_HideLinkData propWin else PROPERTIES_SetLinkData propWin linkList else nil; 0 ;;