internal static void DrawCheckOnly( int checkSize, bool controlChecked, bool controlEnabled, CheckState controlCheckState, Graphics g, LayoutData layout, ColorData colors, Color checkColor) { if (!controlChecked) { return; } if (!controlEnabled) { checkColor = colors.buttonShadow; } else if (controlCheckState == CheckState.Indeterminate) { checkColor = SystemInformation.HighContrast ? colors.highlight : colors.buttonShadow; } Rectangle fullSize = layout.checkBounds; if (fullSize.Width == checkSize) { fullSize.Width++; fullSize.Height++; } fullSize.Width++; fullSize.Height++; Bitmap checkImage; if (controlCheckState == CheckState.Checked) { checkImage = GetCheckBoxImage(checkColor, fullSize, ref checkImageCheckedBackColor, ref checkImageChecked); } else { Debug.Assert( controlCheckState == CheckState.Indeterminate, "we want to paint the check box only if the item is checked or indeterminate"); checkImage = GetCheckBoxImage(checkColor, fullSize, ref checkImageIndeterminateBackColor, ref checkImageIndeterminate); } fullSize.Y -= layout.options.everettButtonCompat ? 1 : 2; ControlPaint.DrawImageColorized(g, checkImage, fullSize, checkColor); }
internal static void DrawCheckOnly(int checkSize, bool controlChecked, bool controlEnabled, CheckState controlCheckState, Graphics g, ButtonBaseAdapter.LayoutData layout, ButtonBaseAdapter.ColorData colors, Color checkColor, Color checkBackground, bool disabledColors) { if (controlChecked) { if (!controlEnabled && disabledColors) { checkColor = colors.buttonShadow; } else if ((controlCheckState == CheckState.Indeterminate) && disabledColors) { checkColor = SystemInformation.HighContrast ? colors.highlight : colors.buttonShadow; } Rectangle checkBounds = layout.checkBounds; if (checkBounds.Width == checkSize) { checkBounds.Width++; checkBounds.Height++; } checkBounds.Width++; checkBounds.Height++; Bitmap image = null; if (controlCheckState == CheckState.Checked) { image = GetCheckBoxImage(checkColor, checkBounds, ref checkImageCheckedBackColor, ref checkImageChecked); } else { image = GetCheckBoxImage(checkColor, checkBounds, ref checkImageIndeterminateBackColor, ref checkImageIndeterminate); } if (layout.options.everettButtonCompat) { checkBounds.Y--; } else { checkBounds.Y -= 2; } ControlPaint.DrawImageColorized(g, image, checkBounds, checkColor); } }