Beispiel #1
0
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupColorButton class.
        /// </summary>
        public KryptonRibbonGroupColorButton()
        {
            // Default fields
            _enabled                     = true;
            _visible                     = true;
            _checked                     = false;
            _visibleThemes               = true;
            _visibleStandard             = true;
            _visibleRecent               = true;
            _visibleNoColor              = true;
            _visibleMoreColors           = true;
            _autoRecentColors            = true;
            ShortcutKeys                 = Keys.None;
            _imageSmall                  = _defaultButtonImageSmall;
            _imageLarge                  = _defaultButtonImageLarge;
            _textLine1                   = "Color";
            _textLine2                   = string.Empty;
            _keyTip                      = "B";
            _selectedColor               = Color.Red;
            _emptyBorderColor            = Color.DarkGray;
            _selectedRectSmall           = new Rectangle(0, 12, 16, 4);
            _selectedRectLarge           = new Rectangle(2, 26, 28, 4);
            _schemeThemes                = ColorScheme.OfficeThemes;
            _schemeStandard              = ColorScheme.OfficeStandard;
            _buttonType                  = GroupButtonType.Split;
            _itemSizeMax                 = GroupItemSize.Large;
            _itemSizeMin                 = GroupItemSize.Small;
            _itemSizeCurrent             = GroupItemSize.Large;
            ToolTipImageTransparentColor = Color.Empty;
            ToolTipTitle                 = string.Empty;
            ToolTipBody                  = string.Empty;
            ToolTipStyle                 = LabelStyle.SuperTip;
            _maxRecentColors             = 10;
            _recentColors                = new List <Color>();

            // Create the context menu items
            _kryptonContextMenu = new KryptonContextMenu();
            _separatorTheme     = new KryptonContextMenuSeparator();
            _headingTheme       = new KryptonContextMenuHeading("Theme Colors");
            _colorsTheme        = new KryptonContextMenuColorColumns(ColorScheme.OfficeThemes);
            _separatorStandard  = new KryptonContextMenuSeparator();
            _headingStandard    = new KryptonContextMenuHeading("Standard Colors");
            _colorsStandard     = new KryptonContextMenuColorColumns(ColorScheme.OfficeStandard);
            _separatorRecent    = new KryptonContextMenuSeparator();
            _headingRecent      = new KryptonContextMenuHeading("Recent Colors");
            _colorsRecent       = new KryptonContextMenuColorColumns(ColorScheme.None);
            _separatorNoColor   = new KryptonContextMenuSeparator();
            _itemNoColor        = new KryptonContextMenuItem("&No Color", Properties.Resources.ButtonNoColor, OnClickNoColor);
            _itemsNoColor       = new KryptonContextMenuItems();
            _itemsNoColor.Items.Add(_itemNoColor);
            _separatorMoreColors = new KryptonContextMenuSeparator();
            _itemMoreColors      = new KryptonContextMenuItem("&More Colors...", OnClickMoreColors);
            _itemsMoreColors     = new KryptonContextMenuItems();
            _itemsMoreColors.Items.Add(_itemMoreColors);
            _kryptonContextMenu.Items.AddRange(new KryptonContextMenuItemBase[] { _separatorTheme, _headingTheme, _colorsTheme,
                                                                                  _separatorStandard, _headingStandard, _colorsStandard,
                                                                                  _separatorRecent, _headingRecent, _colorsRecent,
                                                                                  _separatorNoColor, _itemsNoColor,
                                                                                  _separatorMoreColors, _itemsMoreColors });
        }
        /// <summary>
        /// Initialize a new instance of the GroupButtonController class.
        /// </summary>
        /// <param name="ribbon">Source control instance.</param>
        /// <param name="target">Target for state changes.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public GroupButtonController(KryptonRibbon ribbon,
                                     ViewDrawRibbonGroupButtonBackBorder target,
                                     NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(target != null);
            Debug.Assert(needPaint != null);

            _ribbon   = ribbon;
            _target   = target;
            NeedPaint = needPaint;

            // Default other fields
            _buttonType = GroupButtonType.Push;
        }
        /// <summary>
        /// Initialize a new instance of the GroupButtonController class.
        /// </summary>
        /// <param name="ribbon">Source control instance.</param>
        /// <param name="target">Target for state changes.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public GroupButtonController(KryptonRibbon ribbon,
                                     ViewDrawRibbonGroupButtonBackBorder target,
                                     NeedPaintHandler needPaint)
        {
            Debug.Assert(ribbon != null);
            Debug.Assert(target != null);
            Debug.Assert(needPaint != null);

            _ribbon = ribbon;
            _target = target;
            NeedPaint = needPaint;

            // Default other fields
            _buttonType = GroupButtonType.Push;
        }
 /// <summary>
 /// Initialise a new instance of the KryptonRibbonGroupClusterButton class.
 /// </summary>
 public KryptonRibbonGroupClusterButton()
 {
     // Default fields
     _enabled            = true;
     _visible            = true;
     _checked            = false;
     _textLine           = string.Empty;
     _keyTip             = "B";
     ShortcutKeys        = Keys.None;
     _itemSizeMax        = GroupItemSize.Medium;
     _itemSizeMin        = GroupItemSize.Small;
     _itemSizeCurrent    = GroupItemSize.Medium;
     _imageSmall         = _defaultButtonImageSmall;
     _buttonType         = GroupButtonType.Push;
     _contextMenuStrip   = null;
     _kryptonContextMenu = null;
 }
Beispiel #5
0
 /// <summary>
 /// Initialise a new instance of the KryptonRibbonGroupClusterButton class.
 /// </summary>
 public KryptonRibbonGroupClusterButton()
 {
     // Default fields
     _enabled                      = true;
     _visible                      = true;
     _checked                      = false;
     _textLine                     = string.Empty;
     _keyTip                       = "B";
     _shortcutKeys                 = Keys.None;
     _itemSizeMax                  = GroupItemSize.Medium;
     _itemSizeMin                  = GroupItemSize.Small;
     _itemSizeCurrent              = GroupItemSize.Medium;
     _imageSmall                   = _defaultButtonImageSmall;
     _buttonType                   = GroupButtonType.Push;
     _contextMenuStrip             = null;
     _kryptonContextMenu           = null;
     _toolTipImageTransparentColor = Color.Empty;
     _toolTipTitle                 = string.Empty;
     _toolTipBody                  = string.Empty;
     _toolTipStyle                 = LabelStyle.SuperTip;
 }
        /// <summary>
        /// Initialise a new instance of the KryptonRibbonGroupColorButton class.
        /// </summary>
        public KryptonRibbonGroupColorButton()
        {
            // Default fields
            _enabled = true;
            _visible = true;
            _checked = false;
            _visibleThemes = true;
            _visibleStandard = true;
            _visibleRecent = true;
            _visibleNoColor = true;
            _visibleMoreColors = true;
            _autoRecentColors = true;
            _shortcutKeys = Keys.None;
            _imageSmall = _defaultButtonImageSmall;
            _imageLarge = _defaultButtonImageLarge;
            _textLine1 = "Color";
            _textLine2 = string.Empty;
            _keyTip = "B";
            _selectedColor = Color.Red;
            _emptyBorderColor = Color.DarkGray;
            _selectedRectSmall = new Rectangle(0, 12, 16, 4);
            _selectedRectLarge = new Rectangle(2, 26, 28, 4);
            _schemeThemes = ColorScheme.OfficeThemes;
            _schemeStandard = ColorScheme.OfficeStandard;
            _buttonType = GroupButtonType.Split;
            _itemSizeMax = GroupItemSize.Large;
            _itemSizeMin = GroupItemSize.Small;
            _itemSizeCurrent = GroupItemSize.Large;
            _toolTipImageTransparentColor = Color.Empty;
            _toolTipTitle = string.Empty;
            _toolTipBody = string.Empty;
            _toolTipStyle = LabelStyle.SuperTip;
            _maxRecentColors = 10;
            _recentColors = new List<Color>();

            // Create the context menu items
            _kryptonContextMenu = new KryptonContextMenu();
            _separatorTheme = new KryptonContextMenuSeparator();
            _headingTheme = new KryptonContextMenuHeading("Theme Colors");
            _colorsTheme = new KryptonContextMenuColorColumns(ColorScheme.OfficeThemes);
            _separatorStandard = new KryptonContextMenuSeparator();
            _headingStandard = new KryptonContextMenuHeading("Standard Colors");
            _colorsStandard = new KryptonContextMenuColorColumns(ColorScheme.OfficeStandard);
            _separatorRecent = new KryptonContextMenuSeparator();
            _headingRecent = new KryptonContextMenuHeading("Recent Colors");
            _colorsRecent = new KryptonContextMenuColorColumns(ColorScheme.None);
            _separatorNoColor = new KryptonContextMenuSeparator();
            _itemNoColor = new KryptonContextMenuItem("&No Color", Properties.Resources.ButtonNoColor, new EventHandler(OnClickNoColor));
            _itemsNoColor = new KryptonContextMenuItems();
            _itemsNoColor.Items.Add(_itemNoColor);
            _separatorMoreColors = new KryptonContextMenuSeparator();
            _itemMoreColors = new KryptonContextMenuItem("&More Colors...", new EventHandler(OnClickMoreColors));
            _itemsMoreColors = new KryptonContextMenuItems();
            _itemsMoreColors.Items.Add(_itemMoreColors);
            _kryptonContextMenu.Items.AddRange(new KryptonContextMenuItemBase[] { _separatorTheme, _headingTheme, _colorsTheme,
                                                                                  _separatorStandard, _headingStandard, _colorsStandard,
                                                                                  _separatorRecent, _headingRecent, _colorsRecent,
                                                                                  _separatorNoColor, _itemsNoColor,
                                                                                  _separatorMoreColors, _itemsMoreColors});
        }
 /// <summary>
 /// Initialise a new instance of the KryptonRibbonGroupClusterButton class.
 /// </summary>
 public KryptonRibbonGroupClusterButton()
 {
     // Default fields
     _enabled = true;
     _visible = true;
     _checked = false;
     _textLine = string.Empty;
     _keyTip = "B";
     _shortcutKeys = Keys.None;
     _itemSizeMax = GroupItemSize.Medium;
     _itemSizeMin = GroupItemSize.Small;
     _itemSizeCurrent = GroupItemSize.Medium;
     _imageSmall = _defaultButtonImageSmall;
     _buttonType = GroupButtonType.Push;
     _contextMenuStrip = null;
     _kryptonContextMenu = null;
     _toolTipImageTransparentColor = Color.Empty;
     _toolTipTitle = string.Empty;
     _toolTipBody = string.Empty;
     _toolTipStyle = LabelStyle.SuperTip;
 }