/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PopUpWindow.pkg */ /* Version : 16 juin 2000 */ /* Popup window functions */ /* */ /***************************************************************************************/ typeof PW_LOCALPREDESTROYFUNLIST = [[fun [ ObjContainer ] I ObjContainer] r1] ;; /**************************************************************************************** POPUP WINDOW CALLBACKS FUNCTIONS ****************************************************************************************/ fun POPUPWIN_CBpopupPreDestroy (funpointer, param) = { set PW_LOCALPREDESTROYFUNLIST = [funpointer param]::PW_LOCALPREDESTROYFUNLIST ; };; fun POPUPWIN_ExecPopupPreDestroyCallbacks(list) = { if list != nil then let list -> [ [funpointer param] next] in { exec funpointer with [param] ; POPUPWIN_ExecPopupPreDestroyCallbacks next ; 0 ; } else 0 ; } ;; fun POPUPWIN_ReleaseAll()= { POPUPWIN_ExecPopupPreDestroyCallbacks PW_LOCALPREDESTROYFUNLIST ; } ;; fun POPUPWIN_WinDestroy (cont, param) = WINMANAG_HideWin param ;; fun POPUPWIN_HideWhenDestroy (cont, param) = { _CBcontainerPreDestroy cont @POPUPWIN_WinDestroy param ; } ;; /**************************************************************************************** POPUP WINDOW OTHERS FUNCTIONS ****************************************************************************************/ fun POPUPWIN_Destroy (cont) = _DScontainer cont ;; proto POPUPWIN_CreateProperties = fun [Chn ObjContainer I] [ObjContainer S];; proto POPUPWIN_CreateSiteOptions = fun [Chn ObjContainer I] [ObjContainer S];; proto POPUPWIN_CreateHistoryLog = fun [Chn ObjContainer I] [ObjContainer S];; proto POPUPWIN_CreateErrorLog = fun [Chn ObjContainer I] [ObjContainer S];; proto POPUPWIN_CreateSCSPref = fun [Chn ObjContainer I] [ObjContainer S];; /*proto POPUPWIN_CreateToolBar = fun [Chn ObjWin I] [ObjContainer S];;*/ proto POPUPWIN_CreateSiteTree = fun [Chn ObjContainer I] [ObjContainer S];; proto POPUPWIN_CreateCreationTree = fun [Chn ObjContainer I] [ObjContainer S];; proto POPUPWIN_CreateSiteServers = fun [Chn ObjContainer I] [ObjContainer S];; fun POPUPWIN_CloseRol ( rol, param, posx, posy, btn, mask )= let param -> [cont code] in POPUPWIN_WinDestroy cont code ;; fun POPUPWIN_OnClose(param)= { let param -> [cont code] in POPUPWIN_WinDestroy cont code } ;; fun POPUPWIN_Create (Channel, cont, code) = let if code == POPUPWIN_PROPERTIES then POPUPWIN_CreateProperties Channel cont code else if code == POPUPWIN_SITEOPTIONS then POPUPWIN_CreateSiteOptions Channel cont code else if code == POPUPWIN_SCSPREF then POPUPWIN_CreateSCSPref Channel cont code else if code == POPUPWIN_ERRORLOG then POPUPWIN_CreateErrorLog Channel cont code else if code == POPUPWIN_HISTORYLOG then POPUPWIN_CreateHistoryLog Channel cont code/* appel à la fonction de création de la fenêtre historique */ /* else if code == POPUPWIN_TOOLBAR then POPUPWIN_CreateToolBar Channel win code*/ else if code == POPUPWIN_SITETREE then POPUPWIN_CreateSiteTree Channel cont code else if code == POPUPWIN_CREATIONTREE then POPUPWIN_CreateCreationTree Channel cont code else if code == POPUPWIN_SITESERVERS then POPUPWIN_CreateSiteServers Channel cont code else nil -> [cont name] in ( if cont == nil then ( ERRORS_AddError 1 2 (_locSCS "errorlabel-POPUPCODEINVALID" nil) ;0) else nil; _PAINTcontainer cont; ) ;; fun POPUP_Ini (Channel) = 0 ;; /*************************************************************************************** * * Creates Popup Window * ***************************************************************************************/ fun POPUPWIN_CreatePopupWindow(Channel, cont, x, y, width, height, scaption, param, maxwidth, maxheight) = /* Creates a popup window */ /* Channel - channel cont - Mother window x y width height - window left-hand corner position and width & height in pixels (width must be >12) scaption - Title caption of the new window param - parameter that will be passed to callback functions returns a container (CompContainer) */ { let _GETscreenSize -> [screenw screenh] in let if maxwidth == nil then screenw else maxwidth -> maxw in let if maxheight == nil then screenh else maxheight -> maxh in let GRAPHICDRESSING_CRcontainer Channel cont [x y width height] [width height maxw maxh] GD_DEFAULT_BACKGROUNDCOLOR scaption scsgui.SCSGUIweightFont [GD_WINDOWS_TITLE_COLOR1 0 1 0x50] GDWIN_BORDERS|GDWIN_CLOSE_BUTTON/*|GDWIN_ROLL_DBLCLICK MAT ICI desactive, pb lie au resize des objets en OBJ_LH_FLEX */ [nil nil nil] -> [contPop compTitle compMin compMax compClose _] in { TOOLTIP_StaticLink contPop _CONVERTcompRollOverToObjNode compMin scsgui.SCSGUIstaticToolTip (_locSCS "LOC_TOOLTIP_MINWIN" nil); TOOLTIP_StaticLink contPop _CONVERTcompCheckToObjNode compMax scsgui.SCSGUIstaticToolTip (_locSCS "LOC_TOOLTIP_MAXWIN" nil); TOOLTIP_StaticLink contPop _CONVERTcompRollOverToObjNode compClose scsgui.SCSGUIstaticToolTip (_locSCS "LOC_TOOLTIP_HIDEPOPUP" nil); UTILSGUI_MoveWithBackground contPop param; POPUPWIN_HideWhenDestroy contPop param; contPop ; } ; } ;;