Exemplo n.º 1
0
        /// <summary>
        /// Converts the specified RadioButtonStates value to a ButtonState value
        /// </summary>
        /// <param name="state">The RadioButtonStates value to be converted</param>
        /// <returns>A ButtonState value that represents the specified RadioButtonStates
        /// value</returns>
        private static ButtonState ConvertRadioButtonStateToButtonState(I3RadioButtonStates state)
        {
            switch (state)
            {
            case I3RadioButtonStates.UncheckedPressed:
            {
                return(ButtonState.Pushed);
            }

            case I3RadioButtonStates.UncheckedDisabled:
            {
                return(ButtonState.Inactive);
            }

            case I3RadioButtonStates.CheckedNormal:
            case I3RadioButtonStates.CheckedHot:
            {
                return(ButtonState.Checked);
            }

            case I3RadioButtonStates.CheckedPressed:
            {
                return(ButtonState.Checked | ButtonState.Pushed);
            }

            case I3RadioButtonStates.CheckedDisabled:
            {
                return(ButtonState.Checked | ButtonState.Inactive);
            }
            }

            return(ButtonState.Normal);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Draws a RadioButton 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="checkRect">The Rectangle that represents the dimensions
        /// of the RadioButton</param>
        /// <param name="clipRect">The Rectangle that represents the clipping area</param>
        /// <param name="state">A RadioButtonStates value that specifies the
        /// state to draw the RadioButton in</param>
        public static void DrawRadioButton(Graphics g, Rectangle checkRect, Rectangle clipRect, I3RadioButtonStates state)
        {
            if (g == null || checkRect.Width <= 0 || checkRect.Height <= 0)
            {
                return;
            }

            if (I3ThemeManager.VisualStylesEnabled)
            {
                I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.Button, (int)I3ButtonParts.RadioButton, (int)state, checkRect, clipRect);
            }
            else
            {
                ControlPaint.DrawRadioButton(g, checkRect, I3ThemeManager.ConvertRadioButtonStateToButtonState(state));
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// Draws a RadioButton 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="checkRect">The Rectangle that represents the dimensions
 /// of the RadioButton</param>
 /// <param name="state">A RadioButtonStates value that specifies the
 /// state to draw the RadioButton in</param>
 public static void DrawRadioButton(Graphics g, Rectangle checkRect, I3RadioButtonStates state)
 {
     I3ThemeManager.DrawRadioButton(g, checkRect, checkRect, state);
 }