Redirect back/border based on the incoming state of the request.
Inheritance: PaletteRedirect
コード例 #1
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteControls class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteControls(PaletteRedirect redirector,
                                        NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            _controlCommon = new KryptonPaletteControl(redirector, PaletteBackStyle.ControlClient, PaletteBorderStyle.ControlClient, needPaint);
            _controlClient = new KryptonPaletteControl(redirector, PaletteBackStyle.ControlClient, PaletteBorderStyle.ControlClient, needPaint);
            _controlAlternate = new KryptonPaletteControl(redirector, PaletteBackStyle.ControlAlternate, PaletteBorderStyle.ControlAlternate, needPaint);
            _controlGroupBox = new KryptonPaletteControl(redirector, PaletteBackStyle.ControlGroupBox, PaletteBorderStyle.ControlGroupBox, needPaint);
            _controlToolTip = new KryptonPaletteControl(redirector, PaletteBackStyle.ControlToolTip, PaletteBorderStyle.ControlToolTip, needPaint);
            _controlRibbon = new KryptonPaletteControl(redirector, PaletteBackStyle.ControlRibbon, PaletteBorderStyle.ControlRibbon, needPaint);
            _controlRibbonAppMenu = new KryptonPaletteControl(redirector, PaletteBackStyle.ControlRibbonAppMenu, PaletteBorderStyle.ControlRibbonAppMenu, needPaint);
            _controlCustom1 = new KryptonPaletteControl(redirector, PaletteBackStyle.ControlCustom1, PaletteBorderStyle.ControlCustom1, needPaint);

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

            // Inform the button style to use the new redirector
            _controlClient.SetRedirector(redirectCommon);
            _controlAlternate.SetRedirector(redirectCommon);
            _controlGroupBox.SetRedirector(redirectCommon);
            _controlToolTip.SetRedirector(redirectCommon);
            _controlRibbon.SetRedirector(redirectCommon);
            _controlRibbonAppMenu.SetRedirector(redirectCommon);
            _controlCustom1.SetRedirector(redirectCommon);
        }
コード例 #2
0
        /// <summary>
        /// Initialize a new instance of the KryptonContextMenuSeparator class.
        /// </summary>
        public KryptonContextMenuSeparator()
        {
            // Default fields
            _horizontal = true;

            // Create the redirector that can get values from the krypton context menu
            _redirectSeparator = new PaletteRedirectDouble();

            // Create the separator storage for overriding specific values
            _stateNormal = new PaletteDoubleRedirect(_redirectSeparator,
                                                     PaletteBackStyle.ContextMenuSeparator,
                                                     PaletteBorderStyle.ContextMenuSeparator);
        }
コード例 #3
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);
        }
コード例 #4
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteForms class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteForms(PaletteRedirect redirector,
                                     NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the form style specific and common palettes
            _formCommon = new KryptonPaletteForm(redirector, PaletteBackStyle.FormMain, PaletteBorderStyle.FormMain, needPaint);
            _formMain = new KryptonPaletteForm(redirector, PaletteBackStyle.FormMain, PaletteBorderStyle.FormMain, needPaint);
            _formCustom1 = new KryptonPaletteForm(redirector, PaletteBackStyle.FormCustom1, PaletteBorderStyle.FormCustom1, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectDouble redirectCommon = new PaletteRedirectDouble(redirector, _formCommon.StateInactive, _formCommon.StateActive);

            // Inform the form style to use the new redirector
            _formMain.SetRedirector(redirectCommon);
            _formCustom1.SetRedirector(redirectCommon);
        }
コード例 #5
0
        /// <summary>
        /// Initialize a new instance of the KryptonContextMenuItems class.
        /// </summary>
        /// <param name="children">Array of initial child items.</param>
        public KryptonContextMenuItems(KryptonContextMenuItemBase[] children)
        {
            // Default fields
            _standardStyle = true;
            _imageColumn = true;
            _items = new KryptonContextMenuItemCollection();

            // Add any initial set of item
            if (children != null)
                _items.AddRange(children);

            // Create the redirector that can get values from the krypton context menu
            _redirectImageColumn = new PaletteRedirectDouble();

            // Create the column image storage for overriding specific values
            _stateNormal = new PaletteDoubleRedirect(_redirectImageColumn,
                                                     PaletteBackStyle.ContextMenuItemImageColumn,
                                                     PaletteBorderStyle.ContextMenuItemImageColumn);
        }
コード例 #6
0
        /// <summary>
        /// Initialize a new instance of the KryptonContextMenuItems class.
        /// </summary>
        /// <param name="children">Array of initial child items.</param>
        public KryptonContextMenuItems(KryptonContextMenuItemBase[] children)
        {
            // Default fields
            _standardStyle = true;
            _imageColumn   = true;
            Items          = new KryptonContextMenuItemCollection();

            // Add any initial set of item
            if (children != null)
            {
                Items.AddRange(children);
            }

            // Create the redirector that can get values from the krypton context menu
            _redirectImageColumn = new PaletteRedirectDouble();

            // Create the column image storage for overriding specific values
            StateNormal = new PaletteDoubleRedirect(_redirectImageColumn,
                                                    PaletteBackStyle.ContextMenuItemImageColumn,
                                                    PaletteBorderStyle.ContextMenuItemImageColumn);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteForms class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteForms(PaletteRedirect redirector,
                                     NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the form style specific and common palettes
            FormCommon  = new KryptonPaletteForm(redirector, PaletteBackStyle.FormMain, PaletteBorderStyle.FormMain, needPaint);
            FormMain    = new KryptonPaletteForm(redirector, PaletteBackStyle.FormMain, PaletteBorderStyle.FormMain, needPaint);
            FormCustom1 = new KryptonPaletteForm(redirector, PaletteBackStyle.FormCustom1, PaletteBorderStyle.FormCustom1, needPaint);
            FormCustom2 = new KryptonPaletteForm(redirector, PaletteBackStyle.FormCustom2, PaletteBorderStyle.FormCustom2, needPaint);
            FormCustom3 = new KryptonPaletteForm(redirector, PaletteBackStyle.FormCustom3, PaletteBorderStyle.FormCustom3, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectDouble redirectCommon = new PaletteRedirectDouble(redirector, FormCommon.StateInactive, FormCommon.StateActive);

            // Inform the form style to use the new redirector
            FormMain.SetRedirector(redirectCommon);
            FormCustom1.SetRedirector(redirectCommon);
            FormCustom2.SetRedirector(redirectCommon);
            FormCustom3.SetRedirector(redirectCommon);
        }
コード例 #8
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteSeparators class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteSeparators(PaletteRedirect redirector,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            _separatorCommon              = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorLowProfile, PaletteBorderStyle.SeparatorLowProfile, needPaint);
            _separatorLowProfile          = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorLowProfile, PaletteBorderStyle.SeparatorLowProfile, needPaint);
            _separatorHighProfile         = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorHighProfile, PaletteBorderStyle.SeparatorHighProfile, needPaint);
            _separatorHighInternalProfile = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorHighInternalProfile, PaletteBorderStyle.SeparatorHighInternalProfile, needPaint);
            _separatorCustom1             = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorCustom1, PaletteBorderStyle.SeparatorCustom1, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectDouble redirectCommon = new PaletteRedirectDouble(redirector,
                                                                             _separatorCommon.StateDisabled, _separatorCommon.StateNormal,
                                                                             _separatorCommon.StatePressed, _separatorCommon.StateTracking);

            // Inform the button style to use the new redirector
            _separatorLowProfile.SetRedirector(redirectCommon);
            _separatorHighProfile.SetRedirector(redirectCommon);
            _separatorHighInternalProfile.SetRedirector(redirectCommon);
            _separatorCustom1.SetRedirector(redirectCommon);
        }
コード例 #9
0
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteSeparators class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteSeparators(PaletteRedirect redirector,
                                          NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            _separatorCommon = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorLowProfile, PaletteBorderStyle.SeparatorLowProfile, needPaint);
            _separatorLowProfile = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorLowProfile, PaletteBorderStyle.SeparatorLowProfile, needPaint);
            _separatorHighProfile = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorHighProfile, PaletteBorderStyle.SeparatorHighProfile, needPaint);
            _separatorHighInternalProfile = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorHighInternalProfile, PaletteBorderStyle.SeparatorHighInternalProfile, needPaint);
            _separatorCustom1 = new KryptonPaletteSeparator(redirector, PaletteBackStyle.SeparatorCustom1, PaletteBorderStyle.SeparatorCustom1, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectDouble redirectCommon = new PaletteRedirectDouble(redirector,
                                                                             _separatorCommon.StateDisabled, _separatorCommon.StateNormal,
                                                                             _separatorCommon.StatePressed, _separatorCommon.StateTracking);

            // Inform the button style to use the new redirector
            _separatorLowProfile.SetRedirector(redirectCommon);
            _separatorHighProfile.SetRedirector(redirectCommon);
            _separatorHighInternalProfile.SetRedirector(redirectCommon);
            _separatorCustom1.SetRedirector(redirectCommon);
        }
コード例 #10
0
ファイル: KryptonPage.cs プロジェクト: Cocotteseb/Krypton
        /// <summary>
        /// Initialize a new instance of the KryptonPage class.
        /// </summary>
        /// <param name="text">Initial text.</param>
        /// <param name="imageSmall">Initial small image.</param>
        /// <param name="uniqueName">Initial unique name.</param>
        public KryptonPage(string text, Image imageSmall, string uniqueName)
        {
            // Default properties
            Text = text;
            MinimumSize = new Size(50, 50);
            _textTitle = "Page Title";
            _textDescription = "Page Description";
            _toolTipTitle = "Page ToolTip";
            _toolTipBody = string.Empty;
            _toolTipImage = null;
            _toolTipStyle = LabelStyle.ToolTip;
            _toolTipImageTransparentColor = Color.Empty;
            _imageSmall = imageSmall;
            _setVisible = true;
            _autoHiddenSlideSize = new Size(200, 200);
            _uniqueName = (string.IsNullOrEmpty(uniqueName) ? CommonHelper.UniqueString : uniqueName);
            _flags.Flags = (int)(KryptonPageFlags.All);
            _flags.ClearFlags((int)KryptonPageFlags.PageInOverflowBarForOutlookMode);

            // Create delegates
            _needDisabledPaint = new NeedPaintHandler(OnNeedDisabledPaint);
            _needNormalPaint = new NeedPaintHandler(OnNeedNormalPaint);

            // Create redirector for inheriting from owning navigator
            _redirectNavigator = new PaletteRedirectDoubleMetric(Redirector);
            _redirectNavigatorPage = new PaletteRedirectDouble(Redirector);
            _redirectNavigatorHeaderGroup = new PaletteRedirectDoubleMetric(Redirector);
            _redirectNavigatorHeaderPrimary = new PaletteRedirectTripleMetric(Redirector);
            _redirectNavigatorHeaderSecondary = new PaletteRedirectTripleMetric(Redirector);
            _redirectNavigatorHeaderBar = new PaletteRedirectTripleMetric(Redirector);
            _redirectNavigatorHeaderOverflow = new PaletteRedirectTripleMetric(Redirector);
            _redirectNavigatorCheckButton = new PaletteRedirectTriple(Redirector);
            _redirectNavigatorOverflowButton = new PaletteRedirectTriple(Redirector);
            _redirectNavigatorMiniButton = new PaletteRedirectTriple(Redirector);
            _redirectNavigatorBar = new PaletteRedirectMetric(Redirector);
            _redirectNavigatorSeparator = new PaletteRedirectDoubleMetric(Redirector);
            _redirectNavigatorTab = new PaletteRedirectTriple(Redirector);
            _redirectNavigatorRibbonTab = new PaletteRedirectRibbonTabContent(Redirector);

            // Create the palette storage
            _stateCommon = new PaletteNavigatorRedirect(null,
                                                        _redirectNavigator,
                                                        _redirectNavigatorPage,
                                                        _redirectNavigatorHeaderGroup,
                                                        _redirectNavigatorHeaderPrimary,
                                                        _redirectNavigatorHeaderSecondary,
                                                        _redirectNavigatorHeaderBar,
                                                        _redirectNavigatorHeaderOverflow,
                                                        _redirectNavigatorCheckButton,
                                                        _redirectNavigatorOverflowButton,
                                                        _redirectNavigatorMiniButton,
                                                        _redirectNavigatorBar,
                                                        new PaletteRedirectBorder(Redirector),
                                                        _redirectNavigatorSeparator,
                                                        _redirectNavigatorTab,
                                                        _redirectNavigatorRibbonTab,
                                                        new PaletteRedirectRibbonGeneral(Redirector),
                                                        NeedPaintDelegate);

            _stateDisabled = new PaletteNavigator(_stateCommon, _needDisabledPaint);
            _stateNormal = new PaletteNavigator(_stateCommon, _needNormalPaint);
            _stateTracking = new PaletteNavigatorOtherEx(_stateCommon, _needNormalPaint);
            _statePressed = new PaletteNavigatorOtherEx(_stateCommon, _needNormalPaint);
            _stateSelected = new PaletteNavigatorOther(_stateCommon, _needNormalPaint);

            _stateFocus = new PaletteNavigatorOtherRedirect(_redirectNavigatorCheckButton,
                                                            _redirectNavigatorOverflowButton,
                                                            _redirectNavigatorMiniButton,
                                                            _redirectNavigatorTab,
                                                            _redirectNavigatorRibbonTab, _needNormalPaint);

            // Our view contains just a simple canvas that covers entire client area
            _drawPanel = new ViewDrawPanel(_stateNormal.Page);

            // Create page specific button spec storage
            _buttonSpecs = new PageButtonSpecCollection(this);

            // Create the view manager instance
            ViewManager = new ViewManager(this, _drawPanel);
        }