public bool Track(IMouseInformation mouseInformation)
            {
                bool result = false;

                if (_capturedHandler != null)
                {
                    return(_capturedHandler.Track(mouseInformation));
                }

                foreach (IGraphic graphic in EnumerateChildGraphics(true))
                {
                    if (!graphic.Visible)
                    {
                        continue;
                    }

                    IMouseButtonHandler handler = graphic as IMouseButtonHandler;
                    if (handler != null)
                    {
                        result = handler.Track(mouseInformation);
                        if (result)
                        {
                            break;
                        }
                    }
                }

                return(result);
            }
        private bool TrackHandler(IMouseButtonHandler handler)
        {
            if (!_tile.Selected && SuppressOnTileActivate(handler))
            {
                return(false);
            }

            if (ConstrainToTile(handler) && !this.TileClientRectangle.Contains(this.Location))
            {
                return(false);
            }

            return(handler.Track(this));
        }
Beispiel #3
0
        /// <summary>
        /// Called by the framework when the mouse has moved.
        /// </summary>
        /// <remarks>
        /// <para>
        /// A button does not necessarily have to be down for this message to be called.  The framework can
        /// call it any time the mouse moves.
        /// </para>
        /// <para>
        /// The <see cref="ControlGraphic"/> implementation calls <see cref="IMouseButtonHandler.Track"/> on
        /// the current handler, <see cref="Track"/>, or any child graphics implementing <see cref="IMouseButtonHandler"/>,
        /// in decreasing order of priority.
        /// </para>
        /// </remarks>
        /// <param name="mouseInformation">The mouse input information.</param>
        /// <returns>True if the message was handled; False otherwise.</returns>
        bool IMouseButtonHandler.Track(IMouseInformation mouseInformation)
        {
            bool result = false;

            if (_capturedHandler != null)
            {
                return(_capturedHandler.Track(mouseInformation));
            }

            if (Enabled)
            {
                try
                {
                    result = Track(mouseInformation);
                }
                finally
                {
                    if (_isTracking)
                    {
                        _lastTrackedPosition = mouseInformation.Location;
                    }
                }
            }

            if (!result)
            {
                foreach (IGraphic graphic in EnumerateChildGraphics(true))
                {
                    if (!graphic.Visible)
                    {
                        continue;
                    }

                    IMouseButtonHandler handler = graphic as IMouseButtonHandler;
                    if (handler != null)
                    {
                        result = handler.Track(mouseInformation);
                        if (result)
                        {
                            break;
                        }
                    }
                }
            }

            return(result);
        }
Beispiel #4
0
		private bool TrackHandler(IMouseButtonHandler handler)
		{
			if (!_tile.Selected && SuppressOnTileActivate(handler))
				return false;

			if (ConstrainToTile(handler) && !this.TileClientRectangle.Contains(this.Location))
				return false;

			return handler.Track(this);
		}