/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : ZoneAssociationTree.pkg */ /* Version : 26 juillet 2000 */ /* Zones Association window specific functions */ /* */ /***************************************************************************************/ struct AssociationWin = [ ASSOchannel : Chn , /* association win channel */ ASSOcont : ObjContainer , /* association win container */ ASSOup : CompRollOver , /* button to associate current selected module zone in tree and current selected zone */ ASSOdown : CompRollOver , /* button to delete current selected association in associations list */ ASSOtree : CompTree , /* module zone association tree */ ASSObitmap : AlphaBitmap , /* AlphaBitmap to indicate module zone use */ ASSOcurrentAssociation : [Module S] /* MAC ICI : alors ca c vraiment super crade !!! à changer suivant le système de selection */ ] mkAssociationWin ;; fun ASSOTREE_Clear (assoWin) = GRAPHICDRESSING_DScompTree assoWin.ASSOtree; set assoWin.ASSOtree = nil; GRAPHICDRESSING_DScompRollOver assoWin.ASSOup; set assoWin.ASSOup = nil; GRAPHICDRESSING_DScompRollOver assoWin.ASSOdown ; set assoWin.ASSOdown = nil; 1 ;; fun ASSOTREE_IsValidZone ( zone ) = !(ZONE_IsPopup zone nil) ;; fun ASSOTREE_AddAsso (bt, assoWin, x, y, btn, mask) = let hd SELECT_GetZone REFLEX_PRIORITY_ONE -> zone in let assoWin.ASSOcurrentAssociation -> [module name] in if module == nil then ( ERRORS_AddError 0 38 (_locSCS "errorlabel-10" nil); nil ) else if !ASSOTREE_IsValidZone zone then ( ERRORS_AddError 0 39 (_locSCS "errorlabel-10" nil); nil ) else ASSO_AddAssociation SELECT_GetSite zone module name ;; fun ASSOTREE_ShowInterfZone (assoWin) = let _GETcontainerPositionSize assoWin.ASSOcont -> [_ _ WW HH] in let GD_COMPLIST_HIGHLIGHT_TRANSPARENCY -> colortransp in let GD_COMPLIST_TEXT_COLOR -> txtcolor in let GD_COMPLIST_HIGHLIGHT_COLOR -> highlightcolor in ( let _GETstringSize scsgui.SCSGUIsmallFont (_locSCS "popupassociationtree-DEASSIGN" nil) -> [dewtext dehtext] in let _GETstringSize scsgui.SCSGUIsmallFont (_locSCS "popupassociationtree-ASSIGN" nil) -> [wtext htext] in ( set assoWin.ASSOup = GRAPHICDRESSING_CRcompRollOverWithText assoWin.ASSOchannel assoWin.ASSOcont nil [10 40] OBJ_VISIBLE|OBJ_ENABLE|OBJ_MW_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE|OBJ_KEYBOARD WW-20 htext+10 scsgui.SCSGUIsmallFont (_locSCS "popupassociationtree-ASSIGN" nil) GD_DEFAULT_TEXT_BUTTON_COLOR; _CBcompRollOverClick assoWin.ASSOup @ASSOTREE_AddAsso assoWin; let _CONVERTcompRollOverToObjNode assoWin.ASSOup -> obnode in TOOLTIP_StaticLink assoWin.ASSOcont obnode scsgui.SCSGUIstaticToolTip _locSCS "LOC_TOOLTIP_CREATION_TREE_Create_Affectation" nil ); ); 1 ;; fun ASSOTREE_FillTreeWithAssociationZone (asso, param)= let param -> [position site module side assoWin] in _ADDcompTree assoWin.ASSOtree listcat position 0::nil [asso if (ASSO_SearchModuleZoneAssociation site module asso side) == nil then nil else assoWin.ASSObitmap ] ;; fun ASSOTREE_FillTreeWithModule( site, module, assoWin )= let TREE_getPositionFromNode site @MODULE_GetFather @MODULE_GetFirstSon @MODULE_GetNextBrother module -> position in let MODULE_GetName module -> name in _ADDcompTree assoWin.ASSOtree position [name MODULE_GetTreeBitmap assoWin.ASSOchannel module] ;; fun ASSOTREE_FillTreeWithModules (site, modules, assoWin)= if modules == nil then nil else let modules -> [module next] in ( ASSOTREE_FillTreeWithModule site module assoWin; let TREE_getPositionFromNode site @MODULE_GetFather @MODULE_GetFirstSon @MODULE_GetNextBrother module -> position in let if SCSGUI_GetCurrentView == MAINWIN_ZONE_CLIENT then SCS_CLIENT else SCS_SERVER -> side in let MODULE_GetZonesCS module side -> assos in apply_on_list assos @ASSOTREE_FillTreeWithAssociationZone [position site module side assoWin]; ASSOTREE_FillTreeWithModules site MODULE_GetChildren site module assoWin; ASSOTREE_FillTreeWithModules site next assoWin ); 0 ;; fun ASSOTREE_ShowZoneAssociation (assoWin) = let SELECT_GetSite -> site in let SITE_GetModuleRoot site -> root in ASSOTREE_FillTreeWithModules site root::nil assoWin ;; fun ASSOTREE_UpdateAssociationInTree (asso, param) = let param -> [code assoWin] in let if code then assoWin.ASSObitmap else nil -> bitm in let ASSO_GetModule asso -> module in let TREE_getPositionFromNode SELECT_GetSite @MODULE_GetFather @MODULE_GetFirstSon @MODULE_GetNextBrother module -> position in let if SCSGUI_GetCurrentView == MAINWIN_ZONE_CLIENT then SCS_CLIENT else SCS_SERVER -> side in let mirror MODULE_GetZonesCS module side -> assos in let posf_in_list assos @strCompare ASSO_GetName asso -> pos in ( _SETcompTreeValue assoWin.ASSOtree listcat position pos::nil [ASSO_GetName asso bitm]; _PAINTobjNode _CONVERTcompTreeToObjNode assoWin.ASSOtree ) ;; fun ASSOTREE_AssociationAdded (assoList, param, assoWin) = if SCSGUI_GetCurrentView != MAINWIN_MODULE then apply_on_list assoList @ASSOTREE_UpdateAssociationInTree [1 assoWin] else nil; 1 ;; fun ASSOTREE_AssociationRemoved (assoList, param, assoWin) = if SCSGUI_GetCurrentView != MAINWIN_MODULE then apply_on_list assoList @ASSOTREE_UpdateAssociationInTree [0 assoWin] else nil; 1 ;; fun ASSOTREE_ModuleModified (moduleList, param, assoWin) = if SCSGUI_GetCurrentView != MAINWIN_MODULE then (/* CREATION_RedrawZoneSelection assoWin;*/ SITETREE_ModulesModified moduleList param assoWin.ASSOcont assoWin.ASSOtree ) else nil ;; fun ASSOTREE_ModuleRemoved (moduleList, param, assoWin) = if SCSGUI_GetCurrentView != MAINWIN_MODULE then SITETREE_ModulesRemoved moduleList param assoWin.ASSOcont assoWin.ASSOtree else nil ;; fun ASSOTREE_SplitAssosPos (assos, prev) = if (assos == nil) || ((tl assos) == nil) then [prev (hd assos)] else ASSOTREE_SplitAssosPos tl assos (listcat prev (hd assos)::nil) ;; fun ASSOTREE_TreeSelection (tree, param, pos, btn, mask) = let param -> [assoWin dblClick] in ( let SELECT_GetSite -> site in if (TREE_getNodeFromPosition pos @TREE_FirstChild @TREE_NextBrother site.SITEmoduleTreeRoot/* MAC ICI pas hyper propre ? */) == nil then /* association */ let ASSOTREE_SplitAssosPos pos nil -> [prev last] in let TREE_Val TREE_getNodeFromPosition prev @TREE_FirstChild @TREE_NextBrother site.SITEmoduleTreeRoot/* MAC ICI pas hyper propre ? */ -> module in /* get association module father */ let if SCSGUI_GetCurrentView == MAINWIN_ZONE_CLIENT then SCS_CLIENT else SCS_SERVER -> side in let mirror MODULE_GetZonesCS module side -> assos in let nth_list assos last -> assoName in ( set assoWin.ASSOcurrentAssociation = [module assoName]; if dblClick then let ASSO_SearchModuleZoneAssociation site module assoName side -> asso in if asso == nil then nil else SELECT_NewZone (ASSO_GetZone asso) REFLEX_PRIORITY_ONE else nil; 0 ) else /* module */ ( set assoWin.ASSOcurrentAssociation = nil; UTILSGUI_UNSETcompTreeClicked assoWin.ASSOtree; /* no selection in tree */ 0 ); _PAINTcontainer assoWin.ASSOcont ) ;; fun ASSOTREE_CreateTree (assoWin) = let _GETcontainerPositionSize assoWin.ASSOcont -> [_ _ WW HH] in ( /* MAT ICI TMP pas top a chger */ let THEME_getInfos GD_THEME "TREE_OFFSETS" -> [_ [ty1 [_ [ty2 _]]]] in let atoi ty1 -> ty1 in let atoi ty2 -> ty2 in let GD_COMPTREE_HIGHLIGHT_TRANSPARENCY -> colortransp in let GD_COMPTREE_TEXT_COLOR -> txtcolor in let GD_COMPTREE_HIGHLIGHT_COLOR -> highlightcolor in set assoWin.ASSOtree = _CBcompTreeClick GRAPHICDRESSING_CRcompTree assoWin.ASSOchannel assoWin.ASSOcont nil [10 72] OBJ_CBNOPAINT|OBJ_ENABLE|OBJ_VISIBLE|TRE_FIXED_ROOT|TRE_HIGHLIGHT_CLICKED|OBJ_MH_FLEX|OBJ_MW_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE|OBJ_CONTAINER_KEYUP|OBJ_CONTAINER_KEYDOWN WW - 20 HH-80 (HH-80-ty1-ty2)/26 nil scsgui.SCSGUIsmallFont 40 20 [txtcolor 0 0 nil] [highlightcolor colortransp] @ASSOTREE_TreeSelection [assoWin 0] ; let _CONVERTcompTreeToObjNode assoWin.ASSOtree -> obnode in TOOLTIP_StaticLink assoWin.ASSOcont obnode scsgui.SCSGUIstaticToolTip _locSCS "LOC_TOOLTIP_CREATION_TREE_Zone_Select" nil; _CBcompTreeDblClick assoWin.ASSOtree @ASSOTREE_TreeSelection [assoWin 1]; ASSOTREE_ShowZoneAssociation assoWin; ASSOTREE_ShowInterfZone assoWin; _SETcompTreeState assoWin.ASSOtree nil TRE_EXPAND ; ); 1 ;;