/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : ScsGi.pkg */ /* Version : 16 juin 2000 */ /* Scs Graphic Interface struct and basic functions */ /* */ /***************************************************************************************/ proto GD_TITLEBAR_CreateCloseButtonBitmap = fun [Chn] AlphaBitmap ;; struct WindowManager = [ WINMANAGwinList : [[I ObjContainer I] r1] , /* window list : winCode container visibility */ WINMANAGmainCont : ObjContainer , /* main container */ WINMANAGtitle : CompText , /* comptext for the title */ WINMANAGmenu : [MenuData r1 ] /* main window menu item list */ ] mkWindowManager ;; struct ScsGui = [ SCSGUIwindowManager : WindowManager , /* SCS windows manager data */ SCSGUIchannel : Chn , /* SCS main channel */ SCSGUIfont : ObjFont , /* SCS main font */ SCSGUIweightFont : ObjFont , /* SCS windows title font */ SCSGUIsmallFont : ObjFont , /* SCS small font for popup windows */ SCSGUIstaticToolTip : ScsToolTip , /* SCS static tooltips parameters */ SCSGUIdynamicToolTip : ScsToolTip , /* SCS dynamic tooltips parameters */ SCSGUIeditorsManager : EditorsManager , /* Editors manager structure */ SCSGUIwaitCont : ObjContainer , /* wait container popup */ SCSGUIwaitText : CompText , /* wait comp text */ SCSGUIcurrentView : I , /* current edition view : module, server zone, client zone */ SCSGUIviewCBfunctions : [fun [I] I r1] , /* list of subscribed functions for scs Interface View Change CB */ SCSGUIviewBBCBfunctions : [fun [I] I r1] /* list of subscribed functions for Black Box View Change CB */ ] mkScsGui ;; typeof scsgui = ScsGui;; /* Default Fonts proposed to end user */ typeof SCSDATA_DEFAULTFONT_NORMAL_1 = ObjFont ;; typeof SCSDATA_DEFAULTFONT_NORMAL_2 = ObjFont ;; typeof SCSDATA_DEFAULTFONT_NORMAL_3 = ObjFont ;; proto WINMANAG_Create = fun [Chn] WindowManager;; proto WINMANAG_Destroy = fun []I;; fun SCSGUI_GetCurrentZoneRoot () = if scsgui.SCSGUIcurrentView == MAINWIN_ZONE_CLIENT then SITE_GetClientZoneRoot SELECT_GetSite else SITE_GetServerZoneRoot SELECT_GetSite ;; fun SCSGUI_GetCurrentZoneRootTree () = let SELECT_GetSite -> site in if scsgui.SCSGUIcurrentView == MAINWIN_ZONE_CLIENT then site.SITEclientZonesTreeRoot else site.SITEserverZonesTreeRoot ;; fun SCSGUI_CreateGUIstructure(chan) = { let if (PARAMS_GetS SCSparameters "SCSDATA_DEFAULTFONT") == nil then "Arial" else (PARAMS_GetS SCSparameters "SCSDATA_DEFAULTFONT") -> sfontName in set scsgui = mkScsGui [ nil chan _CRfont chan 14 0 0 sfontName _CRfont chan 14 0 FF_WEIGHT sfontName _CRfont chan 12 0 0 sfontName nil nil nil nil nil nil nil nil ] ; } ;; proto SCSGUI_ChangeViewOnModuleSelection = fun [[Module r1] I] I;; proto SCSGUI_ChangeViewOnZoneSelection = fun [[Zone r1] I] I;; fun SCSGUI_Destroy ()= WINMANAG_Destroy; _DSfont scsgui.SCSGUIfont; _DSfont scsgui.SCSGUIweightFont; _DSfont scsgui.SCSGUIsmallFont; set scsgui = nil ;; fun SCSGUI_GetLastDirectory () = PARAMS_GetS SCSparameters "LAST_DIRECTORY_USED" ;; fun SCSGUI_SetLastDirectory (dir) = if IsEmptyString dir then nil else PARAMS_SetS SCSparameters "LAST_DIRECTORY_USED" dir ;; fun SCSGUI_GetLastReportDirectory () = let PARAMS_GetS SCSparameters "LAST_REPORT_DIRECTORY_USED" -> dir in if IsEmptyString dir then "tmp/" else dir ;; fun SCSGUI_SetLastReportDirectory (dir) = if IsEmptyString dir then nil else PARAMS_SetS SCSparameters "LAST_REPORT_DIRECTORY_USED" dir ;; proto GRAPHICDRESSING_OpenLoadingDialogBox = fun [Chn ObjContainer S u0] [ObjContainer CompText];; fun SCSGUI_OpenLoadingDialogBox (text) = if scsgui.SCSGUIwaitCont == nil then let GRAPHICDRESSING_OpenLoadingDialogBox scsgui.SCSGUIchannel scsgui.SCSGUIwindowManager.WINMANAGmainCont text nil -> [cont comptext] in ( set scsgui.SCSGUIwaitCont = cont; set scsgui.SCSGUIwaitText = comptext; ) else ( _SETcompText scsgui.SCSGUIwaitText text nil nil nil; _PAINTobjNode _CONVERTcompTextToObjNode scsgui.SCSGUIwaitText; _SHOWcontainer scsgui.SCSGUIwaitCont CONTAINER_UNHIDDEN; nil ); 1 ;; fun SCSGUI_CloseLoadingDialogBox () = if scsgui.SCSGUIwaitCont == nil then nil else _SHOWcontainer scsgui.SCSGUIwaitCont CONTAINER_HIDDEN; 1 ;;