Пример #1
0
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// Tells the widget that the left mouse has been released on top of the widget
        /// </summary>
        ///
        /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        protected internal override void OnLeftMouseReleased(MouseButtonEventArgs e)
        {
            // Adjust the mouse position of the event
            e.X = (int)(e.X - Position.X);
            e.Y = (int)(e.Y - Position.Y);

            // Check if the mouse is on top of an widget
            Widget theWidget = null;

            if (MouseOnWhichWidget(ref theWidget, e.X, e.Y))
            {
                theWidget.OnLeftMouseReleased(e);
            }

            // Tell all the other widgets that the mouse has gone up
            foreach (Widget widget in m_Widgets)
            {
                if (widget != theWidget)
                {
                    widget.MouseNoLongerDown();
                }
            }
        }