コード例 #1
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteLabels class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteLabels(PaletteRedirect redirector,
                                      NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            _labelCommon        = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalControl, needPaint);
            _labelNormalControl = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalControl, needPaint);
            _labelTitleControl  = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelTitleControl, needPaint);
            _labelNormalPanel   = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelNormalPanel, needPaint);
            _labelTitlePanel    = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelTitlePanel, needPaint);
            _labelCaptionPanel  = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelGroupBoxCaption, needPaint);
            _labelToolTip       = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelToolTip, needPaint);
            _labelSuperTip      = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelSuperTip, needPaint);
            _labelKeyTip        = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelKeyTip, needPaint);
            _labelCustom1       = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom1, needPaint);
            _labelCustom2       = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom2, needPaint);
            _labelCustom3       = new KryptonPaletteLabel(redirector, PaletteContentStyle.LabelCustom3, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectContent redirectCommon = new PaletteRedirectContent(redirector, _labelCommon.StateDisabled, _labelCommon.StateNormal);

            // Inform the button style to use the new redirector
            _labelNormalControl.SetRedirector(redirectCommon);
            _labelTitleControl.SetRedirector(redirectCommon);
            _labelNormalPanel.SetRedirector(redirectCommon);
            _labelTitlePanel.SetRedirector(redirectCommon);
            _labelCaptionPanel.SetRedirector(redirectCommon);
            _labelToolTip.SetRedirector(redirectCommon);
            _labelSuperTip.SetRedirector(redirectCommon);
            _labelKeyTip.SetRedirector(redirectCommon);
            _labelCustom1.SetRedirector(redirectCommon);
            _labelCustom2.SetRedirector(redirectCommon);
            _labelCustom3.SetRedirector(redirectCommon);
        }
コード例 #2
0
        /// <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);
        }