Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitCircularGauge"/> class.
        /// </summary>
        public ZeroitCircularGauge()
            : base(false)
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);

            DoubleBuffered = true;


            m_axis   = new CircularAxis();
            m_needle = new Needle();

            m_axis.AppearanceChanged += new EventHandler(OnItemAppearanceChanged);
            m_axis.LayoutChanged     += new EventHandler(OnItemLayoutChanged);

            m_needle.AppearanceChanged += new EventHandler(OnItemAppearanceChanged);
            m_needle.LayoutChanged     += new EventHandler(OnItemLayoutChanged);

            m_needle.CalculatePaths(ClientRectangle);
            m_axis.CalculatePaths(ClientRectangle);

            InitializeComponent();

            Value             = 0;
            Animate           = true;
            EaseFunction      = EaseFunctionType.Linear;
            AnimationLength   = 1000;
            AnimationInterval = 100;
            EaseMode          = EaseMode.InOut;
        }
Exemplo n.º 2
0
        protected override void OnResize(EventArgs e)
        {
            if (m_axis != null)
            {
                m_axis.CalculatePaths(ClientRectangle);
            }
            if (m_needle != null)
            {
                m_needle.CalculatePaths(ClientRectangle);
            }

            base.OnResize(e);
        }
Exemplo n.º 3
0
        public CircularGauge()
            : base(false)
        {
            m_axis   = new CircularAxis();
            m_needle = new Needle();

            m_axis.AppearanceChanged += new EventHandler(OnItemAppearanceChanged);
            m_axis.LayoutChanged     += new EventHandler(OnItemLayoutChanged);

            m_needle.AppearanceChanged += new EventHandler(OnItemAppearanceChanged);
            m_needle.LayoutChanged     += new EventHandler(OnItemLayoutChanged);

            m_needle.CalculatePaths(ClientRectangle);
            m_axis.CalculatePaths(ClientRectangle);

            InitializeComponent();

            Value             = 0;
            Animate           = true;
            EaseFunction      = EaseFunctionType.Linear;
            AnimationLength   = 1000;
            AnimationInterval = 100;
            EaseMode          = EaseMode.InOut;
        }