Exemplo n.º 1
0
        /// <summary>
        /// 在指定的区域内,用指定的状态来绘制一个行头的背景
        /// </summary>
        /// <param name="g">The Graphics to draw on</param>
        /// <param name="headerRect">The Rectangle that represents the dimensions
        /// of the column header</param>
        /// <param name="clipRect">The Rectangle that represents the clipping area</param>
        /// <param name="state">A ColumnHeaderStates value that specifies the
        /// state to draw the column header in</param>
        public static void DrawRowHeader(Graphics g, Rectangle headerRect, Rectangle clipRect, I3RowHeaderStates state)
        {
            if (g == null || headerRect.Width <= 0 || headerRect.Height <= 0 || clipRect.Width <= 0 || clipRect.Height <= 0)
            {
                return;
            }

            if (I3ThemeManager.VisualStylesEnabled)
            {
                I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.ColumnHeader, (int)I3RowHeaderParts.HeaderItem, (int)state, headerRect, clipRect);
            }
            else
            {
                g.FillRectangle(SystemBrushes.Control, headerRect);

                if (state == I3RowHeaderStates.Pressed)
                {
                    g.DrawRectangle(SystemPens.ControlDark, headerRect.X, headerRect.Y, headerRect.Width - 1, headerRect.Height - 1);
                }
                else
                {
                    ControlPaint.DrawBorder3D(g, headerRect.X, headerRect.Y, headerRect.Width, headerRect.Height, Border3DStyle.RaisedInner);
                }
            }
        }
Exemplo n.º 2
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));
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Draws a TextBox 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="textRect">The Rectangle that represents the dimensions
        /// of the TextBox</param>
        /// <param name="clipRect">The Rectangle that represents the clipping area</param>
        /// <param name="state">A TextBoxStates value that specifies the
        /// state to draw the TextBox in</param>
        public static void DrawTextBox(Graphics g, Rectangle textRect, Rectangle clipRect, I3TextBoxStates state)
        {
            if (g == null || textRect.Width <= 0 || textRect.Height <= 0 || clipRect.Width <= 0 || clipRect.Height <= 0)
            {
                return;
            }

            if (I3ThemeManager.VisualStylesEnabled)
            {
                I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.TextBox, (int)I3TextBoxParts.EditText, (int)state, textRect, clipRect);
            }
            else
            {
                ControlPaint.DrawBorder3D(g, textRect, Border3DStyle.Sunken);
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Draws a TabPage body on the specified graphics surface, and within the
        /// specified bounds
        /// </summary>
        /// <param name="g">The Graphics to draw on</param>
        /// <param name="tabRect">The Rectangle that represents the dimensions
        /// of the TabPage body</param>
        /// <param name="clipRect">The Rectangle that represents the clipping area</param>
        internal static void DrawTabPageBody(Graphics g, Rectangle tabRect, Rectangle clipRect)
        {
            if (g == null || tabRect.Width <= 0 || tabRect.Height <= 0 || clipRect.Width <= 0 || clipRect.Height <= 0)
            {
                return;
            }

            if (I3ThemeManager.VisualStylesEnabled)
            {
                I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.TabControl, (int)I3TabParts.Body, 0, tabRect, clipRect);
            }
            else
            {
                g.FillRectangle(SystemBrushes.Control, Rectangle.Intersect(clipRect, tabRect));
            }
        }
Exemplo n.º 5
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));
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Draws the ProgressBar's chunks on the specified graphics surface, and within
        /// the specified bounds
        /// </summary>
        /// <param name="g">The Graphics to draw on</param>
        /// <param name="drawRect">The Rectangle that represents the dimensions
        /// of the ProgressBar</param>
        /// <param name="clipRect">The Rectangle that represents the clipping area</param>
        public static void DrawProgressBarChunks(Graphics g, Rectangle drawRect, Rectangle clipRect)
        {
            if (g == null || drawRect.Width <= 0 || drawRect.Height <= 0 || clipRect.Width <= 0 || clipRect.Height <= 0)
            {
                return;
            }

            if (I3ThemeManager.VisualStylesEnabled)
            {
                I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.ProgressBar, (int)I3ProgressBarParts.Chunk, 0, drawRect, clipRect);
            }
            else
            {
                g.FillRectangle(SystemBrushes.Highlight, drawRect);
            }
        }
Exemplo n.º 7
0
        /// <summary>
        /// Draws a check box 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 check box</param>
        /// <param name="clipRect">The Rectangle that represents the clipping area</param>
        /// <param name="state">A CheckBoxStates value that specifies the
        /// state to draw the check box in</param>
        public static void DrawCheck(Graphics g, Rectangle checkRect, Rectangle clipRect, I3CheckBoxStates state)
        {
            if (g == null || checkRect.Width <= 0 || checkRect.Height <= 0)
            {
                return;
            }

            if (I3ThemeManager.VisualStylesEnabled)
            {
                I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.Button, (int)I3ButtonParts.CheckBox, (int)state, checkRect, clipRect);
            }
            else
            {
                if (IsMixed(state))
                {
                    ControlPaint.DrawMixedCheckBox(g, checkRect, I3ThemeManager.ConvertCheckBoxStateToButtonState(state));
                }
                else
                {
                    ControlPaint.DrawCheckBox(g, checkRect, I3ThemeManager.ConvertCheckBoxStateToButtonState(state));
                }
            }
        }
Exemplo n.º 8
0
        /// <summary>
        /// Draws a ProgressBar on the specified graphics surface, and within
        /// the specified bounds
        /// </summary>
        /// <param name="g">The Graphics to draw on</param>
        /// <param name="drawRect">The Rectangle that represents the dimensions
        /// of the ProgressBar</param>
        /// <param name="clipRect">The Rectangle that represents the clipping area</param>
        public static void DrawProgressBar(Graphics g, Rectangle drawRect, Rectangle clipRect)
        {
            if (g == null || drawRect.Width <= 0 || drawRect.Height <= 0 || clipRect.Width <= 0 || clipRect.Height <= 0)
            {
                return;
            }

            if (I3ThemeManager.VisualStylesEnabled)
            {
                I3ThemeManager.DrawThemeBackground(g, I3ThemeClasses.ProgressBar, (int)I3ProgressBarParts.Bar, 0, drawRect, clipRect);
            }
            else
            {
                // background
                g.FillRectangle(Brushes.White, drawRect);

                // 3d border
                //ControlPaint.DrawBorder3D(g, drawRect, Border3DStyle.SunkenInner);

                // flat border
                g.DrawRectangle(SystemPens.ControlDark, drawRect.Left, drawRect.Top, drawRect.Width - 1, drawRect.Height - 1);
            }
        }
Exemplo n.º 9
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="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="downButtonState">An UpDownStates value that specifies the
 /// state to draw the down button in</param>
 public static void DrawUpDownButtons(Graphics g, Rectangle upButtonRect, I3UpDownStates upButtonState, Rectangle downButtonRect, I3UpDownStates downButtonState)
 {
     I3ThemeManager.DrawUpDownButtons(g, upButtonRect, upButtonRect, upButtonState, downButtonRect, downButtonRect, downButtonState);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Draws a TextBox 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="textRect">The Rectangle that represents the dimensions
 /// of the TextBox</param>
 /// <param name="state">A TextBoxStates value that specifies the
 /// state to draw the TextBox in</param>
 public static void DrawTextBox(Graphics g, Rectangle textRect, I3TextBoxStates state)
 {
     I3ThemeManager.DrawTextBox(g, textRect, textRect, state);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Draws a TabPage body on the specified graphics surface, and within the
 /// specified bounds
 /// </summary>
 /// <param name="g">The Graphics to draw on</param>
 /// <param name="tabRect">The Rectangle that represents the dimensions
 /// of the TabPage body</param>
 internal static void DrawTabPageBody(Graphics g, Rectangle tabRect)
 {
     I3ThemeManager.DrawTabPageBody(g, tabRect, tabRect);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Draws the ProgressBar's chunks on the specified graphics surface, and within
 /// the specified bounds
 /// </summary>
 /// <param name="g">The Graphics to draw on</param>
 /// <param name="drawRect">The Rectangle that represents the dimensions
 /// of the ProgressBar</param>
 public static void DrawProgressBarChunks(Graphics g, Rectangle drawRect)
 {
     I3ThemeManager.DrawProgressBarChunks(g, drawRect, drawRect);
 }
Exemplo n.º 13
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="state">A PushButtonStates value that specifies the
 /// state to draw the button in</param>
 public static void DrawButton(Graphics g, Rectangle buttonRect, I3PushButtonStates state)
 {
     I3ThemeManager.DrawButton(g, buttonRect, buttonRect, state);
 }
Exemplo n.º 14
0
 /// <summary>
 /// Draws a combobox 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 combobox button</param>
 /// <param name="state">A ComboBoxStates value that specifies the
 /// state to draw the combobox button in</param>
 public static void DrawComboBoxButton(Graphics g, Rectangle buttonRect, I3ComboBoxStates state)
 {
     I3ThemeManager.DrawComboBoxButton(g, buttonRect, buttonRect, state);
 }
Exemplo n.º 15
0
 /// <summary>
 /// 在指定的区域内,用指定的状态来绘制一个行头的背景
 /// </summary>
 /// <param name="g">The Graphics to draw on</param>
 /// <param name="headerRect">The Rectangle that represents the dimensions
 /// of the column header</param>
 /// <param name="state">A ColumnHeaderStates value that specifies the
 /// state to draw the column header in</param>
 public static void DrawRowHeader(Graphics g, Rectangle headerRect, I3RowHeaderStates state)
 {
     I3ThemeManager.DrawRowHeader(g, headerRect, headerRect, state);
 }
Exemplo n.º 16
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);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Draws the background image defined by the visual style for the specified control part
 /// </summary>
 /// <param name="g">The Graphics to draw on</param>
 /// <param name="windowClass">The class of the part to draw</param>
 /// <param name="part">The part to draw</param>
 /// <param name="partState">The state of the part to draw</param>
 /// <param name="drawRect">The Rectangle in which the part is drawn</param>
 public static void DrawThemeBackground(Graphics g, string windowClass, int part, int partState, Rectangle drawRect)
 {
     //
     I3ThemeManager.DrawThemeBackground(g, windowClass, part, partState, drawRect, drawRect);
 }
Exemplo n.º 18
0
 /// <summary>
 /// Draws a check box 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 check box</param>
 /// <param name="state">A CheckBoxStates value that specifies the
 /// state to draw the check box in</param>
 public static void DrawCheck(Graphics g, Rectangle checkRect, I3CheckBoxStates state)
 {
     I3ThemeManager.DrawCheck(g, checkRect, checkRect, state);
 }