/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PopUpSiteOptions.pkg */ /* Version : 19 juin 2000 */ /* Popup Site Options window specific functions */ /* */ /***************************************************************************************/ /* Update control variables */ var SITEOPTIONS_SETNAME = 1 ;; var SITEOPTIONS_SETPORT = 2 ;; var SITEOPTIONS_SETTIMEOUT = 3 ;; var SITEOPTIONS_SETLOADCAPACITY = 4 ;; var SITEOPTIONS_SETPASSWORD = 5 ;; var SITEOPTIONS_SETAUTHORNAME = 6 ;; var SITEOPTIONS_SETAUTHOREMAIL = 7 ;; var SITEOPTIONS_SETSITEDESC = 8 ;; var SITEOPTIONS_SETSITELANG = 9 ;; var SITEOPTIONS_SETSITESCREENSHOTNAME = 10;; var SITEOPTIONS_SETSITESCOLCONTENT = 11;; var SO_bLockDialogBoxOpening = 0 ;; var SO_bLockDialogBoxSaving = 0 ;; /* Definition of SITE INFO STRUCTURE */ struct Struct_SiteOptionsInfo = [ m_Channel : Chn , /* channel */ ctrl_Container : ObjContainer , /* container */ ctrl_SiteName : CompText , /* Site name edit box control */ ctrl_SitePassword : CompText , /* Site password edit box control */ ctrl_SitePort : CompText , /* Site port number edit box */ ctrl_SiteClientTimeOut : CompText , /* Site client time out edit box */ ctrl_SiteLoadCapacity : CompText , /* Nb Client max edit box */ ctrl_SiteAuthorName : CompText , /* Site auhtor name */ ctrl_SiteAuthorEmail : CompText , /* Site author email address */ ctrl_SiteDescription : CompText , /* site description message */ ctrl_SiteScreenshot : CompText , /* site screenshot bitmap filename */ ctrl_SiteScolFileContent : CompText , /* site save scol file content */ ctrl_SiteDate : CompText , /* site last save Date */ ctrl_SiteVersion : CompText , /* site version (number of save) */ ctrl_SiteLang : CompText , /* site language */ ctrl_SitePropertieKey : CompText , /* propertie key */ ctrl_SitePropertieVal : CompText , /* propertie value */ ctrl_SiteProperties : CompList /* site properties */ ] mkSiteOptionsInfo;; fun SITEOPTIONS_ValidateBitmapScreenshotFilename (filename) = /* returns 1 for success, 0 otherwise */ { if (filename == nil) || (!strcmp filename "") then 1 else let _FILEOpen _channel _checkpack filename -> ffile in let PARAMS_GetI SCSparameters "SITEOPTIONS_MAX_FILESIZE" -> maxsize in if (_FILESize ffile) > maxsize then ( _FILEClose ffile ; 0 ) else (_FILEClose ffile ; 1) ; } ;; fun SITEPROPERTIES_FillList (proplist, list, pos)= if proplist == nil then 0 else ( _ADDcompList list pos [SITE_PropertiePrint hd proplist nil]; SITEPROPERTIES_FillList tl proplist list pos+1 ) ;; fun SITEOPTIONS_SetSiteProperties (site, siteInfo) = _RSTcompList siteInfo.ctrl_SiteProperties; SITEPROPERTIES_FillList site.SITEproperties siteInfo.ctrl_SiteProperties 0; _PAINTobjNode _CONVERTcompListToObjNode siteInfo.ctrl_SiteProperties; 1 ;; fun SITEOPTIONS_AddPropertie (RollOver, siteInfo, posx, posy, button, mask) = SITE_AddPropertie SELECT_GetSite (_GETcompText siteInfo.ctrl_SitePropertieKey) (_GETcompText siteInfo.ctrl_SitePropertieVal); 0 ;; fun SITEOPTIONS_RemovePropertie (RollOver, siteInfo, posx, posy, button, mask) = let _GETcompListClicked siteInfo.ctrl_SiteProperties -> [pos _] in if pos == nil then nil else SITE_RemovePropertieFromPos SELECT_GetSite pos; 0 ;; fun SITEOPTIONS_SetSiteOption(ctrl_text, param, typevalidation, ctrlValue) = /* called as soon as a change occured in the site options window */ { if ctrlValue == nil then nil else let SELECT_GetSite -> site in { if param == SITEOPTIONS_SETNAME then { /* Sets Site name */ if strcmp ctrlValue SITE_GetName site then SITE_SetName site ctrlValue 1 else nil; } else if param == SITEOPTIONS_SETPASSWORD then { /* Sets Site password */ if strcmp ctrlValue SITE_GetPassword site then SITE_SetPassword site ctrlValue else nil; } else if param == SITEOPTIONS_SETPORT then { /* Sets site port number, must be >0*/ let SITE_GetPort site -> nOldPort in let atoi ctrlValue -> num in if num > 0 then if num != nOldPort then SITE_SetPort site num else nil else SITE_SetPort site nOldPort } else if param == SITEOPTIONS_SETTIMEOUT then { /* Sets site Client disconnection timeout, must be positive */ let SITE_GetTimeout site -> numOld in let atoi ctrlValue -> num in if num > 0 then if num != numOld then SITE_SetTimeout site num else nil else SITE_SetTimeout site numOld } else if param == SITEOPTIONS_SETLOADCAPACITY then { /* Sets client Load Capacity */ let SITE_GetLoadCapacity site -> numOld in let if strcmp ctrlValue "" then atoi ctrlValue else nil -> num in if num > 0 then if num != numOld then SITE_SetLoadCapacity site num else nil else SITE_SetLoadCapacity site numOld } else if param == SITEOPTIONS_SETAUTHORNAME then { /* Sets site author name */ if strcmp ctrlValue webtostr SITE_GetAuthorName site then SITE_SetAuthorName site strtoweb ctrlValue else nil ; } else if param == SITEOPTIONS_SETAUTHOREMAIL then { /* Sets site author email address */ if strcmp ctrlValue SITE_GetAuthorEmail site then SITE_SetAuthorEmail site ctrlValue else nil ; } else if param == SITEOPTIONS_SETSITEDESC then { /* Sets site description */ if strcmp ctrlValue webtostr SITE_GetSiteDescription site then SITE_SetSiteDescription site strtoweb ctrlValue else nil ; } else if param == SITEOPTIONS_SETSITESCOLCONTENT then { /* Sets site scol file content */ if strcmp ctrlValue SITE_GetScolFileContent site then SITE_SetScolFileContent site ctrlValue else nil; } else if param == SITEOPTIONS_SETSITELANG then { /* Sets site language */ if strcmp ctrlValue SITE_GetSiteLanguage site then SITE_SetSiteLanguage site ctrlValue else nil ; } else if param == SITEOPTIONS_SETSITESCREENSHOTNAME then { /* Sets site bitmap screenshot */ if strcmp ctrlValue SITE_GetScreenshotName site then { if !SITEOPTIONS_ValidateBitmapScreenshotFilename ctrlValue then { ERRORS_AddError 2 4 (_locSCS "errorlabel-6" nil) ; _SETcompText ctrl_text SITE_GetScreenshotName site nil nil CT_BEGIN ; 0 } else SITE_SetScreenshotName site ctrlValue ; _PAINTobjNode _CONVERTcompTextToObjNode ctrl_text ; 0 } else nil ; } else nil ; } } ;; fun SITEOPTIONS_OnChangeCompText(comptext, type) = SITEOPTIONS_SetSiteOption comptext type nil _GETcompText comptext;; fun SITEOPTIONS_OnCloseBitmapChooseDialogBox (retval, filename, Info)= set SO_bLockDialogBoxOpening = 0 ; if retval then ( let getPathFile filename "" -> [res _] in SCSGUI_SetLastDirectory res; if !SITEOPTIONS_ValidateBitmapScreenshotFilename filename then ( ERRORS_AddError 2 54 (_locSCS "errorlabel-6" nil); 0 ) else ( _SETcompText Info.ctrl_SiteScreenshot filename nil nil CT_END ; SITEOPTIONS_SetSiteOption Info.ctrl_SiteScreenshot SITEOPTIONS_SETSITESCREENSHOTNAME nil filename ; 1 ) ) else 0 ;; fun SITEOPTIONS_OnCloseReportSaveDialogBox (retval, filename, Info)= if retval then ( SCSGUI_OpenLoadingDialogBox (_locSCS "site-REPORTING" nil); let getPathFile filename "" -> [res _] in SCSGUI_SetLastReportDirectory res; SITE_ReportInFile SELECT_GetSite filename; SCSGUI_CloseLoadingDialogBox ) else nil; set SO_bLockDialogBoxSaving = 0; 0 ;; fun SITEOPTIONS_OnClickSiteReportSave (button, Info, posx, posy, buttontype, mask) = if !SO_bLockDialogBoxSaving then ( set SO_bLockDialogBoxSaving = 1; GRAPHICDRESSING_SelectDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "popupsiteoptions-REPORTSAVE" nil) @SITEOPTIONS_OnCloseReportSaveDialogBox (".txt"::nil)::nil "*.txt"::nil SCSGUI_GetLastReportDirectory Info SELECT_DIALOG_BOX_SAVE ) else nil; 0 ;; fun SITEOPTIONS_OnClickChooseBitmapButton (button, Info, posx, posy, buttontype, mask) = if !SO_bLockDialogBoxOpening then { set SO_bLockDialogBoxOpening = 1 ; GRAPHICDRESSING_SelectDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont (_locSCS "Open-Bitmap-File" nil) @SITEOPTIONS_OnCloseBitmapChooseDialogBox (".jpg"::".jpeg"::".bmp"::nil)::nil "bitmap files"::nil SCSGUI_GetLastDirectory Info SELECT_DIALOG_BOX_OPEN } else nil ; 1 ;; fun SITEOPTIONS_SetSiteSaveInfo (site, siteInfo) = let SITE_GetSaveInfo site -> [version datelastsave] in ( set siteInfo.ctrl_SiteVersion = UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL siteInfo.ctrl_SiteVersion strcatn (_locSCS "popupsiteoptions-SITEVERSION" nil)::" : "::(itoa version)::nil [10 40] [100 20] nil nil; set siteInfo.ctrl_SiteDate = UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL siteInfo.ctrl_SiteDate strcatn (_locSCS "popupsiteoptions-SITEDATE" nil)::" : "::datelastsave::nil [110 40] [200 20] nil nil; ) ;; fun SITEOPTIONS_CreateLabels (siteInfo) = let _GETcontainerPositionSize siteInfo.ctrl_Container -> [_ _ wcont hcont] in ( UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil strcat (_locSCS "popupsiteoptions-SITENAME" nil) " " [10 67] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil strcat (_locSCS "popupsiteoptions-SITEPASSWORD" nil) " " [10 92] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-CHOOSEBITMAP" nil) [10 119] [130 20] nil nil; _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText siteInfo.m_Channel siteInfo.ctrl_Container nil [140 117] OBJ_VISIBLE|OBJ_ENABLE OBJ_KEYBOARD 25 20 scsgui.SCSGUIsmallFont "..." GD_DEFAULT_TEXT_BUTTON_COLOR @SITEOPTIONS_OnClickChooseBitmapButton siteInfo; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-PORTNB" nil) [10 148] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-LOADCAP" nil) [10 173] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-CLITIMEOUT" nil) [10 198] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-AUTHORNAME" nil) [10 223] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-AUTHOREMAIL" nil) [10 248] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-LANG" nil) [10 273] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-SITEDESC" nil) [10 298] [wcont-30 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-SITESCOLFILECONTENT" nil) [10 375] [wcont-30 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-SITEPROPERTIES" nil) [10 445] [wcont-30 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-PROPERTIEKEY" nil) [10 462] [130 20] nil nil; UTILSGUI_SetOrCreateText siteInfo.m_Channel siteInfo.ctrl_Container GUI_LABEL nil (_locSCS "popupsiteoptions-PROPERTIEVAL" nil) [160 462] [130 20] nil nil; set siteInfo.ctrl_SitePropertieKey = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SitePropertieKey "" [10 477] [130 20] nil nil OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE; set siteInfo.ctrl_SitePropertieVal = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SitePropertieVal "" [160 477] [130 20] nil nil OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE; _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText siteInfo.m_Channel siteInfo.ctrl_Container nil [10 500] OBJ_VISIBLE|OBJ_ENABLE OBJ_KEYBOARD 130 20 scsgui.SCSGUIsmallFont (_locSCS "popupsiteoptions-ADDPROPERTIE" nil) GD_DEFAULT_TEXT_BUTTON_COLOR @SITEOPTIONS_AddPropertie siteInfo ; _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText siteInfo.m_Channel siteInfo.ctrl_Container nil [160 500] OBJ_VISIBLE|OBJ_ENABLE OBJ_KEYBOARD 130 20 scsgui.SCSGUIsmallFont (_locSCS "popupsiteoptions-REMOVEPROPERTIE" nil) GD_DEFAULT_TEXT_BUTTON_COLOR @SITEOPTIONS_RemovePropertie siteInfo ; let GD_COMPLIST_HIGHLIGHT_TRANSPARENCY -> colortransp in let GD_COMPLIST_TEXT_COLOR -> txtcolor in let GD_COMPLIST_HIGHLIGHT_COLOR -> highlightcolor in set siteInfo.ctrl_SiteProperties = GRAPHICDRESSING_CRcompList siteInfo.m_Channel siteInfo.ctrl_Container nil [10 525] OBJ_ENABLE|OBJ_VISIBLE|LST_LEFT|LST_HIGHLIGHT_CLICKED|OBJ_MH_FLEX|OBJ_MW_FLEX OBJ_CONTAINER_UNCLICK|OBJ_CONTAINER_MOVE|OBJ_KEYBOARD wcont-20 80 4 LST_VERTICAL scsgui.SCSGUIsmallFont 4 [txtcolor 0 0 0] [highlightcolor colortransp]; _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText siteInfo.m_Channel siteInfo.ctrl_Container nil [50 620] OBJ_VISIBLE|OBJ_ENABLE|OBJ_LH_FLEX OBJ_KEYBOARD 200 20 scsgui.SCSGUIsmallFont (_locSCS "popupsiteoptions-REPORTSAVE" nil) GD_DEFAULT_TEXT_BUTTON_COLOR @SITEOPTIONS_OnClickSiteReportSave siteInfo ; ) ;; fun SITEOPTIONS_RefreshSiteOptionsWindow(site,siteInfo) = /* Creates or redraw site options popup child window*/ let SITE_GetLoadCapacity site -> nCapacity in let if (nCapacity == nil || nCapacity == 0) then (_locSCS "site-NOLOADCAPACITY" nil) else (itoa nCapacity) -> sCapacity in let _GETcontainerPositionSize siteInfo.ctrl_Container -> [_ _ wcont hcont] in { set siteInfo.ctrl_SiteName = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteName (SITE_GetName site) [140 65] [wcont-150 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETNAME OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX; set siteInfo.ctrl_SitePassword = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SitePassword (SITE_GetPassword site) [140 90] [wcont-150 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETPASSWORD OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX; set siteInfo.ctrl_SiteScreenshot = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteScreenshot (SITE_GetScreenshotName site) [170 117] [wcont-180 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETSITESCREENSHOTNAME OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX; /* Port, Load Capacity, Client disconnection Timeout */ set siteInfo.ctrl_SitePort = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SitePort (itoa SITE_GetPort site) [140 145] [wcont-150 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETPORT OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX; set siteInfo.ctrl_SiteLoadCapacity = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteLoadCapacity sCapacity [140 170] [wcont-150 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETLOADCAPACITY OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX; /* ICI TONY */ let _CONVERTcompTextToObjNode siteInfo.ctrl_SiteLoadCapacity -> obnode in TOOLTIP_StaticLink siteInfo.ctrl_Container obnode scsgui.SCSGUIstaticToolTip (_locSCS "LOC_TOOLTIP_Load_Capacity" nil); set siteInfo.ctrl_SiteClientTimeOut = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteClientTimeOut (itoa SITE_GetTimeout site) [140 195] [wcont-150 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETTIMEOUT OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX ; set siteInfo.ctrl_SiteAuthorName = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteAuthorName (webtostr SITE_GetAuthorName site) [140 220] [wcont-150 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETAUTHORNAME OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX ; set siteInfo.ctrl_SiteAuthorEmail = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteAuthorEmail (SITE_GetAuthorEmail site) [140 245] [wcont-150 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETAUTHOREMAIL OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX; set siteInfo.ctrl_SiteLang = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteLang (SITE_GetSiteLanguage site) [140 270] [wcont-150 20] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETSITELANG OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_EDITLINE|OBJ_MW_FLEX; set siteInfo.ctrl_SiteDescription = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteDescription (webtostr SITE_GetSiteDescription site) [10 310] [wcont-25 50] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETSITEDESC OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_MULTIEDITLINE|CT_WORDWRAP|OBJ_MW_FLEX; set siteInfo.ctrl_SiteScolFileContent = UTILSGUI_SetOrCreateTextEx siteInfo.m_Channel siteInfo.ctrl_Container GUI_TEXT siteInfo.ctrl_SiteScolFileContent (SITE_GetScolFileContent site) [10 390] [wcont-25 50] @SITEOPTIONS_SetSiteOption SITEOPTIONS_SETSITESCOLCONTENT OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_MULTIEDITLINE|CT_WORDWRAP|OBJ_MW_FLEX; SITEOPTIONS_SetSiteSaveInfo site siteInfo; SITEOPTIONS_SetSiteProperties site siteInfo; _PAINTcontainer siteInfo.ctrl_Container ; } ;; fun SITEOPTIONS_SiteSelected( site, param, siteInfo )= if param & REFLEX_SELECTION then ( SITEOPTIONS_RefreshSiteOptionsWindow site siteInfo ; 0 ) else nil ;; fun SITEOPTIONS_SiteModified( site, param, siteInfo )= if param == REFLEX_STATUS then ( SITEOPTIONS_SetSiteSaveInfo site siteInfo; _PAINTcontainer siteInfo.ctrl_Container ; nil ) else SITEOPTIONS_RefreshSiteOptionsWindow site siteInfo; 0 ;; /* fonctions generiques aux fenetres pop-up */ fun SITEOPTIONS_OnPreDestroy (cont) = let _GETcontainerPositionSize cont -> [popx popy popw poph] in ( PARAMS_SetI SCSparameters "POPUP_SITEOPTIONS_POSITION_X" popx ; PARAMS_SetI SCSparameters "POPUP_SITEOPTIONS_POSITION_Y" popy ; PARAMS_SetI SCSparameters "POPUP_SITEOPTIONS_WIDTH" popw ; PARAMS_SetI SCSparameters "POPUP_SITEOPTIONS_HEIGHT" poph ; ); 1 ;; fun SITEOPTIONS_OnKillFocusContainer (cont, Info) = SITEOPTIONS_SetSiteOption Info.ctrl_SiteScolFileContent SITEOPTIONS_SETSITESCOLCONTENT nil _GETcompText Info.ctrl_SiteScolFileContent; SITEOPTIONS_SetSiteOption Info.ctrl_SiteDescription SITEOPTIONS_SETSITEDESC nil _GETcompText Info.ctrl_SiteDescription ;; fun SITEOPTIONS_OnClickContainer (cont, Info, posx, poy, btn, mask) = SITEOPTIONS_OnKillFocusContainer cont Info ;; fun POPUPWIN_SetSiteOptionsCallBacks (cont, param, siteInfo ) = POPUPWIN_CBpopupPreDestroy @SITEOPTIONS_OnPreDestroy cont ; _CBcontainerKillFocus cont @SITEOPTIONS_OnKillFocusContainer siteInfo ; /* s'inscrire aux call back de sélection d'élément */ REFLEX_CBsiteSelected mkfun3 @SITEOPTIONS_SiteSelected siteInfo; REFLEX_CBsiteModified mkfun3 @SITEOPTIONS_SiteModified siteInfo ;; fun POPUPWIN_CreateSiteOptions (Channel, win, code) = let PARAMS_GetI SCSparameters "POPUP_SITEOPTIONS_POSITION_X" -> popx in let PARAMS_GetI SCSparameters "POPUP_SITEOPTIONS_POSITION_Y" -> popy in let PARAMS_GetI SCSparameters "POPUP_SITEOPTIONS_WIDTH" -> popw in let PARAMS_GetI SCSparameters "POPUP_SITEOPTIONS_HEIGHT" -> poph in let PARAMS_GetI SCSparameters "POPUP_SITEOPTIONS_MIN_WIDTH" -> popminw in let PARAMS_GetI SCSparameters "POPUP_SITEOPTIONS_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 >= 300) then popminw else 300 650 (_locSCS "popupsiteoptions-TITLE" nil) code nil 650 -> cont in let mkSiteOptionsInfo [Channel cont nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> siteInfo in ( /* Sets callbacks */ POPUPWIN_SetSiteOptionsCallBacks cont code siteInfo ; /* reset previously saved width & height parameters */ if popw != nil then _SIZEEXcontainer cont popx popy (if popw < 300 then 300 else popw) 650 else nil; SITEOPTIONS_CreateLabels siteInfo; /* Called at first to fill in the site options popup window */ SITEOPTIONS_RefreshSiteOptionsWindow SELECT_GetSite siteInfo ; [cont (_locSCS "popupsiteoptions-TITLE" nil)] ; ) ;;