Redirect storage for a double palette with palette metrics.
Inheritance: PaletteDoubleRedirect, IPaletteMetric
        /// <summary>
        /// Initialize a new instance of the PaletteDoubleMetric class.
        /// </summary>
        /// <param name="inherit">Source for palette defaulted values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteDoubleMetric(PaletteDoubleMetricRedirect inherit,
                                   NeedPaintHandler needPaint)
            : base(inherit, needPaint)
        {
            Debug.Assert(inherit != null);

            // Remember inheritance for metric values
            _inherit = inherit;
        }
Exemple #2
0
        /// <summary>
        /// Initialize a new instance of the PaletteDoubleMetric class.
        /// </summary>
        /// <param name="inherit">Source for palette defaulted values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteDoubleMetric(PaletteDoubleMetricRedirect inherit,
                                   NeedPaintHandler needPaint)
            : base(inherit, needPaint)
        {
            Debug.Assert(inherit != null);

            // Remember inheritance for metric values
            _inherit = inherit;
        }
 /// <summary>
 /// Initialize a new instance of the PaletteContextMenuItemState class.
 /// </summary>
 /// <param name="redirectItemHighlight">Redirector for ItemHighlight.</param>
 /// <param name="redirectItemImage">Redirector for ItemImage.</param>
 /// <param name="redirectItemShortcutText">Redirector for ItemShortcutText.</param>
 /// <param name="redirectItemSplit">Redirector for ItemSplit.</param>
 /// <param name="redirectItemTextAlternate">Redirector for ItemTextStandard.</param>
 /// <param name="redirectItemTextStandard">Redirector for ItemTextAlternate.</param>
 public PaletteContextMenuItemState(PaletteDoubleMetricRedirect redirectItemHighlight,
                                    PaletteTripleJustImageRedirect redirectItemImage,
                                    PaletteContentInheritRedirect redirectItemShortcutText,
                                    PaletteDoubleRedirect redirectItemSplit,
                                    PaletteContentInheritRedirect redirectItemTextStandard,
                                    PaletteContentInheritRedirect redirectItemTextAlternate)
 {
     _paletteItemHighlight     = new PaletteDoubleMetric(redirectItemHighlight);
     _paletteItemImage         = new PaletteTripleJustImage(redirectItemImage);
     _paletteItemShortcutText  = new PaletteContentJustShortText(redirectItemShortcutText);
     _paletteItemSplit         = new PaletteDouble(redirectItemSplit);
     _paletteItemTextStandard  = new PaletteContentJustText(redirectItemTextStandard);
     _paletteItemTextAlternate = new PaletteContentJustText(redirectItemTextAlternate);
 }
 /// <summary>
 /// Initialize a new instance of the PaletteContextMenuItemState class.
 /// </summary>
 /// <param name="redirectItemHighlight">Redirector for ItemHighlight.</param>
 /// <param name="redirectItemImage">Redirector for ItemImage.</param>
 /// <param name="redirectItemShortcutText">Redirector for ItemShortcutText.</param>
 /// <param name="redirectItemSplit">Redirector for ItemSplit.</param>
 /// <param name="redirectItemTextAlternate">Redirector for ItemTextStandard.</param>
 /// <param name="redirectItemTextStandard">Redirector for ItemTextAlternate.</param>
 public PaletteContextMenuItemState(PaletteDoubleMetricRedirect redirectItemHighlight,
                                    PaletteTripleJustImageRedirect redirectItemImage,
                                    PaletteContentInheritRedirect redirectItemShortcutText,
                                    PaletteDoubleRedirect redirectItemSplit,
                                    PaletteContentInheritRedirect redirectItemTextStandard,
                                    PaletteContentInheritRedirect redirectItemTextAlternate)
 {
     _paletteItemHighlight = new PaletteDoubleMetric(redirectItemHighlight);
     _paletteItemImage = new PaletteTripleJustImage(redirectItemImage);
     _paletteItemShortcutText = new PaletteContentJustShortText(redirectItemShortcutText);
     _paletteItemSplit = new PaletteDouble(redirectItemSplit);
     _paletteItemTextStandard = new PaletteContentJustText(redirectItemTextStandard);
     _paletteItemTextAlternate = new PaletteContentJustText(redirectItemTextAlternate);
 }
        /// <summary>
        /// Initialize a new instance of the PaletteContextMenuItemStateRedirect class.
        /// </summary>
        public PaletteContextMenuItemStateRedirect()
        {
            _itemHighlight    = new PaletteRedirectDouble();
            _itemImage        = new PaletteRedirectTriple();
            _itemShortcutText = new PaletteRedirectContent();
            _itemSplit        = new PaletteRedirectDouble();
            _itemStandard     = new PaletteRedirectContent();
            _itemAlternate    = new PaletteRedirectContent();

            _redirectItemHighlight     = new PaletteDoubleMetricRedirect(_itemHighlight, PaletteBackStyle.ContextMenuItemHighlight, PaletteBorderStyle.ContextMenuItemHighlight);
            _redirectItemImage         = new PaletteTripleJustImageRedirect(_itemImage, PaletteBackStyle.ContextMenuItemImage, PaletteBorderStyle.ContextMenuItemImage, PaletteContentStyle.ContextMenuItemImage);
            _redirectItemShortcutText  = new PaletteContentInheritRedirect(_itemShortcutText, PaletteContentStyle.ContextMenuItemShortcutText);
            _redirectItemSplit         = new PaletteDoubleRedirect(_itemSplit, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator);
            _redirectItemTextStandard  = new PaletteContentInheritRedirect(_itemStandard, PaletteContentStyle.ContextMenuItemTextStandard);
            _redirectItemTextAlternate = new PaletteContentInheritRedirect(_itemAlternate, PaletteContentStyle.ContextMenuItemTextAlternate);
        }
        /// <summary>
        /// Initialize a new instance of the PaletteContextMenuItemStateRedirect class.
        /// </summary>
        public PaletteContextMenuItemStateRedirect()
        {
            _itemHighlight = new PaletteRedirectDouble();
            _itemImage = new PaletteRedirectTriple();
            _itemShortcutText = new PaletteRedirectContent();
            _itemSplit = new PaletteRedirectDouble();
            _itemStandard = new PaletteRedirectContent();
            _itemAlternate = new PaletteRedirectContent();

            _redirectItemHighlight = new PaletteDoubleMetricRedirect(_itemHighlight, PaletteBackStyle.ContextMenuItemHighlight, PaletteBorderStyle.ContextMenuItemHighlight);
            _redirectItemImage = new PaletteTripleJustImageRedirect(_itemImage, PaletteBackStyle.ContextMenuItemImage, PaletteBorderStyle.ContextMenuItemImage, PaletteContentStyle.ContextMenuItemImage);
            _redirectItemShortcutText = new PaletteContentInheritRedirect(_itemShortcutText, PaletteContentStyle.ContextMenuItemShortcutText);
            _redirectItemSplit = new PaletteDoubleRedirect(_itemSplit, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator);
            _redirectItemTextStandard = new PaletteContentInheritRedirect(_itemStandard, PaletteContentStyle.ContextMenuItemTextStandard);
            _redirectItemTextAlternate = new PaletteContentInheritRedirect(_itemAlternate, PaletteContentStyle.ContextMenuItemTextAlternate);
        }
        /// <summary>
        /// Initialize a new instance of the ViewLayoutMenuItemsPile class.
        /// </summary>
        /// <param name="provider">Provider of context menu values.</param>
        /// <param name="items">Reference to the owning collection.</param>
        /// <param name="standardStyle">Draw items with standard or alternate style.</param>
        /// <param name="imageColumn">Draw an image background for the item images.</param>
        public ViewLayoutMenuItemsPile(IContextMenuProvider provider,
                                       KryptonContextMenuItems items,
                                       bool standardStyle,
                                       bool imageColumn)
        {
            // Cache access to the highlight item palette
            _paletteItemHighlight = provider.ProviderStateCommon.ItemHighlight;

            // Create and place an image column inside a docker so it appears on the left side
            _imageColumn = new ViewDrawMenuImageColumn(items, provider.ProviderStateCommon.ItemImageColumn);
            ViewLayoutDocker imageDocker = new ViewLayoutDocker
            {
                { _imageColumn, ViewDockStyle.Left }
            };

            // Only show the image column when in a standard collection of items
            imageDocker.Visible = imageColumn;

            // Create a vertical stack that contains each individual menu item
            ItemStack = new ViewLayoutStack(false)
            {
                FillLastChild = false
            };

            // Use a docker with the item stack as the fill
            ViewLayoutDocker stackDocker = new ViewLayoutDocker
            {
                { ItemStack, ViewDockStyle.Fill }
            };

            // Grab the padding for around the item stack
            Padding itemsPadding = _paletteItemHighlight.GetMetricPadding(PaletteState.Normal, PaletteMetricPadding.ContextMenuItemsCollection);

            stackDocker.Add(new ViewLayoutSeparator(itemsPadding.Left), ViewDockStyle.Left);
            stackDocker.Add(new ViewLayoutSeparator(itemsPadding.Right), ViewDockStyle.Right);
            stackDocker.Add(new ViewLayoutSeparator(itemsPadding.Top), ViewDockStyle.Top);
            stackDocker.Add(new ViewLayoutSeparator(itemsPadding.Bottom), ViewDockStyle.Bottom);

            // The background of the pile is the image column
            Add(imageDocker);

            // The foreground of the pile is the stack of menu items
            Add(stackDocker);
        }
        /// <summary>
        /// Initialize a new instance of the PaletteContextMenuRedirect class.
        /// </summary>
        /// <param name="redirect">Inheritence redirection.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteContextMenuRedirect(PaletteRedirect redirect,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(redirect != null);

            // Create the palette storage
            _paletteControlInner              = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuInner, PaletteBorderStyle.ContextMenuInner, needPaint);
            _paletteControlOuter              = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuOuter, PaletteBorderStyle.ContextMenuOuter, needPaint);
            _paletteHeading                   = new PaletteTripleRedirect(redirect, PaletteBackStyle.ContextMenuHeading, PaletteBorderStyle.ContextMenuHeading, PaletteContentStyle.ContextMenuHeading, needPaint);
            _paletteItemHighlight             = new PaletteDoubleMetricRedirect(redirect, PaletteBackStyle.ContextMenuItemHighlight, PaletteBorderStyle.ContextMenuItemHighlight, needPaint);
            _paletteItemImage                 = new PaletteTripleJustImageRedirect(redirect, PaletteBackStyle.ContextMenuItemImage, PaletteBorderStyle.ContextMenuItemImage, PaletteContentStyle.ContextMenuItemImage, needPaint);
            _paletteItemImageColumn           = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuItemImageColumn, PaletteBorderStyle.ContextMenuItemImageColumn, needPaint);
            _paletteItemShortcutTextRedirect  = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemShortcutText);
            _paletteItemShortcutText          = new PaletteContentJustShortText(_paletteItemShortcutTextRedirect, needPaint);
            _paletteItemSplit                 = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuItemSplit, PaletteBorderStyle.ContextMenuItemSplit, needPaint);
            _paletteItemTextAlternateRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemTextAlternate);
            _paletteItemTextAlternate         = new PaletteContentJustText(_paletteItemTextAlternateRedirect, needPaint);
            _paletteItemTextStandardRedirect  = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemTextStandard);
            _paletteItemTextStandard          = new PaletteContentJustText(_paletteItemTextStandardRedirect, needPaint);
            _paletteSeparator                 = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator, needPaint);
        }
        /// <summary>
        /// Initialize a new instance of the PaletteContextMenuRedirect class.
        /// </summary>
        /// <param name="redirect">Inheritence redirection.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        public PaletteContextMenuRedirect(PaletteRedirect redirect,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(redirect != null);

            // Create the palette storage
            _paletteControlInner = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuInner, PaletteBorderStyle.ContextMenuInner, needPaint);
            _paletteControlOuter = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuOuter, PaletteBorderStyle.ContextMenuOuter, needPaint);
            _paletteHeading = new PaletteTripleRedirect(redirect, PaletteBackStyle.ContextMenuHeading, PaletteBorderStyle.ContextMenuHeading, PaletteContentStyle.ContextMenuHeading, needPaint);
            _paletteItemHighlight = new PaletteDoubleMetricRedirect(redirect, PaletteBackStyle.ContextMenuItemHighlight, PaletteBorderStyle.ContextMenuItemHighlight, needPaint);
            _paletteItemImage = new PaletteTripleJustImageRedirect(redirect, PaletteBackStyle.ContextMenuItemImage, PaletteBorderStyle.ContextMenuItemImage, PaletteContentStyle.ContextMenuItemImage, needPaint);
            _paletteItemImageColumn = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuItemImageColumn, PaletteBorderStyle.ContextMenuItemImageColumn, needPaint);
            _paletteItemShortcutTextRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemShortcutText);
            _paletteItemShortcutText = new PaletteContentJustShortText(_paletteItemShortcutTextRedirect, needPaint);
            _paletteItemSplit = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuItemSplit, PaletteBorderStyle.ContextMenuItemSplit, needPaint);
            _paletteItemTextAlternateRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemTextAlternate);
            _paletteItemTextAlternate = new PaletteContentJustText(_paletteItemTextAlternateRedirect, needPaint);
            _paletteItemTextStandardRedirect = new PaletteContentInheritRedirect(redirect, PaletteContentStyle.ContextMenuItemTextStandard);
            _paletteItemTextStandard = new PaletteContentJustText(_paletteItemTextStandardRedirect, needPaint);
            _paletteSeparator = new PaletteDoubleRedirect(redirect, PaletteBackStyle.ContextMenuSeparator, PaletteBorderStyle.ContextMenuSeparator, needPaint);
        }
Exemple #10
0
 /// <summary>
 /// Initialize a new instance of the PaletteContextMenuItemStateHighlight class.
 /// </summary>
 /// <param name="redirectItemHighlight">Redirector for the ItemHighlight.</param>
 /// <param name="redirectItemSplit">Redirector for the ItemSplit.</param>
 public PaletteContextMenuItemStateHighlight(PaletteDoubleMetricRedirect redirectItemHighlight,
                                             PaletteDoubleRedirect redirectItemSplit)
 {
     ItemHighlight = new PaletteDoubleMetric(redirectItemHighlight);
     ItemSplit     = new PaletteDouble(redirectItemSplit);
 }
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 public void SetInherit(PaletteDoubleMetricRedirect inherit)
 {
     base.SetInherit(inherit);
     _inherit = inherit;
 }
 /// <summary>
 /// Initialize a new instance of the PaletteDoubleMetric class.
 /// </summary>
 /// <param name="inherit">Source for palette defaulted values.</param>
 public PaletteDoubleMetric(PaletteDoubleMetricRedirect inherit)
     : this(inherit, null)
 {
 }
 /// <summary>
 /// Initialize a new instance of the PaletteDoubleMetric class.
 /// </summary>
 /// <param name="inherit">Source for palette defaulted values.</param>
 public PaletteDoubleMetric(PaletteDoubleMetricRedirect inherit)
     : this(inherit, null)
 {
 }
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 public void SetInherit(PaletteDoubleMetricRedirect inherit)
 {
     base.SetInherit(inherit);
     _inherit = inherit;
 }
 /// <summary>
 /// Initialize a new instance of the PaletteContextMenuItemStateHighlight class.
 /// </summary>
 /// <param name="redirectItemHighlight">Redirector for the ItemHighlight.</param>
 /// <param name="redirectItemSplit">Redirector for the ItemSplit.</param>
 public PaletteContextMenuItemStateHighlight(PaletteDoubleMetricRedirect redirectItemHighlight,
                                             PaletteDoubleRedirect redirectItemSplit)
 {
     _paletteItemHighlight = new PaletteDoubleMetric(redirectItemHighlight);
     _paletteItemSplit = new PaletteDouble(redirectItemSplit);
 }