Ejemplo n.º 1
0
        /*
         * OnPaint
         */

        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics g = e.Graphics;

            if (this.Orientation == NuGenOrientationStyle.Vertical)
            {
                NuGenControlPaint.Make90CCWGraphics(g, this.ClientRectangle);
            }

            NuGenTrackBarPaintParams paintParams = new NuGenTrackBarPaintParams(
                this,
                g,
                this.AgnosticTrackBounds,
                this.StateTracker.GetControlState(),
                this.ValueTracker,
                this.TickStyle
                );

            this.Renderer.DrawTrack(paintParams);

            if (_focused && this.ShowFocusCues)
            {
                ControlPaint.DrawFocusRectangle(e.Graphics, this.ClientRectangle);
            }
        }
Ejemplo n.º 2
0
            /*
             * OnPaint
             */

            /// <summary>
            /// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
            /// </summary>
            /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
            protected override void OnPaint(PaintEventArgs e)
            {
                if (this.Orientation == NuGenOrientationStyle.Vertical)
                {
                    NuGenControlPaint.Make90CCWGraphics(e.Graphics, this.ClientRectangle);
                }
            }
Ejemplo n.º 3
0
        /*
         * OnPaint
         */

        /// <summary>
        /// Raises the <see cref="M:System.Windows.Forms.ButtonBase.OnPaint(System.Windows.Forms.PaintEventArgs)"></see> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            Graphics  g      = e.Graphics;
            Rectangle bounds = this.ClientRectangle;

            /* Translate e.Graphics to render different scroll-button styles. */

            switch (this.Style)
            {
            case NuGenScrollButtonStyle.Left:
            {
                bounds = new Rectangle(bounds.Top, bounds.Left, bounds.Height, bounds.Width);
                NuGenControlPaint.Make90CWGraphics(g, bounds);
                break;
            }

            case NuGenScrollButtonStyle.Right:
            {
                NuGenControlPaint.Make90CCWGraphics(g, bounds);
                bounds = new Rectangle(bounds.Top, bounds.Left, bounds.Height, bounds.Width);
                break;
            }

            case NuGenScrollButtonStyle.Up:
            {
                NuGenControlPaint.Make180CCWGraphics(g, bounds);
                break;
            }
            }

            if (
                bounds.Width > 0 &&
                bounds.Height > 0
                )
            {
                NuGenPaintParams paintParams = new NuGenPaintParams(g);
                paintParams.Bounds = bounds;
                paintParams.State  = this.ButtonStateTracker.GetControlState();

                if (this.DoubleArrow)
                {
                    this.Renderer.DrawDoubleScrollButton(paintParams);
                }
                else
                {
                    this.Renderer.DrawScrollButton(paintParams);
                }
            }
        }
            /*
             * OnPaint
             */

            /// <summary>
            /// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
            /// </summary>
            /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
            protected override void OnPaint(PaintEventArgs e)
            {
                Graphics g = e.Graphics;

                if (this.Orientation == NuGenOrientationStyle.Vertical)
                {
                    NuGenControlPaint.Make90CCWGraphics(g, this.ClientRectangle);
                }

                this.Renderer.DrawTrackButton(
                    new NuGenTrackButtonPaintParams(
                        this,
                        g,
                        NuGenControlPaint.OrientationAgnosticRectangle(this.ClientRectangle, this.Orientation),
                        this.ButtonStateTracker.GetControlState(),
                        this.TickStyle
                        )
                    );
            }