/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PopUpHistoryLog.pkg */ /* Version : 24 juin 2000 */ /* History Log Popup window */ /* */ /***************************************************************************************/ /* Definition of HISTORY LOG INFO STRUCTURE */ struct Struct_SCSHistoryInfo = [ m_Channel : Chn , /* channel */ ctrl_Container : ObjContainer , /* container */ ctrl_UndoButton : CompRollOver , /* undo button */ ctrl_RedoButton : CompRollOver , /* redo button */ ctrl_ClearButton : CompRollOver , /* clear button */ m_HistoryList : [S r1] /* Stores the undo sequence actions */ ] mkSCSHistoryInfo ;; /* remplissage de la liste graphique avec le contenu de l'historique */ fun FILL_COMP_LIST(cont, list)= if list == nil then nil else let list -> [first next] in ( _ADDcompList cont 0 [first nil]; FILL_COMP_LIST cont next ); 0;; /* ************************************************************************************************ * * * * * CALL BACKS RELATIVES AUX BOUTONS UNDO REDO ET CLEAR * * * * * ********************************************************************************************** */ /* ************************************************************************************************ * CALL BACKS RELATIVES AUX BOUTONS UNDO * ********************************************************************************************** */ fun RFL_Undo (RollOver, param, posx, posy, button, mask)= GUI_Undo ;; /* ************************************************************************************************ * CALL BACKS RELATIVES AUX BOUTONS REDO * ********************************************************************************************** */ fun RFL_Redo (RollOver, param, posx, posy, button, mask)= GUI_Redo ;; /* ************************************************************************************************ * CALL BACKS RELATIVES AUX BOUTONS CLEAR * ********************************************************************************************** */ fun RFL_Clear (RollOver, param, posx, posy, button, mask)= let SITE_GetHistory SELECT_GetSite -> history in HISTORY_Clear history; _PAINTobjNode _CONVERTcompListToObjNode _RSTcompList param; 0;; /* ******************************************************************************************** * * * * * * * CALL BACKS d'ajouts et d'effacement * * * * * * * ******************************************************************************************** */ fun HISTORY_AddReflex (history,content,list)= _PAINTobjNode _CONVERTcompListToObjNode _ADDcompList list 0 [content nil] ; 0;; fun HISTORY_DelReflex (history,list)= _PAINTobjNode _CONVERTcompListToObjNode _DELcompList list 0; 0;; /* ******************************************************************************************** * * * * * * * CALL BACKS dde sélection d'un nouveau site * * * * * * * ******************************************************************************************** */ fun HISTORY_SiteSelected( site, param, cplist)= ( if param & REFLEX_UNSELECTION then ( _RSTcompList cplist;/* vidage de la liste graphique */ 0 ) else if param & REFLEX_SELECTION then ( let SITE_GetHistory site -> history in ( FILL_COMP_LIST cplist HISTORY_Get history;/* on remplit la liste avec le contenu du nouvel historique */ _PAINTobjNode _CONVERTcompListToObjNode cplist; /* CALL BACK d'aJOUT et D'EFFACEMENTd'une action dans l'historique*/ HISTORY_SetCallBacks history mkfun3 @HISTORY_AddReflex cplist mkfun2 @HISTORY_DelReflex cplist ); 0 ) else nil ; ) ;; fun HISTORY_OnPreDestroy (cont) = { let _GETcontainerPositionSize cont -> [popx popy popw poph] in { PARAMS_SetI SCSparameters "POPUP_HISTORY_POSITION_X" popx ; PARAMS_SetI SCSparameters "POPUP_HISTORY_POSITION_Y" popy ; PARAMS_SetI SCSparameters "POPUP_HISTORY_WIDTH" popw ; PARAMS_SetI SCSparameters "POPUP_HISTORY_HEIGHT" poph ; } ; 1 ; } ;; fun POPUPWIN_SetHistoryCallBacks (cont, param, history, cplist ) = UTILSGUI_MoveWithBackground cont param; POPUPWIN_HideWhenDestroy cont param; POPUPWIN_CBpopupPreDestroy @HISTORY_OnPreDestroy cont ; /* CALL BACK d'aJOUT et D'EFFACEMENTd'une action dans l'historique*/ HISTORY_SetCallBacks history mkfun3 @HISTORY_AddReflex cplist mkfun2 @HISTORY_DelReflex cplist; /* s'inscrire aux call back de sélection d'élément */ REFLEX_CBsiteSelected mkfun3 @HISTORY_SiteSelected cplist; 0;; /* ******************************************************************************************** * fonction de mise en place de texte sur des roll overs * * * ******************************************************************************************** */ fun set_text_button (cont, slide, text, font, posx, posy)= let _GETalphaBitmaps slide -> [obbitmap _] in (/* ici on trace le texte sur le bitmap */ ( let _GETbitmapSize obbitmap -> [w h] in let h/4 -> heightspace in ( _DRAWtext obbitmap font posx posy TD_CENTER|TD_TOP GD_DEFAULT_TEXT_BUTTON_COLOR text; _DRAWtext obbitmap font posx posy+heightspace TD_CENTER|TD_TOP GD_DEFAULT_TEXT_BUTTON_COLOR text; _DRAWtext obbitmap font posx posy+heightspace+heightspace TD_CENTER|TD_TOP GD_DEFAULT_TEXT_BUTTON_COLOR text ); let _CRalphaBitmap _channel obbitmap nil nil nil -> slide2 in slide2)) ;; /* ******************************************************************************************** * * * * * * * CREATION DE L'INTERFACE GRAPHIQUE * * * * * * * ******************************************************************************************** */ fun CREATION_Interface (SCSHistoryInfo, list, history, code)= { /* CompList */ let SCSHistoryInfo.ctrl_Container -> cont in let SCSHistoryInfo.m_Channel -> channel in let _GETcontainerPositionSize cont -> [_ _ wcont hcont] in /* Creates buttons UNDO REDO CLEAR */ let _GETstringSize scsgui.SCSGUIsmallFont (_locSCS "popuphistorylog-UNDO" nil) -> [lfont hfont] in let _GETstringSize scsgui.SCSGUIsmallFont (_locSCS "popuphistorylog-REDO" nil) -> [lfont2 hfont2] in let _GETstringSize scsgui.SCSGUIsmallFont (_locSCS "popuphistorylog-CLEAR" nil) -> [lfont3 hfont3] in let 10+max max hfont hfont2 hfont3 -> hbutton in let (wcont-40)/3 -> wbutton in let 10 -> xpos_undo in let xpos_undo+10+wbutton -> xpos_redo in let xpos_redo+10+wbutton -> xpos_clear in let GD_COMPLIST_HIGHLIGHT_TRANSPARENCY -> colortransp in let GD_COMPLIST_TEXT_COLOR -> txtcolor in let GD_COMPLIST_HIGHLIGHT_COLOR -> highlightcolor in let GRAPHICDRESSING_CRcompList SCSHistoryInfo.m_Channel SCSHistoryInfo.ctrl_Container nil [10 (40+hbutton+10) ] OBJ_ENABLE|OBJ_VISIBLE|LST_LEFT|OBJ_MW_FLEX|OBJ_MH_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE|OBJ_KEYBOARD wcont-20 hcont-(40+hbutton+10)-15 10 LST_VERTICAL scsgui.SCSGUIsmallFont 0 [txtcolor 50 nil nil] [highlightcolor colortransp] -> cplist in { set SCSHistoryInfo.ctrl_UndoButton = GRAPHICDRESSING_CRcompRollOverWithText channel cont nil [xpos_undo 40] OBJ_VISIBLE|OBJ_ENABLE|OBJ_RW_FLEX|OBJ_MW_FLEX OBJ_CONTAINER_MOVE|OBJ_KEYBOARD wbutton hbutton scsgui.SCSGUIsmallFont (_locSCS "popuphistorylog-UNDO" nil) GD_DEFAULT_TEXT_BUTTON_COLOR ; set SCSHistoryInfo.ctrl_RedoButton = GRAPHICDRESSING_CRcompRollOverWithText channel cont nil [xpos_redo 40] OBJ_VISIBLE|OBJ_ENABLE|OBJ_LW_FLEX|OBJ_RW_FLEX|OBJ_MW_FLEX OBJ_CONTAINER_MOVE|OBJ_KEYBOARD wbutton hbutton scsgui.SCSGUIsmallFont (_locSCS "popuphistorylog-REDO" nil) GD_DEFAULT_TEXT_BUTTON_COLOR ; set SCSHistoryInfo.ctrl_ClearButton = GRAPHICDRESSING_CRcompRollOverWithText channel cont nil [xpos_clear 40] OBJ_VISIBLE|OBJ_ENABLE|OBJ_LW_FLEX|OBJ_MW_FLEX OBJ_CONTAINER_MOVE|OBJ_KEYBOARD wbutton hbutton scsgui.SCSGUIsmallFont (_locSCS "popuphistorylog-CLEAR" nil) GD_DEFAULT_TEXT_BUTTON_COLOR ; /* Sets button callbacks */ _CBcompRollOverClick SCSHistoryInfo.ctrl_UndoButton @RFL_Undo cplist ; _CBcompRollOverClick SCSHistoryInfo.ctrl_RedoButton @RFL_Redo cplist ; _CBcompRollOverClick SCSHistoryInfo.ctrl_ClearButton @RFL_Clear cplist ; if list != nil then FILL_COMP_LIST cplist list else nil ; /* Returns compList */ cplist ; } ; } ;; /* *************************************************************************** */ /* * * */ /* * * */ /* * fonction appelée lors de l'ouverture de la fenêtre HISTORIQUE * */ /* * * */ /* * * */ /* *************************************************************************** */ fun POPUPWIN_CreateHistoryLog (Channel, win, code) = let PARAMS_GetI SCSparameters "POPUP_HISTORY_POSITION_X" -> popx in let PARAMS_GetI SCSparameters "POPUP_HISTORY_POSITION_Y" -> popy in let PARAMS_GetI SCSparameters "POPUP_HISTORY_WIDTH" -> popw in let PARAMS_GetI SCSparameters "POPUP_HISTORY_HEIGHT" -> poph in let PARAMS_GetI SCSparameters "POPUP_HISTORY_MIN_WIDTH" -> popminw in let PARAMS_GetI SCSparameters "POPUP_HISTORY_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 300 (_locSCS "historylog-TITLE" nil) code nil nil -> cont in ( /* recuperation de l'historique */ let SITE_GetHistory SELECT_GetSite -> history in /* History*/ let mkSCSHistoryInfo [Channel cont nil nil nil nil] -> SCSHistoryInfo in let CREATION_Interface SCSHistoryInfo (HISTORY_Get history) history code -> cplist in POPUPWIN_SetHistoryCallBacks cont code history cplist; /* [S r1] descriptif des énoncés des actions exécutées par l'utilisateur */ /* reset previously saved width & height parameters */ if popw != nil then _SIZEEXcontainer cont popx popy popw poph else nil; [cont _locSCS "historylog-TITLE" nil] ) ;;