/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PropertiesZone.pkg */ /* Version : 12 juillet 2000 */ /* Popup properties window zones specific functions */ /* */ /***************************************************************************************/ var PROP_IsColorSelectionBoxOpen = 0 ;; var PROP_IsBackgroundBitmapSelectionBoxOpen = 0 ;; fun PROPERTIES_HideBitmapSelect (propWin) = if propWin.PROPselectBitmap == nil then nil else ( UTILSGUI_HideRoll propWin.PROPselectBitmap; UTILSGUI_HideRoll propWin.PROPselectColor; UTILSGUI_HideAndEmptyText propWin.PROPbitmap; UTILSGUI_HideAndEmptyText propWin.PROPcolorEditBox; UTILSGUI_HideCombo propWin.PROPbitmapType; UTILSGUI_HideText propWin.PROPbitmapLabel; UTILSGUI_HideText propWin.PROPcolorLabel; 1 ) ;; fun PROPERTIES_HideZone (propWin) = PROPERTIES_HideBitmapSelect propWin; PROPERTIES_HideChart propWin; UTILSGUI_HideAndEmptyText propWin.PROPzoneName; UTILSGUI_HideText propWin.PROPzoneNameLabel; UTILSGUI_HideText propWin.PROPpositionLabel; UTILSGUI_HideText propWin.ASSOzoneName; UTILSGUI_HideList propWin.ASSOlist; 0 ;; fun PROPERTIES_ColorSelection (colorCode, zone)= { set PROP_IsColorSelectionBoxOpen = 0 ; let ZONE_GetColor zone -> zoneColor in if (colorCode == nil) || (colorCode == zoneColor) then nil else ZONE_SetColor zone colorCode } ;; fun PROPERTIES_ColorTextSelection (text, zone, type, colorTextCode)= PROPERTIES_ColorSelection colorHTMLtoSCOL colorTextCode zone ;; fun PROPERTIES_PreChangeZoneColor (button, propWin, posx, posy, buttontype, mask) = { if (PROP_IsColorSelectionBoxOpen == 0) then { set PROP_IsColorSelectionBoxOpen = 1 ; let SELECT_GetZone REFLEX_PRIORITY_ONE -> zones in let hd zones -> zone in _CRcolorMapFromCont propWin.PROPchannel propWin.PROPcontainer 100 100 _locSCS "propertieszone-COLORMAP" nil mknode @PROPERTIES_ColorSelection zone ZONE_GetColor zone; 0 } else 0 ; 1 };; fun PROPERTIES_BitmapSelection (zone, bitmapFile)= let if IsEmptyString bitmapFile then nil else bitmapFile -> bitmapFile in let ZONE_GetBitmapFile zone -> zoneBitmapFile in ZONE_SetBitmapFile SELECT_GetSite zone bitmapFile; 1 ;; fun PROPERTIES_BitmapTextSelection (text, zone, type, bitmapFile)= if !(IsEmptyString bitmapFile) && ((_checkpack bitmapFile) == nil) then ( GUI_FileNotFound scsgui.SCSGUIwindowManager.WINMANAGmainCont bitmapFile; _SETcompText text ZONE_GetBitmapFile zone nil nil CT_NOCHANGE; _PAINTobjNode _CONVERTcompTextToObjNode text; 0 ) else PROPERTIES_BitmapSelection zone bitmapFile ;; fun PROPERTIES_BitmapBrowseSelection (retval, filename, zone)= set PROP_IsBackgroundBitmapSelectionBoxOpen = 0 ; if retval then ( let getPathFile filename "" -> [res _] in SCSGUI_SetLastDirectory res; PROPERTIES_BitmapSelection zone filename ) else nil ;; fun PROPERTIES_PreChangeZoneBitmap (button, propWin, posx, posy, buttontype, mask) = { if (PROP_IsBackgroundBitmapSelectionBoxOpen == 0) then { set PROP_IsBackgroundBitmapSelectionBoxOpen = 1 ; let SELECT_GetZone REFLEX_PRIORITY_ONE -> zones in let hd zones -> zone in GRAPHICDRESSING_SelectDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "Open-Bitmap-File" nil) @PROPERTIES_BitmapBrowseSelection (".jpg"::".jpeg"::".bmp"::nil)::nil "bitmap files"::nil SCSGUI_GetLastDirectory zone SELECT_DIALOG_BOX_OPEN; 0 } else nil ; 1 };; fun PROPERTIES_SelectBitmapType (compcombo, propWin, index) = ZONE_ChangeBitmapFlag hd (SELECT_GetZone REFLEX_PRIORITY_ONE) (if index == 1 then DOCtiled else if index == 2 then DOCstretched else 0) ;; fun PROPERTIES_ShowOrCreateBitmapSelect (propWin, zone) = /* Creates color selection button */ if propWin.PROPcolorLabel == nil then ( set propWin.PROPcolorLabel = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPcolorLabel (_locSCS "propertieszone-COLORLABEL" nil) [10 70] [100 15] nil nil ; set propWin.PROPselectColor = _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText propWin.PROPchannel propWin.PROPcontainer nil [170 65] OBJ_VISIBLE|OBJ_ENABLE OBJ_KEYBOARD 25 20 scsgui.SCSGUIsmallFont "..." GD_DEFAULT_TEXT_BUTTON_COLOR @PROPERTIES_PreChangeZoneColor propWin ) else ( GRAPHICDRESSING_ShowCompRollOver propWin.PROPselectColor 1; GRAPHICDRESSING_ShowCompText propWin.PROPcolorLabel 1; nil ); set propWin.PROPcolorEditBox = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_TEXT propWin.PROPcolorEditBox colorSCOLtoHTML ZONE_GetColor zone [95 65] [75 20] @PROPERTIES_ColorTextSelection zone ; /* creates background bitmap selection button */ set propWin.PROPbitmap = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_TEXT propWin.PROPbitmap ZONE_GetBitmapFile zone [10 120] [160 20] @PROPERTIES_BitmapTextSelection zone ; if propWin.PROPselectBitmap == nil then ( set propWin.PROPbitmapLabel = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPbitmapLabel (_locSCS "propertieszone-BITMAPLABEL" nil) [10 95] [150 15] nil nil; set propWin.PROPselectBitmap = _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText propWin.PROPchannel propWin.PROPcontainer nil [170 120] OBJ_VISIBLE|OBJ_ENABLE OBJ_KEYBOARD 25 20 scsgui.SCSGUIsmallFont "..." GD_DEFAULT_TEXT_BUTTON_COLOR @PROPERTIES_PreChangeZoneBitmap propWin; set propWin.PROPbitmapType = _CBcompComboClick GRAPHICDRESSING_CRcompCombo propWin.PROPchannel propWin.PROPcontainer nil [110 95] OBJ_ENABLE|OBJ_VISIBLE OBJ_CONTAINER_UNCLICK|OBJ_KEYBOARD|OBJ_CONTAINER_MOVE 80 70 scsgui.SCSGUIsmallFont [GD_COMBO_TEXT_COLOR nil 0 0] [GD_COMBO_HIGHLIGHT_COLOR 50] 10 @PROPERTIES_SelectBitmapType propWin; _ADDcompCombo propWin.PROPbitmapType 1 [(_locSCS "propertiesBitmap-CENTERED" nil) nil]; _ADDcompCombo propWin.PROPbitmapType 2 [(_locSCS "propertiesBitmap-TILED" nil) nil]; _ADDcompCombo propWin.PROPbitmapType 3 [(_locSCS "propertiesBitmap-STRETCHED" nil) nil]; let _CONVERTcompRollOverToObjNode propWin.PROPselectBitmap -> pere in TOOLTIP_StaticLink propWin.PROPcontainer pere scsgui.SCSGUIstaticToolTip (_locSCS "LOC_TOOLTIP_PROPERTIES_Browse" nil) ; let _CONVERTcompRollOverToObjNode propWin.PROPselectColor -> pere in TOOLTIP_StaticLink propWin.PROPcontainer pere scsgui.SCSGUIstaticToolTip (_locSCS "LOC_TOOLTIP_PROPERTIES_SelectColor" nil); 1 ) else ( GRAPHICDRESSING_ShowCompRollOver propWin.PROPselectBitmap 1; GRAPHICDRESSING_ShowCompCombo propWin.PROPbitmapType 1; GRAPHICDRESSING_ShowCompText propWin.PROPbitmapLabel 1; 1 ); let ZONE_GetStyle zone -> [_ bitmapFlag _] in _SETcompComboClicked propWin.PROPbitmapType (if bitmapFlag == DOCtiled then 1 else if bitmapFlag == DOCstretched then 2 else 0); 1 ;; fun PROPERTIES_ChangeName (text, zone, type, val) = let ZONE_GetName zone -> zonename in if strcmpi zonename val then ZONE_SetName SELECT_GetSite zone val else nil ;; /**************************************************************************************** set value for properties interface element zone(s) selected ****************************************************************************************/ fun PROPERTIES_SetZone (propWin, zone, code) = PROPERTIES_ShowOrCreateChart propWin zone; PROPERTIES_ShowOrCreateAssociations propWin; PROPERTIES_ShowOrCreateBitmapSelect propWin zone; set propWin.PROPzoneNameLabel = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPzoneNameLabel _locSCS "propertieszone-ZNAME" nil [10 35] [80 20] nil nil; set propWin.PROPzoneName = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_TEXT propWin.PROPzoneName ZONE_GetName zone [95 35] [70 20] @PROPERTIES_ChangeName zone; set propWin.PROPpositionLabel = UTILSGUI_SetOrCreateText propWin.PROPchannel propWin.PROPcontainer GUI_LABEL propWin.PROPpositionLabel (_locSCS "propertieszone-POS" nil) [10 160] [70 20] nil nil; 0 ;; /**************************************************************************************** callback for zone selection ****************************************************************************************/ fun PROPERTIES_ZoneSelected (zoneList, code, propWin) = if (code & REFLEX_PRIORITY_ONE) && (code & REFLEX_SELECTION) then let hd SELECT_GetZone REFLEX_PRIORITY_ONE -> zone in ( set propWin.PROPpreviousSelection = propWin.PROPcurrentSelection; set propWin.PROPcurrentSelection = PROPERTIES_ZONE; if PROPERTIES_InterfaceJustChange propWin then PROPERTIES_HidePreviousInterface propWin else nil; PROPERTIES_SetZone propWin zone code; /* MAT ICI A TESTER */ CREATION_RedrawZoneSelection propWin; _PAINTcontainer propWin.PROPcontainer ) else nil;/* MAC ICI unselect ! */ 0 ;; /**************************************************************************************** callback for zone modification verify if the zone modification event have to be processed by properties popup window ****************************************************************************************/ fun PROPERTIES_ZoneModified (zoneList, param, propWin) = if propWin.PROPcurrentSelection == PROPERTIES_ZONE then let hd SELECT_GetZone REFLEX_PRIORITY_ONE -> zone in if is_in_list zoneList zone /* selected zone is modified */ then if param == REFLEX_NAME then ( _SETcompText propWin.PROPzoneName (ZONE_GetName zone) scsgui.SCSGUIsmallFont nil CT_BEGIN; /* MAT ICI A TESTER */ CREATION_RedrawZoneSelection propWin; /* redraw each time cause can be the zone father ..... */ _PAINTcontainer propWin.PROPcontainer ) else if param == REFLEX_POSITION || param == REFLEX_POSITIONSTYLE || param == REFLEX_SIZE then PROPERTIES_UpdateChartPosition propWin zone else if param == REFLEX_COLOR then ( _SETcompText propWin.PROPcolorEditBox (colorSCOLtoHTML ZONE_GetColor zone) scsgui.SCSGUIsmallFont nil CT_BEGIN; _PAINTcontainer propWin.PROPcontainer ) else if param == REFLEX_BITMAP then ( _SETcompText propWin.PROPbitmap (ZONE_GetBitmapFile zone) scsgui.SCSGUIsmallFont nil CT_BEGIN; _PAINTcontainer propWin.PROPcontainer ) else nil else nil else nil; /* not a zone selection */ 0 ;;