/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PopUpSiteServers.pkg */ /* Version : 05 juin 2000 */ /* Popup Site Servers window interface functions */ /* */ /***************************************************************************************/ fun SITESERVERS_FillList (serverlist, list, pos)= if serverlist == nil then 0 else ( _ADDcompList list pos [SITE_ServerPrint hd serverlist nil]; SITESERVERS_FillList tl serverlist list pos+1 ) ;; fun SITESERVERS_BuildList (site, list) = SITESERVERS_FillList site.SITEservers list 0; _PAINTobjNode _CONVERTcompListToObjNode list; 1 ;; fun SITESERVERS_SiteModified ( site, param, param2) = let param2 -> [list contentTxt] in if (param == REFLEX_SERVER) then ( _RSTcompList list; SITESERVERS_BuildList site list ) else if (param == REFLEX_SATSCOLCONTENT) then ( _SETcompText contentTxt SITE_GetSatelliteScolFileContent site nil nil CT_NOCHANGE; _PAINTobjNode _CONVERTcompTextToObjNode contentTxt; 1 ) else 0 ;; fun SITESERVERS_SiteSelected (site, param, param2) = let param2 -> [list txtContent] in if (param & REFLEX_UNSELECTION) then ( _RSTcompList list; 1 ) else if (param & REFLEX_SELECTION) then ( _SETcompText txtContent SITE_GetSatelliteScolFileContent site nil nil CT_NOCHANGE; _PAINTobjNode _CONVERTcompTextToObjNode txtContent; SITESERVERS_BuildList site list ) else 0 ;; fun SITESERVERS_Add (RollOver, param, posx, posy, button, mask) = let param -> [cpTxt1 cpTxt2 cpTxt3 check] in let [(_GETcompText cpTxt1) (_GETcompText cpTxt2) (_GETcompText cpTxt3)] -> [num ip port] in ( SITE_AddServer SELECT_GetSite num ip port; if (_GETcompCheckState check) == CHK_CHECKED then ( _SETcompText cpTxt1 (itoa ((atoi num)+1)) nil nil CT_NOCHANGE; _SETcompText cpTxt3 (itoa ((atoi port)+2)) nil nil CT_NOCHANGE; _PAINTobjNode _CONVERTcompTextToObjNode cpTxt1; _PAINTobjNode _CONVERTcompTextToObjNode cpTxt3 ) else nil ); 0 ;; fun SITESERVERS_Remove (RollOver, list, posx, posy, button, mask) = let _GETcompListClicked list -> [pos _] in if pos == nil then nil else SITE_RemoveServerFromPos SELECT_GetSite pos; 0 ;; fun SITESERVERS_Generate (RollOver, param, posx, posy, button, mask) = SITE_GenerateSatelliteScript SELECT_GetSite;; fun SITESERVERS_SetSatelliteScolFileContent (ctrl_text, param, typevalidation, ctrlValue) = let SELECT_GetSite -> site in ( if strcmp ctrlValue (SITE_GetSatelliteScolFileContent site) then SITE_SetSatelliteScolFileContent site ctrlValue else nil ); 0 ;; fun SITESERVERS_OnKillFocusContainer (cont, contentTxt) = SITESERVERS_SetSatelliteScolFileContent nil nil nil _GETcompText contentTxt ;; fun SITESERVERS_BuildInterface (Channel, cont, list, wcont, hcont) = UTILSGUI_SetOrCreateText Channel cont GUI_LABEL nil (_locSCS "popupsiteservers-SNB" nil) [20 30] [85 20] nil nil; UTILSGUI_SetOrCreateText Channel cont GUI_LABEL nil (_locSCS "popupsiteservers-SIP" nil) [125 30] [85 20] nil nil; UTILSGUI_SetOrCreateText Channel cont GUI_LABEL nil (_locSCS "popupsiteservers-SPORT" nil) [230 30] [85 20] nil nil; UTILSGUI_SetOrCreateText Channel cont GUI_LABEL nil (_locSCS "popupsiteservers-AUTOINCREMENT" nil) [40 78] [wcont-30 20] nil nil; UTILSGUI_SetOrCreateTextEx Channel cont GUI_LABEL nil strcat (_locSCS "popupsiteservers-SATSCOLCONTENT" nil) " :" [20 hcont-120] [wcont-30 20] nil nil OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_LABEL|CT_WORDWRAP|OBJ_LH_FLEX|OBJ_MW_FLEX ; let UTILSGUI_SetOrCreateText Channel cont GUI_TEXT nil "" [5 45] [100 20] nil nil -> servernbtxt in let UTILSGUI_SetOrCreateText Channel cont GUI_TEXT nil "" [110 45] [100 20] nil nil -> serveriptxt in let UTILSGUI_SetOrCreateText Channel cont GUI_TEXT nil "" [215 45] [100 20] nil nil -> serverporttxt in let GRAPHICDRESSING_CRcompCheck Channel cont nil [10 73] OBJ_VISIBLE|OBJ_ENABLE OBJ_CONTAINER_MOVE|OBJ_KEYBOARD -> incrementCheck in ( _SETcompTextAuthorizedChar servernbtxt "0123456789"; _SETcompTextAuthorizedChar serveriptxt "0123456789."; _SETcompTextAuthorizedChar serverporttxt "0123456789"; _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText Channel cont nil [10 100] OBJ_VISIBLE|OBJ_ENABLE OBJ_CONTAINER_MOVE|OBJ_KEYBOARD (wcont/2)-30 20 scsgui.SCSGUIsmallFont (_locSCS "popupsiteservers-ADD" nil) GD_DEFAULT_TEXT_BUTTON_COLOR @SITESERVERS_Add [servernbtxt serveriptxt serverporttxt incrementCheck]; _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText Channel cont nil [(wcont/2)+20 100] OBJ_VISIBLE|OBJ_ENABLE OBJ_CONTAINER_MOVE|OBJ_KEYBOARD (wcont/2)-30 20 scsgui.SCSGUIsmallFont (_locSCS "popupsiteservers-REMOVE" nil) GD_DEFAULT_TEXT_BUTTON_COLOR @SITESERVERS_Remove list; _CBcompRollOverClick GRAPHICDRESSING_CRcompRollOverWithText Channel cont nil [(wcont/4) hcont-30] OBJ_VISIBLE|OBJ_ENABLE|OBJ_LH_FLEX OBJ_CONTAINER_MOVE|OBJ_KEYBOARD (wcont/2) 20 scsgui.SCSGUIsmallFont (_locSCS "popupsiteservers-GENERATE" nil) GD_DEFAULT_TEXT_BUTTON_COLOR @SITESERVERS_Generate nil; UTILSGUI_SetOrCreateTextEx Channel cont GUI_TEXT nil "" [10 hcont-100] [wcont-20 60] @SITESERVERS_SetSatelliteScolFileContent nil OBJ_ENABLE|OBJ_VISIBLE|CT_LEFT|CT_MULTIEDITLINE|CT_WORDWRAP|OBJ_MW_FLEX|OBJ_LH_FLEX ) ;; fun SITESERVERS_ListToolTip () = _locSCS "LOC_TOOLTIP_SITE_SERVERS_LIST" nil;; fun SITESERVERS_CreateList(Channel, cont)= let _GETcontainerPositionSize cont -> [_ _ wcont hcont] 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 Channel cont nil [10 130] 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 hcont-265 10 LST_VERTICAL scsgui.SCSGUIsmallFont 10 [txtcolor 0 0 0] [highlightcolor colortransp] -> list in let SITESERVERS_BuildInterface Channel cont list wcont hcont -> txtContent in ( TOOLTIP_DynamicLink cont (_CONVERTcompListToObjNode list) scsgui.SCSGUIstaticToolTip @SITESERVERS_ListToolTip; SITESERVERS_SiteSelected SELECT_GetSite REFLEX_SELECTION|REFLEX_PRIORITY_ONE [list txtContent]; let PARAMS_GetI SCSparameters "POPUP_SITESERVERS_POSITION_X" -> popx in let PARAMS_GetI SCSparameters "POPUP_SITESERVERS_POSITION_Y" -> popy in let PARAMS_GetI SCSparameters "POPUP_SITESERVERS_WIDTH" -> popw in let PARAMS_GetI SCSparameters "POPUP_SITESERVERS_HEIGHT" -> poph in if popw != nil then _SIZEEXcontainer cont popx popy popw (if (poph > 425) then poph else 425) else nil; [list txtContent] ) ;; fun SITESERVERS_OnPreDestroy (cont) = let _GETcontainerPositionSize cont -> [popx popy popw poph] in ( PARAMS_SetI SCSparameters "POPUP_SITESERVERS_POSITION_X" popx; PARAMS_SetI SCSparameters "POPUP_SITESERVERS_POSITION_Y" popy; PARAMS_SetI SCSparameters "POPUP_SITESERVERS_WIDTH" popw; PARAMS_SetI SCSparameters "POPUP_SITESERVERS_HEIGHT" poph ); 1 ;; fun POPUPWIN_SetSiteServersCallBacks (cont, param, param2) = POPUPWIN_CBpopupPreDestroy @SITESERVERS_OnPreDestroy cont ; let param2 -> [_ contentTxt] in ( REFLEX_CBsiteModified mkfun3 @SITESERVERS_SiteModified param2; REFLEX_CBsiteSelected mkfun3 @SITESERVERS_SiteSelected param2; _CBcontainerKillFocus cont @SITESERVERS_OnKillFocusContainer contentTxt ) ;; fun POPUPWIN_CreateSiteServers (Channel, win, code) = let PARAMS_GetI SCSparameters "POPUP_SITESERVERS_POSITION_X" -> popx in let PARAMS_GetI SCSparameters "POPUP_SITESERVERS_POSITION_Y" -> popy in let PARAMS_GetI SCSparameters "POPUP_SITESERVERS_MIN_WIDTH" -> popminw in let PARAMS_GetI SCSparameters "POPUP_SITESERVERS_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 320 if (popminh != nil) && (popminh > 425) then popminh else 425 (_locSCS "popupsiteservers-TITLE" nil) code nil nil -> cont in ( POPUPWIN_SetSiteServersCallBacks cont code (SITESERVERS_CreateList Channel cont); [cont (_locSCS "popupsiteservers-TITLE" nil)] ) ;;