/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : MainZonesWindow.pkg */ /* Version : 06 juillet 2000 */ /* Zones Graph handling functions */ /* */ /***************************************************************************************/ /*************************************************************************************** * * Call back for site selection * ***************************************************************************************/ fun ZONES_SiteSelected (site, param, Channel, zonesViewed, code) = ZONES_Clear zonesViewed; if (param & REFLEX_SELECTION) then ( TREE_ApplyOnTreeVal SITE_FilterZoneTree SELECT_GetSite zonesViewed.ZONESview @ZONES_CreateZone [Channel zonesViewed site] TREE_PRE_ORDER; ZONES_ShowAll zonesViewed; 1 ) else 0 ;; fun ZONE_SetResizeNewPos (resize, w, h, w1, h1) = if resize == nil then nil else ( _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode hd tl resize [0 h-h1] 0; _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode hd tl tl resize [w-w1 0] 0; _CHANGEobjNodeCoordinates _CONVERTcompBitmapToObjNode hd tl tl tl resize [w-w1 h-h1] 0 ) ;; proto ZONES_ReSizeZone = fun [Zone ZonesView] I;; fun ZONES_ReSizeZone (zone, zonesViewed) = let ZONE_GetEdgePositions zone -> [x _ y _] in let ZONE_GetSize zone -> [w h] in let ZONES_GetZoneWindow zonesViewed zone -> zonewin in ( apply_on_list ZONES_GetChildrenNotPopup SELECT_GetSite zone @ZONES_ReSizeZone zonesViewed; let ZONES_GetZoneResize zonesViewed zone -> resize in let _GETalphaBitmapSize zonesViewed.ZONESresize -> [w1 h1] in ZONE_SetResizeNewPos resize w h w1 h1; _CHANGEobjNodeCoordinates zonewin [x y] 0; _SIZEobjNode zonewin w h 0; 1 ); 0 ;; fun ZONES_ReMoveZone (zonesViewed, zone) = let ZONE_GetEdgePositions zone -> [x _ y _] in let ZONE_GetSize zone -> [w h] in let ZONES_GetZoneWindow zonesViewed zone -> zonewin in ( _CHANGEobjNodeCoordinates zonewin [x y] 0; ZONES_ShowAll zonesViewed; 1 ); 0 ;; fun ZONES_ReCreateZone (Channel, zonesViewed, zone) = let SITE_SearchZoneNode SELECT_GetSite zone -> zoneTree in TREE_ApplyOnTreeVal zoneTree @ZONES_CreateZone [Channel zonesViewed SELECT_GetSite] TREE_PRE_ORDER; ZONES_ShowAll zonesViewed ;; /*************************************************************************************** * * CallBack for zone modification * ***************************************************************************************/ fun ZONES_ZoneModified (zoneList, param, Channel, zonesViewed) = if (zonesViewed.ZONESview == ZONE_GetSide hd zoneList) then let hd zoneList -> zone in ( if (param == REFLEX_NAME) || (param == REFLEX_COLOR) || (param == REFLEX_BITMAP) then ZONES_ChangeZoneColor Channel zonesViewed zone /*else if (param == REFLEX_POSITIONSTYLE) then ZONES_ReCreateZone Channel zonesViewed zone*/ else if (param == REFLEX_POSITION) then ZONES_ReMoveZone zonesViewed zone else if (param == REFLEX_SIZE) then ( ZONES_ReSizeZone zone zonesViewed; ZONES_ShowAll zonesViewed ) else nil; 1 ) else 0 ;; /*************************************************************************************** * * Callback for zone deletion * ***************************************************************************************/ fun ZONES_ZoneDeleted (zoneList, param, zonesViewed) = if (zonesViewed.ZONESview == ZONE_GetSide hd zoneList) then ( apply_on_list zoneList @ZONES_DestroyZone zonesViewed; ZONES_ShowAll zonesViewed; 1 ) else 0 ;; /*************************************************************************************** * * CallBack for zone addition * ***************************************************************************************/ fun ZONES_ZoneAdded (zoneList, param, Channel, zonesViewed) = if (zonesViewed.ZONESview == ZONE_GetSide hd zoneList) then ( ZONES_ReCreateZone Channel zonesViewed hd zoneList; 1 ) else 0 ;; /*************************************************************************************** * * Zone view CallBacks set * ***************************************************************************************/ fun ZONES_SetZonesGraphCallBacks (Channel, zonesViewed, cont, code) = _CBcontainerClick cont @ZONES_ContClick [Channel zonesViewed]; _CBcontainerUnClick cont @ZONES_ContUnClick [zonesViewed nil]; /* _CBcontainerKillFocus cont @ZONES_ContUnFocus zonesViewed; MAT ICI ca sert vrt ca ? */ REFLEX_CBzoneModified mkfun3 mkfun4 @ZONES_ZoneModified zonesViewed Channel; REFLEX_CBzoneRemoved mkfun3 @ZONES_ZoneDeleted zonesViewed; REFLEX_CBzoneSelected mkfun3 mkfun4 @ZONES_ZoneSelected zonesViewed Channel; REFLEX_CBzoneAdded mkfun3 mkfun4 @ZONES_ZoneAdded zonesViewed Channel; REFLEX_CBsiteSelected mkfun3 mkfun4 mkfun5 @ZONES_SiteSelected code zonesViewed Channel ;; fun ZONES_GetSide (code) = if code == MAINWIN_ZONE_CLIENT then SCS_CLIENT else SCS_SERVER ;; /*************************************************************************************** * * Zone view initialisation * ***************************************************************************************/ fun ZONES_Initialize (Channel, cont, code) = let mkZonesView [(ZONES_GetSide code) cont nil nil nil nil 0] -> zonesViewed in ( let THEME_getParamsByTheme GD_THEME "RESIZE_ZONE" -> [pathResize _ _ _ _ _ _ _ _ ]in let exec GD_FUNCTIONHANDLER_LOADBITMAP with [pathResize Channel] -> resize in ( _SETalphaBitmapTransparency resize GRAPHICDRESSING_GetCurrentTransparencyColor; set zonesViewed.ZONESresize = resize; ); ZONES_SetZonesGraphCallBacks Channel zonesViewed cont code; ZONES_SiteSelected SELECT_GetSite REFLEX_SELECTION Channel zonesViewed code ); 0 ;;