/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PopUpSiteTree.pkg */ /* Version : 19 juin 2000 */ /* Popup Site Tree window specific functions */ /* */ /***************************************************************************************/ fun SITETREE_FillTreeWithZone( site, zone, tree )= let TREE_getPositionFromNode site @ZONE_GetFather @ZONE_GetFirstSon @ZONE_GetNextBrother zone -> position in let ZONE_GetName zone -> name in _ADDcompTree tree position [name UTILSGUI_CreateRect scsgui.SCSGUIchannel ZONE_GetColor zone ZONE_TREE_SIZE ZONE_TREE_SIZE] ;; fun SITETREE_FillTreeWithModule( site, module, tree )= let TREE_getPositionFromNode site @MODULE_GetFather @MODULE_GetFirstSon @MODULE_GetNextBrother module -> position in let MODULE_GetName module -> name in _ADDcompTree tree position [name MODULE_GetTreeBitmap scsgui.SCSGUIchannel module] ;; fun SITETREE_RunEditor( tree, param, position, btn, mask )= if btn == 1 then if SCSGUI_GetCurrentView == MAINWIN_MODULE then let SELECT_GetSite -> site in let TREE_Val TREE_getNodeFromPosition position @TREE_FirstChild @TREE_NextBrother site.SITEmoduleTreeRoot /* MAT ICI pas hyper propre */ -> module in EDITORSMANAGER_RunEditor scsgui.SCSGUIeditorsManager site module else WINMANAG_OnlyShow POPUPWIN_PROPERTIES else nil ;; fun SITETREE_SelectElement( tree, param, position, btn, mask )= let SELECT_GetSite -> site in if SCSGUI_GetCurrentView == MAINWIN_MODULE then let TREE_Val TREE_getNodeFromPosition position @TREE_FirstChild @TREE_NextBrother site.SITEmoduleTreeRoot /* MAT ICI pas hyper propre */ -> module in SELECT_NewModule module::nil REFLEX_PRIORITY_ONE else let TREE_Val TREE_getNodeFromPosition position @TREE_FirstChild @TREE_NextBrother SCSGUI_GetCurrentZoneRootTree -> zone in SELECT_NewZone zone REFLEX_PRIORITY_ONE ;; fun SITETREE_FillTreeWithZones (site, tree, zones) = if zones == nil then nil else let zones -> [zone next] in ( SITETREE_FillTreeWithZone site zone tree; SITETREE_FillTreeWithZones site tree ZONE_GetChildren site zone; SITETREE_FillTreeWithZones site tree next ); tree ;; fun SITETREE_FillTreeWithModules( site, tree, modules )= if modules == nil then nil else let modules -> [module next] in ( SITETREE_FillTreeWithModule site module tree; SITETREE_FillTreeWithModules site tree MODULE_GetChildren site module; SITETREE_FillTreeWithModules site tree next ); tree ;; fun SITETREE_BuildTree (site, tree) = if SCSGUI_GetCurrentView== MAINWIN_MODULE then let SITE_GetModuleRoot site -> root in SITETREE_FillTreeWithModules site tree root::nil else if SCSGUI_GetCurrentView == MAINWIN_ZONE_CLIENT then let SITE_GetClientZoneRoot site -> root in SITETREE_FillTreeWithZones site tree root::nil else let SITE_GetServerZoneRoot site -> root in SITETREE_FillTreeWithZones site tree root::nil; _PAINTobjNode _CONVERTcompTreeToObjNode tree; 1 ;; fun SITETREE_SiteViewChanged (view, tree) = _RSTcompTree tree; SITETREE_BuildTree SELECT_GetSite tree ;; fun SITETREE_SiteSelected( site, param, tree )= if (param & REFLEX_UNSELECTION) then ( _RSTcompTree tree; 1 ) else if (param & REFLEX_SELECTION) then SITETREE_BuildTree site tree else 0 ;; fun SITETREE_ModulesSelected( modules, param, cont, tree )= if param & REFLEX_UNSELECTION then nil else let TREE_getPositionFromNode SELECT_GetSite @MODULE_GetFather @MODULE_GetFirstSon @MODULE_GetNextBrother hd modules -> position in UTILSGUI_SETcompTreeClicked tree position; _PAINTcontainer cont; 0 ;; fun SITETREE_ZonesSelected( zones, param, cont, tree )= if param & REFLEX_UNSELECTION then nil else let TREE_getPositionFromNode SELECT_GetSite @ZONE_GetFather @ZONE_GetFirstSon @ZONE_GetNextBrother hd zones -> position in UTILSGUI_SETcompTreeClicked tree position; _PAINTcontainer cont; 0 ;; fun text()= if SCSGUI_GetCurrentView == MAINWIN_MODULE then _locSCS "LOC_TOOLTIP_SITE_TREE_ModuleMode" nil else _locSCS "LOC_TOOLTIP_SITE_TREE_ZoneMode" nil ;; fun SITETREE_CreateTree(Channel, cont )= { let THEME_getParamsByTheme GD_THEME "TREE" -> [pathtree _ _ _ _ _ _ _ _ ]in let exec GD_FUNCTIONHANDLER_LOADBITMAP with [pathtree Channel] -> alphaBmp in let _GETcontainerPositionSize cont -> [_ _ wcont hcont] in ( _SETalphaBitmapTransparency alphaBmp 0xffffff; let GD_COMPTREE_HIGHLIGHT_TRANSPARENCY -> colortransp in let GD_COMPTREE_TEXT_COLOR -> txtcolor in let GD_COMPTREE_HIGHLIGHT_COLOR -> highlightcolor in let GRAPHICDRESSING_CRcompTree Channel cont nil [10 35] OBJ_ENABLE|OBJ_VISIBLE|TRE_FIXED_ROOT/*|TRE_HIGHLIGHT_SELECTED*/|TRE_HIGHLIGHT_CLICKED|OBJ_MW_FLEX|OBJ_MH_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE|OBJ_KEYBOARD wcont-20 hcont-50 10 nil scsgui.SCSGUIsmallFont 26 20 [txtcolor 0 0 nil] [highlightcolor colortransp] /*nil nil alphaBmp*/ -> tree in ( /* TONY ICI */ let _CONVERTcompTreeToObjNode tree -> obnode in TOOLTIP_DynamicLink cont obnode scsgui.SCSGUIstaticToolTip @text; _CBcompTreeDblClick tree @SITETREE_RunEditor nil; SITETREE_SiteSelected SELECT_GetSite REFLEX_SELECTION|REFLEX_PRIORITY_ONE tree; let SELECT_GetModule REFLEX_PRIORITY_ONE -> modules in if modules == nil then let SELECT_GetZone REFLEX_PRIORITY_ONE -> zones in if zones == nil then nil else ( _CBcompTreeClick tree @SITETREE_SelectElement "ZONE"; SITETREE_ZonesSelected zones REFLEX_PRIORITY_ONE|REFLEX_SELECTION cont tree ) else ( _CBcompTreeClick tree @SITETREE_SelectElement "MODULE"; SITETREE_ModulesSelected modules REFLEX_PRIORITY_ONE|REFLEX_SELECTION cont tree; ); let PARAMS_GetI SCSparameters "POPUP_SITETREE_POSITION_X" -> popx in let PARAMS_GetI SCSparameters "POPUP_SITETREE_POSITION_Y" -> popy in let PARAMS_GetI SCSparameters "POPUP_SITETREE_WIDTH" -> popw in let PARAMS_GetI SCSparameters "POPUP_SITETREE_HEIGHT" -> poph in /* reset previously saved width & height parameters */ if popw != nil then _SIZEEXcontainer cont popx popy popw poph else nil; tree ; ) ; ) ; };; fun SITETREE_OnPreDestroy (cont) = { let _GETcontainerPositionSize cont -> [popx popy popw poph] in { PARAMS_SetI SCSparameters "POPUP_SITETREE_POSITION_X" popx ; PARAMS_SetI SCSparameters "POPUP_SITETREE_POSITION_Y" popy ; PARAMS_SetI SCSparameters "POPUP_SITETREE_WIDTH" popw ; PARAMS_SetI SCSparameters "POPUP_SITETREE_HEIGHT" poph ; } ; 1 ; } ;; fun POPUPWIN_SetSiteTreeCallBacks (cont, param, tree) = POPUPWIN_CBpopupPreDestroy @SITETREE_OnPreDestroy cont ; REFLEX_CBmoduleAdded mkfun3 mkfun4 @SITETREE_ModulesAdded tree cont; REFLEX_CBmoduleRemoved mkfun3 mkfun4 @SITETREE_ModulesRemoved tree cont; REFLEX_CBmoduleModified mkfun3 mkfun4 @SITETREE_ModulesModified tree cont; REFLEX_CBmoduleSelected mkfun3 mkfun4 @SITETREE_ModulesSelected tree cont; REFLEX_CBzoneAdded mkfun3 mkfun4 @SITETREE_ZonesAdded tree cont; REFLEX_CBzoneModified mkfun3 mkfun4 @SITETREE_ZonesModified tree cont; REFLEX_CBzoneSelected mkfun3 mkfun4 @SITETREE_ZonesSelected tree cont; REFLEX_CBzoneRemoved mkfun3 mkfun4 @SITETREE_ZonesRemoved tree cont; REFLEX_CBsiteSelected mkfun3 @SITETREE_SiteSelected tree; SCSGUI_CBviewChange (mkfun2 @SITETREE_SiteViewChanged tree) ;; fun POPUPWIN_CreateSiteTree (Channel, win, code) = let PARAMS_GetI SCSparameters "POPUP_SITETREE_POSITION_X" -> popx in let PARAMS_GetI SCSparameters "POPUP_SITETREE_POSITION_Y" -> popy in let PARAMS_GetI SCSparameters "POPUP_SITETREE_MIN_WIDTH" -> popminw in let PARAMS_GetI SCSparameters "POPUP_SITETREE_MIN_HEIGHT" -> popminh in let POPUPWIN_CreatePopupWindow Channel win if (popx != nil) then popx else 0 if (popy != nil) then popy else 50 if (popminw != nil) then popminw else 200 if (popminh != nil) then popminh else 325 (_locSCS "popupsitetree-TITLE" nil) code nil nil -> cont in ( POPUPWIN_SetSiteTreeCallBacks cont code SITETREE_CreateTree Channel cont; [cont (_locSCS "popupsitetree-TITLE" nil)]; ) ;;