/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PropertiesAssociation.pkg */ /* Version : 27 juin 2000 */ /* Popup properties window associations specific functions */ /* */ /***************************************************************************************/ fun ASSOTREE_GetAssoList (site) = let SELECT_GetZone REFLEX_PRIORITY_ONE -> listZone in if (tl listZone) == nil then /* single zone selection */ let hd listZone -> zone in if ZONE_IsPopup zone nil then [ (_locSCS "propertiesassociations-DOCUMENT" nil) ASSO_GetAllZoneAssociation site ZONE_GetChildren site zone ] else [ (_locSCS "propertiesassociations-ZONE" nil) ASSO_SearchZoneAssociation site zone ] else [ (_locSCS "propertiesassociations-ZONES" nil) ASSO_GetAllZoneAssociation site listZone ] ;; fun ASSOTREE_ListClick (list, assoWin, index) = let SELECT_GetSite -> site in let ASSOTREE_GetAssoList site -> [_ listAsso] in let nth_list listAsso index -> selected in SELECT_NewAssociation selected REFLEX_PRIORITY_TWO ;; fun ASSOTREE_FillZoneModuleList (asso, param) = let param -> [list site] in let lineBuildSeparator SITE_GetZoneCompleteName site ASSO_GetZone asso "." -> zone in let strcatn (lineBuildSeparator (SITE_GetModuleCompleteName site ASSO_GetModule asso) ".")::" : "::(ASSO_GetName asso)::nil -> module in let _GETcompListCount list -> nb in _ADDcompList list nb [strcatn module::" -> "::zone::nil nil]; 0 ;; fun ASSOTREE_GetAssoName (zone) = if ZONE_IsPopup zone nil then (_locSCS "propertiesassociations-DOCUMENT" nil) else (_locSCS "propertiesassociations-ZONE" nil) ;; fun CREATION_RedrawZoneSelection (assoWin) = let SELECT_GetSite -> site in let ASSOTREE_GetAssoList site -> [text assoList] in ( set assoWin.ASSOzoneName = UTILSGUI_SetOrCreateText assoWin.PROPchannel assoWin.PROPcontainer GUI_LABEL assoWin.ASSOzoneName text [210 35] [180 15] nil nil; _RSTcompList assoWin.ASSOlist; apply_on_list assoList @ASSOTREE_FillZoneModuleList [assoWin.ASSOlist site] ) ;; fun PROPERTIES_AssociationAdded (assoList, param, assoWin) = if SCSGUI_GetCurrentView != MAINWIN_MODULE then CREATION_RedrawZoneSelection assoWin else nil; _PAINTobjNode _CONVERTcompListToObjNode assoWin.ASSOlist; 1 ;; fun PROPERTIES_AssociationRemoved (assoList, param, assoWin) = if SCSGUI_GetCurrentView != MAINWIN_MODULE then CREATION_RedrawZoneSelection assoWin else nil; _PAINTobjNode _CONVERTcompListToObjNode assoWin.ASSOlist; 1 ;; fun ASSOTREE_ZoneModified (zoneList, param, assoWin) = if SCSGUI_GetCurrentView != MAINWIN_MODULE then ( let hd SELECT_GetZone REFLEX_PRIORITY_ONE -> zoneSelect in if zoneSelect == (hd zoneList) then if param == REFLEX_NAME then ( set assoWin.ASSOzoneName = _SETcompText assoWin.ASSOzoneName ASSOTREE_GetAssoName zoneSelect scsgui.SCSGUIsmallFont nil CT_BEGIN; _PAINTobjNode _CONVERTcompTextToObjNode assoWin.ASSOzoneName; ) else nil else nil; if param == REFLEX_NAME then CREATION_RedrawZoneSelection assoWin /* redraw each time cause can be the zone father ..... */ else nil ) else nil; 1 ;; fun PROPERTIES_ShowOrCreateAssociations (propWin) = /* Creates color selection button */ if propWin.ASSOlist == 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.ASSOlist = _CBcompListClick GRAPHICDRESSING_CRcompList propWin.PROPchannel propWin.PROPcontainer nil [200 55] OBJ_ENABLE|OBJ_VISIBLE|LST_LEFT|LST_HIGHLIGHT_SELECTED|LST_HIGHLIGHT_CLICKED|OBJ_MW_FLEX|OBJ_MH_FLEX|OBJ_RH_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN WW - 210 HH - 65 ((HH - 65) / 116) * 10 LST_VERTICAL scsgui.SCSGUIsmallFont 0 [txtcolor nil 0 0] [highlightcolor colortransp] @ASSOTREE_ListClick propWin ) else ( GRAPHICDRESSING_ShowCompList propWin.ASSOlist 1; GRAPHICDRESSING_ShowCompText propWin.ASSOzoneName 1; nil ) ;;