/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : PopUpProperties.pkg */ /* Version : 19 juin 2000 */ /* Popup properties window specific functions */ /* */ /***************************************************************************************/ /* properties selection code */ var PROPERTIES_MODULE = 1;; var PROPERTIES_ZONE = 2;; var PROPERTIES_LINK = 3;; var PROPERTIES_MODULES = 4;; struct PropertiesWin = [ PROPcurrentSelection : I , /* current properties selection code */ PROPpreviousSelection : I , /* previous properties selection code */ PROPchannel : Chn , /* channel */ PROPcontainer : ObjContainer , /* container */ /* MODULE and LINK elements */ PROPname1Label : CompText , /* name 1 label */ PROPname1Text : CompText , /* name 1 */ PROPname2Label : CompText , /* name 2 label */ PROPname2Text : CompText , /* name 2 */ PROPlinkLabel : CompText , /* link label */ PROPlinkType : CompCombo , /* link type */ PROPparameterLabel : CompText , /* link parameter label */ PROPparameter : CompText , /* link parameter */ PROPconditionLabel : CompText , /* link condition label */ PROPcondition : CompText , /* link condition */ PROPmultipleLabel : CompText , /* multiple selection label */ PROPlinkList : CompList , /* link list */ PROPModReportSave : CompRollOver , /* module(s) report save button */ /* ZONE elements */ PROPzoneNameLabel : CompText , /* zone name label */ PROPpositionLabel : CompText , /* position label */ PROPzoneName : CompText , /* zone name */ PROPposition : PositionChart , /* position chart */ PROPselectBitmap : CompRollOver , /* select bitmap button */ PROPselectColor : CompRollOver , /* select color button */ PROPbitmap : CompText , /* bitmap text */ PROPbitmapLabel : CompText , /* bitmap label */ PROPbitmapType : CompCombo , /* bitmap type */ PROPcolorLabel : CompText , /* color label */ PROPcolorEditBox : CompText , /* color text */ ASSOzoneName : CompText , /* selected zone name */ ASSOlist : CompList /* module zone association for selected zone */ ] mkPropertiesWin ;; proto PROPERTIES_ChartInit = fun [PropertiesWin] I;; proto PROPERTIES_ModuleSelected = fun [[Module r1] I PropertiesWin] I;; proto PROPERTIES_ModuleModified = fun [[Module r1] I PropertiesWin] I;; proto PROPERTIES_ZoneSelected = fun [[Zone r1] I PropertiesWin] I;; proto PROPERTIES_ZoneModified = fun [[Zone r1] I PropertiesWin] I;; proto PROPERTIES_LinkModified = fun [[Link r1] I PropertiesWin] I;; proto PROPERTIES_LinkAdded = fun [[Link r1] I PropertiesWin] I;; proto PROPERTIES_LinkDeleted = fun [[Link r1] I PropertiesWin] I;; proto PROPERTIES_LinkSelected = fun [[Link r1] I PropertiesWin] I;; proto PROPERTIES_AssociationAdded = fun [u0 u1 PropertiesWin] I;; proto PROPERTIES_AssociationRemoved = fun [u0 u1 PropertiesWin] I;; proto PROPERTIES_HideModule = fun [PropertiesWin] I;; proto PROPERTIES_HideZone = fun [PropertiesWin] I;; proto PROPERTIES_HideLink = fun [PropertiesWin] I;; fun PROPERTIES_InterfaceJustChange (propWin) = propWin.PROPcurrentSelection != propWin.PROPpreviousSelection ;; fun PROPERTIES_HidePreviousInterface (propWin) = if propWin.PROPpreviousSelection == nil || ! PROPERTIES_InterfaceJustChange propWin then nil else if propWin.PROPpreviousSelection == PROPERTIES_LINK then PROPERTIES_HideLink propWin else if propWin.PROPpreviousSelection == PROPERTIES_ZONE then PROPERTIES_HideZone propWin else if propWin.PROPpreviousSelection == PROPERTIES_MODULE || propWin.PROPpreviousSelection == PROPERTIES_MODULES then PROPERTIES_HideModule propWin else nil ;; fun PROPERTIES_OnPreDestroy (cont) = { let _GETcontainerPositionSize cont -> [popx popy popw poph] in { PARAMS_SetI SCSparameters "POPUP_PROPERTIES_POSITION_X" popx ; PARAMS_SetI SCSparameters "POPUP_PROPERTIES_POSITION_Y" popy ; PARAMS_SetI SCSparameters "POPUP_PROPERTIES_WIDTH" popw ; PARAMS_SetI SCSparameters "POPUP_PROPERTIES_HEIGHT" poph ; } ; 1 ; } ;; /**************************************************************************************** Properties Window popup callbacks ****************************************************************************************/ fun POPUPWIN_SetPropertiesCallBacks (propWin, param) = POPUPWIN_CBpopupPreDestroy @PROPERTIES_OnPreDestroy propWin.PROPcontainer ; REFLEX_CBmoduleSelected (mkfun3 @PROPERTIES_ModuleSelected propWin); REFLEX_CBzoneSelected (mkfun3 @PROPERTIES_ZoneSelected propWin); REFLEX_CBlinkSelected (mkfun3 @PROPERTIES_LinkSelected propWin); REFLEX_CBmoduleModified (mkfun3 @PROPERTIES_ModuleModified propWin); REFLEX_CBzoneModified (mkfun3 @PROPERTIES_ZoneModified propWin); REFLEX_CBlinkModified (mkfun3 @PROPERTIES_LinkModified propWin); REFLEX_CBlinkAdded (mkfun3 @PROPERTIES_LinkAdded propWin); REFLEX_CBlinkRemoved (mkfun3 @PROPERTIES_LinkDeleted propWin); REFLEX_CBassociationRemoved (mkfun3 @PROPERTIES_AssociationRemoved propWin); REFLEX_CBassociationAdded (mkfun3 @PROPERTIES_AssociationAdded propWin); let SELECT_GetSelection -> [priority select] in if select == SELECT_MODULE then PROPERTIES_ModuleSelected SELECT_GetModule priority REFLEX_SELECTION|priority propWin else if select == SELECT_LINK then PROPERTIES_LinkSelected SELECT_GetLink priority REFLEX_SELECTION|priority propWin else if select == SELECT_ZONE then PROPERTIES_ZoneSelected SELECT_GetZone priority REFLEX_SELECTION|priority propWin else nil ;; /**************************************************************************************** Properties Window popup creation ****************************************************************************************/ fun POPUPWIN_CreateProperties (Channel, win, code) = let PARAMS_GetI SCSparameters "POPUP_PROPERTIES_POSITION_X" -> popx in let PARAMS_GetI SCSparameters "POPUP_PROPERTIES_POSITION_Y" -> popy in let PARAMS_GetI SCSparameters "POPUP_PROPERTIES_WIDTH" -> popw in let PARAMS_GetI SCSparameters "POPUP_PROPERTIES_HEIGHT" -> poph in let PARAMS_GetI SCSparameters "POPUP_PROPERTIES_MIN_WIDTH" -> popminw in let PARAMS_GetI SCSparameters "POPUP_PROPERTIES_MIN_HEIGHT" -> popminh in let POPUPWIN_CreatePopupWindow Channel win if (popx != nil) then popx else 50 if (popy != nil) then popy else 50 if (popminw != nil)&&(popminw > 400) then popminw else 400 if (popminh != nil) then popminh else 350 (_locSCS "popupproperties-TITLE" nil) code nil nil -> cont in let mkPropertiesWin [nil nil Channel cont nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil] -> propWin in ( PROPERTIES_ChartInit propWin; POPUPWIN_SetPropertiesCallBacks propWin code; /* reset previously saved width & height parameters */ if popw != nil then _SIZEEXcontainer cont popx popy (if popw <400 then 400 else popw) poph else nil; [cont (_locSCS "popupproperties-TITLE" nil)]; ) ;;