Click here to Skip to main content
Click here to Skip to main content

ButtonBar Control using .NET

By , 3 Dec 2009
 
using ButtonBarsControl.Control;
using ButtonBarsControl.Design.Enums;

namespace ButtonBarsControl.Design.Entity
{
    /// <summary>
    /// Represents class holding information relatedd to hittest.
    /// </summary>
    public class HitTestInfo
    {
        private readonly HitArea area;
        private readonly int buttonIndex;

        /// <summary>
        /// Initializes a new instance of the <see cref="HitTestInfo"/> class. 
        /// </summary>
        /// <param name="buttonIndex">Index of button</param>
        /// <param name="area"><see cref="HitArea"/> representing what was hit area of a given point.</param>
        public HitTestInfo(int buttonIndex, HitArea area)
        {
            this.buttonIndex = buttonIndex;
            this.area = area;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="HitTestInfo"/> class. 
        /// </summary>
        /// <param name="area"><see cref="HitArea"/> representing what was hit area of a given point.</param>
        public HitTestInfo(HitArea area)
        {
            buttonIndex = -1;
            this.area = area;
        }

        /// <summary>
        /// Gets Index of <see cref="BarItem"/> in <see cref="ButtonBar"/> as per hitest result. Returs -1 if there is no button at given point.
        /// </summary>
        public int ButtonIndex
        {
            get { return buttonIndex; }
        }

        /// <summary>
        /// <see cref="HitArea"/> representing what was hit area of a given point.
        /// </summary>
        public HitArea Area
        {
            get { return area; }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of use and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Manish Ranjan Kumar
Software Developer (Senior) Proteans
India India
Graduate from IIT Kharagpur.
Working with Windows forms application for last 5.5 Years.
Currently working with Meridium Services And Labs, Bangalore.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130617.1 | Last Updated 3 Dec 2009
Article Copyright 2009 by Manish Ranjan Kumar
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid