Exemplo n.º 1
0
        /// <summary>
        /// Draws an UpDown's up and down buttons in the specified state, on the specified
        /// graphics surface, and within the specified bounds
        /// </summary>
        /// <param name="g">The Graphics to draw on</param>
        /// <param name="upButtonRect">The Rectangle that represents the dimensions
        /// of the up button</param>
        /// <param name="upButtonClipRect">The Rectangle that represents the clipping area
        /// for the up button</param>
        /// <param name="upButtonState">An UpDownStates value that specifies the
        /// state to draw the up button in</param>
        /// <param name="downButtonRect">The Rectangle that represents the dimensions
        /// of the down button</param>
        /// <param name="downButtonClipRect">The Rectangle that represents the clipping area
        /// for the down button</param>
        /// <param name="downButtonState">An UpDownStates value that specifies the
        /// state to draw the down button in</param>
        public static void DrawUpDownButtons(Graphics g, Rectangle upButtonRect, Rectangle upButtonClipRect, I3UpDownStates upButtonState, Rectangle downButtonRect, Rectangle downButtonClipRect, I3UpDownStates downButtonState)
        {
            if (g == null)
            {
                return;
            }

            if (upButtonRect.Width > 0 && upButtonRect.Height > 0 && upButtonClipRect.Width > 0 && upButtonClipRect.Height > 0)
            {
                if (I3ThemeManager.VisualStylesEnabled)
                {
                    I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.UpDown, (int)I3UpDownParts.Up, (int)upButtonState, upButtonRect, upButtonClipRect);
                }
                else
                {
                    ControlPaint.DrawScrollButton(g, upButtonRect, ScrollButton.Up, I3ThemeManager.ConvertUpDownStateToButtonState(upButtonState));
                }
            }

            if (downButtonRect.Width > 0 && downButtonRect.Height > 0 && downButtonClipRect.Width > 0 && downButtonClipRect.Height > 0)
            {
                if (I3ThemeManager.VisualStylesEnabled)
                {
                    I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.UpDown, (int)I3UpDownParts.Down, (int)downButtonState, downButtonRect, downButtonClipRect);
                }
                else
                {
                    ControlPaint.DrawScrollButton(g, downButtonRect, ScrollButton.Down, I3ThemeManager.ConvertUpDownStateToButtonState(downButtonState));
                }
            }
        }