/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : LinksManipulation.pkg */ /* Version : 27 juin 2000 */ /* Modules Graph links user interface handling */ /* */ /***************************************************************************************/ /* link round label double click control variables */ var LINKS_bLinkLabelClicked = 0 ;; var LINKS_LinkLabelDblClickTimerDelay = 800 ;; typeof LINKS_LinkLabelTimer = Timer ;; /************************************************************************************** Callback for links double click to show properties POPUP ***************************************************************************************/ /* MAT ICI CURRENT: pas gere, il faut passer par le container (pas de dblclick sur un compcheck) */ fun LINKS_DblClick (cont, param, x, y, bt, mask) = { WINMANAG_OnlyShow POPUPWIN_PROPERTIES ; } ;; /* ************************************************************** */ /* link creation handling */ /* ************************************************************** */ /* MAT ICI super crade !!!!! (ELRIC lol !!!!!) */ typeof PorkasModulesViewed = ModulesView;; fun LINKS_BreakCreation()= if SCSGUI_GetCurrentView == MAINWIN_MODULE then ( set PorkasModulesViewed.MODVIEWlinksCreation = nil; _PAINTcontainer PorkasModulesViewed.MODVIEWcontainer ) else nil; 0 ;; /* event menu selection reflex */ fun LINKS_EventCreation( menuitem, param )= let param -> [ModulesViewed fromNodes event] in ( set ModulesViewed.MODVIEWlinksCreation = [fromNodes event]; set PorkasModulesViewed = ModulesViewed ) ;; /* action menu selection reflex */ fun LINKS_ActionCreation( menuitem, param )= let param -> [ModulesViewed destNodes action] in ( let ModulesViewed.MODVIEWlinksCreation -> [fromNodes event] in MODULE_CreateLinks SELECT_GetSite MODULESVIEW_GetModules ModulesViewed fromNodes event MODULESVIEW_GetModules ModulesViewed destNodes action; set ModulesViewed.MODVIEWlinksCreation = nil ) ;; fun LINKS_GetActionsOrEventsIntersectionsIsIn2Lists( list1, list2 )= if (list1 == nil) || (list2 == nil) then nil else let list1 -> [first1 next1] in let list2 -> [first2 next2] in if (stringCompare first1 first2) < 0 then LINKS_GetActionsOrEventsIntersectionsIsIn2Lists list1 next2 else if (stringCompare first1 first2) > 0 then LINKS_GetActionsOrEventsIntersectionsIsIn2Lists next1 list2 else /* same string found */ first1::LINKS_GetActionsOrEventsIntersectionsIsIn2Lists next1 next2 ;; /* names is [[S r1] r1] */ fun LINKS_GetActionsOrEventsIntersections( names )= if names == nil then nil else let names -> [name next] in if next == nil then name else LINKS_GetActionsOrEventsIntersectionsIsIn2Lists name LINKS_GetActionsOrEventsIntersections next ;; fun LINKS_GetModulesEventsOrActions( modules, getFunction )= if modules == nil then nil else let modules -> [module next] in (quicksort exec getFunction with [SELECT_GetSite module] @stringCompare)::LINKS_GetModulesEventsOrActions next getFunction ;; fun LINKS_FinishCreation(cont, ModulesViewed, modules, posx, posy )= let scsgui.SCSGUIwindowManager.WINMANAGmainCont -> win in /* MAT ICI crado... */ let LINKS_GetActionsOrEventsIntersections LINKS_GetModulesEventsOrActions modules @MODULE_GetActions -> actions in ( LINKSMENU_Show cont LINKSMENU_Fill ModulesViewed.MODVIEWpopupMenu actions @LINKS_ActionCreation [ModulesViewed MODULESVIEW_GetNodes ModulesViewed modules] /* MAT ICI CURRENT calculer les ObjNode's correspondant aux Module's */ posx posy ); 0;; fun LINKS_StartCreation(cont, ModulesViewed, modules, posx, posy )= /* set ModulesView.MODVIEWlinkCreation = [*/ /* open events list popup menu */ let LINKS_GetActionsOrEventsIntersections LINKS_GetModulesEventsOrActions modules @MODULE_GetEvents -> events in ( LINKSMENU_Show cont LINKSMENU_Fill ModulesViewed.MODVIEWpopupMenu events @LINKS_EventCreation [ModulesViewed MODULESVIEW_GetNodes ModulesViewed modules] /* MAT ICI CURRENT calculer les ObjNode's correspondant aux Module's */ posx posy ); 0 ;; /* ************************************************************** */ /* link selection handling */ /* ************************************************************** */ fun LINKS_ResetLinkRoundLabelDblClick (ltimer, param) = { set LINKS_bLinkLabelClicked = 0 ; _deltimer ltimer ; set LINKS_LinkLabelTimer = nil ; 0 } ;; fun LINKS_SelectLinks( check, param, posx, posy, btn, mask )= if mask & MK_CONTROL then nil else { /* Handles double click on link round label */ if (LINKS_bLinkLabelClicked == 0) then { if LINKS_LinkLabelTimer == nil then nil else _deltimer LINKS_LinkLabelTimer ; set LINKS_bLinkLabelClicked = 1 ; set LINKS_LinkLabelTimer = _starttimer scsgui.SCSGUIchannel LINKS_LinkLabelDblClickTimerDelay ; if LINKS_LinkLabelTimer == nil then nil else _rfltimer LINKS_LinkLabelTimer @LINKS_ResetLinkRoundLabelDblClick nil ; 0 } else { LINKS_ResetLinkRoundLabelDblClick LINKS_LinkLabelTimer nil ; /* Launch Dbl Click */ LINKS_DblClick nil nil 0 0 0 0 ; 0 } ; /* Selects link round label */ let param -> [links ModulesViewed] in ( set ModulesViewed.MODVIEWselectedLink = check; _SETcompCheckState check CHK_CHECKED; _PAINTobjNode _CONVERTcompCheckToObjNode check; SELECT_NewLink links REFLEX_PRIORITY_TWO ) };;