Exemplo n.º 1
0
        /// <summary>
        /// Draws a push button 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="buttonRect">The Rectangle that represents the dimensions
        /// of the button</param>
        /// <param name="clipRect">The Rectangle that represents the clipping area</param>
        /// <param name="state">A PushButtonStates value that specifies the
        /// state to draw the button in</param>
        public static void DrawButton(Graphics g, Rectangle buttonRect, Rectangle clipRect, I3PushButtonStates state)
        {
            if (g == null || buttonRect.Width <= 0 || buttonRect.Height <= 0 || clipRect.Width <= 0 || clipRect.Height <= 0)
            {
                return;
            }

            if (I3ThemeManager.VisualStylesEnabled)
            {
                I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.Button, (int)I3ButtonParts.PushButton, (int)state, buttonRect, clipRect);
            }
            else
            {
                ControlPaint.DrawButton(g, buttonRect, I3ThemeManager.ConvertPushButtonStateToButtonState(state));
            }
        }