/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : LinksMenu.pkg */ /* Version : 27 juin 2000 */ /* Actions & Events popup menu */ /* */ /***************************************************************************************/ struct LinksMenu = [ LINKSMENUmenu : ObjMenu , /* handled menu */ LINKSMENUchannel : Chn , /* related channel */ LINKSMENUentries : [[ObjMenuItem S] r1] /* associates a menu item with its value */ ] mkLinksMenu ;; fun LINKSMENU_Create( Channel )= mkLinksMenu [ _CRpopupMenu Channel Channel nil ] ;; fun LINKSMENU_Show( cont, LinksMenu, x, y )= let _GETcontainerPositionSize cont -> [cx cy _ _] in let _GETcontainerPositionSize scsgui.SCSGUIwindowManager.WINMANAGmainCont -> [mx my _ _] in _DRAWmenu nil LinksMenu.LINKSMENUmenu x+mx+cx y+my+cy PM_LEFT_ALIGN|PM_TOP_ALIGN|PM_SCREEN; LinksMenu ;; fun LINKSMENU_DestroyMenuItems( entries )= if entries == nil then nil else let entries -> [[menuItem _] next] in ( LINKSMENU_DestroyMenuItems next; _DSmenuItem menuItem ) ;; fun LINKSMENU_FillMenuItems( LinksMenu, values, selectionReflex, reflexParam )= if values == nil then nil else let values -> [name next] in let reflexParam -> [param1 param2] in let _CBmenu _APPitem LinksMenu.LINKSMENUchannel LinksMenu.LINKSMENUmenu ME_ENABLED name selectionReflex [param1 param2 name] -> menuItem in set LinksMenu.LINKSMENUentries = [menuItem name]::LINKSMENU_FillMenuItems LinksMenu next selectionReflex reflexParam ;; fun LINKSMENU_Fill( LinksMenu, values, selectionReflex, reflexParam )= /* empty menu entries */ LINKSMENU_DestroyMenuItems LinksMenu.LINKSMENUentries; set LinksMenu.LINKSMENUentries = nil; /* MAT ICI gerer les sous-menus et le tri alphabetique (ds le MODULE_GetEvents/Actions ?) */ LINKSMENU_FillMenuItems LinksMenu values selectionReflex reflexParam; LinksMenu ;; fun LINKSMENU_Destroy( LinksMenu )= LINKSMENU_DestroyMenuItems LinksMenu.LINKSMENUentries; set LinksMenu.LINKSMENUentries = nil; _DSmenu LinksMenu.LINKSMENUmenu; set LinksMenu.LINKSMENUmenu = nil; LinksMenu ;;