FSO.Client.UI.Framework.UIElement.ListenForMouse C# (CSharp) Method

ListenForMouse() public method

public ListenForMouse ( Rectangle region, UIMouseEvent callback ) : UIMouseEventRef
region Microsoft.Xna.Framework.Rectangle
callback UIMouseEvent
return FSO.Common.Rendering.Framework.IO.UIMouseEventRef
        public UIMouseEventRef ListenForMouse(Rectangle region, UIMouseEvent callback)
        {
            var newRegion = new UIMouseEventRef()
            {
                Callback = callback,
                Region = region,
                Element = this
            };
            if (m_MouseRefs == null)
            {
                m_MouseRefs = new List<UIMouseEventRef>();
            }
            m_MouseRefs.Add(newRegion);

            return newRegion;
        }

Usage Example

Esempio n. 1
0
        public UIDragHandler(UIElement mouseTarget, UIElement dragControl)
        {
            UpdateHook = new UpdateHookDelegate(Update);

            MouseTarget = mouseTarget;
            DragControl = dragControl;
            MouseEvent = mouseTarget.ListenForMouse(mouseTarget.GetBounds(), new UIMouseEvent(DragMouseEvents));
        }