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

            // Create the button style specific and common palettes
            _tabCommon = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabHighProfile, PaletteBorderStyle.TabHighProfile, PaletteContentStyle.TabHighProfile, needPaint);
            _tabHighProfile = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabHighProfile, PaletteBorderStyle.TabHighProfile, PaletteContentStyle.TabHighProfile, needPaint);
            _tabStandardProfile = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabStandardProfile, PaletteBorderStyle.TabStandardProfile, PaletteContentStyle.TabStandardProfile, needPaint);
            _tabLowProfile = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabLowProfile, PaletteBorderStyle.TabLowProfile, PaletteContentStyle.TabLowProfile, needPaint);
            _tabDock = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabDock, PaletteBorderStyle.TabDock, PaletteContentStyle.TabDock, needPaint);
            _tabDockAutoHidden = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabDockAutoHidden, PaletteBorderStyle.TabDockAutoHidden, PaletteContentStyle.TabDockAutoHidden, needPaint);
            _tabOneNote = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabOneNote, PaletteBorderStyle.TabOneNote, PaletteContentStyle.TabOneNote, needPaint);
            _tabCustom1 = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabCustom1, PaletteBorderStyle.TabCustom1, PaletteContentStyle.TabCustom1, needPaint);
            _tabCustom2 = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabCustom2, PaletteBorderStyle.TabCustom2, PaletteContentStyle.TabCustom2, needPaint);
            _tabCustom3 = new KryptonPaletteTabButton(redirector, PaletteBackStyle.TabCustom3, PaletteBorderStyle.TabCustom3, PaletteContentStyle.TabCustom3, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectTriple redirectCommon = new PaletteRedirectTriple(redirector,
                                                                             _tabCommon.StateDisabled, _tabCommon.StateNormal,
                                                                             _tabCommon.StatePressed, _tabCommon.StateTracking,
                                                                             _tabCommon.StateSelected,_tabCommon.OverrideFocus);
            // Inform the button style to use the new redirector
            _tabHighProfile.SetRedirector(redirectCommon);
            _tabStandardProfile.SetRedirector(redirectCommon);
            _tabLowProfile.SetRedirector(redirectCommon);
            _tabDock.SetRedirector(redirectCommon);
            _tabDockAutoHidden.SetRedirector(redirectCommon);
            _tabOneNote.SetRedirector(redirectCommon);
            _tabCustom1.SetRedirector(redirectCommon);
            _tabCustom2.SetRedirector(redirectCommon);
            _tabCustom3.SetRedirector(redirectCommon);
        }
        /// <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);
        }
示例#3
0
        /// <summary>
        /// Initialize a new instance of the KryptonContextMenuHeading class.
        /// </summary>
        /// <param name="initialText">Initial text for display.</param>
        public KryptonContextMenuHeading(string initialText)
        {
            // Default fields
            _text = initialText;
            _extraText = string.Empty;
            _image = null;
            _imageTransparentColor = Color.Empty;

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

            // Create the header storage for overriding specific values
            _stateNormal = new PaletteTripleRedirect(_redirectHeading,
                                                     PaletteBackStyle.ContextMenuHeading,
                                                     PaletteBorderStyle.ContextMenuHeading,
                                                     PaletteContentStyle.ContextMenuHeading);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteInputControls class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteInputControls(PaletteRedirect redirector,
            NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the input control style specific and common palettes
            _inputControlCommon = new KryptonPaletteInputControl(redirector, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, PaletteContentStyle.InputControlStandalone, needPaint);
            _inputControlStandalone = new KryptonPaletteInputControl(redirector, PaletteBackStyle.InputControlStandalone, PaletteBorderStyle.InputControlStandalone, PaletteContentStyle.InputControlStandalone, needPaint);
            _inputControlRibbon = new KryptonPaletteInputControl(redirector, PaletteBackStyle.InputControlRibbon, PaletteBorderStyle.InputControlRibbon, PaletteContentStyle.InputControlRibbon, needPaint);
            _inputControlCustom1 = new KryptonPaletteInputControl(redirector, PaletteBackStyle.InputControlCustom1, PaletteBorderStyle.InputControlCustom1, PaletteContentStyle.InputControlCustom1, needPaint);

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

            // Inform the input control style to use the new redirector
            _inputControlStandalone.SetRedirector(redirectCommon);
            _inputControlRibbon.SetRedirector(redirectCommon);
            _inputControlCustom1.SetRedirector(redirectCommon);
        }
        /// <summary>
        /// Initialize a new instance of the KryptonPaletteButtons class.
        /// </summary>
        /// <param name="redirector">Palette redirector for sourcing inherited values.</param>
        /// <param name="needPaint">Delegate for notifying paint requests.</param>
        internal KryptonPaletteCheckButtons(PaletteRedirect redirector,
                                       NeedPaintHandler needPaint)
        {
            Debug.Assert(redirector != null);

            // Create the button style specific and common palettes
            _buttonCommon = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
            _buttonStandalone = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint);
            _buttonAlternate = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonAlternate, PaletteBorderStyle.ButtonAlternate, PaletteContentStyle.ButtonAlternate, needPaint);
            _buttonLowProfile = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonLowProfile, PaletteBorderStyle.ButtonLowProfile, PaletteContentStyle.ButtonLowProfile, needPaint);
            _buttonButtonSpec = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint);
            _buttonBreadCrumb = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonBreadCrumb, PaletteBorderStyle.ButtonBreadCrumb, PaletteContentStyle.ButtonBreadCrumb, needPaint);
            _buttonCalendarDay = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCalendarDay, PaletteBorderStyle.ButtonCalendarDay, PaletteContentStyle.ButtonCalendarDay, needPaint);
            _buttonCluster = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCluster, PaletteBorderStyle.ButtonCluster, PaletteContentStyle.ButtonCluster, needPaint);
            _buttonGallery = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonGallery, PaletteBorderStyle.ButtonGallery, PaletteContentStyle.ButtonGallery, needPaint);
            _buttonNavigatorStack = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonNavigatorStack, PaletteBorderStyle.ButtonNavigatorStack, PaletteContentStyle.ButtonNavigatorStack, needPaint);
            _buttonNavigatorOverflow = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonNavigatorOverflow, PaletteBorderStyle.ButtonNavigatorOverflow, PaletteContentStyle.ButtonNavigatorOverflow, needPaint);
            _buttonNavigatorMini = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonNavigatorMini, PaletteBorderStyle.ButtonNavigatorMini, PaletteContentStyle.ButtonNavigatorMini, needPaint);
            _buttonInputControl = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonInputControl, PaletteBorderStyle.ButtonInputControl, PaletteContentStyle.ButtonInputControl, needPaint);
            _buttonListItem = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, needPaint);
            _buttonForm = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonForm, PaletteBorderStyle.ButtonForm, PaletteContentStyle.ButtonForm, needPaint);
            _buttonFormClose = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonFormClose, PaletteBorderStyle.ButtonFormClose, PaletteContentStyle.ButtonFormClose, needPaint);
            _buttonCommand = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCommand, PaletteBorderStyle.ButtonCommand, PaletteContentStyle.ButtonCommand, needPaint);
            _buttonCustom1 = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCustom1, PaletteBorderStyle.ButtonCustom1, PaletteContentStyle.ButtonCustom1, needPaint);
            _buttonCustom2 = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCustom2, PaletteBorderStyle.ButtonCustom2, PaletteContentStyle.ButtonCustom2, needPaint);
            _buttonCustom3 = new KryptonPaletteCheckButton(redirector, PaletteBackStyle.ButtonCustom3, PaletteBorderStyle.ButtonCustom3, PaletteContentStyle.ButtonCustom3, needPaint);

            // Create redirectors for inheriting from style specific to style common
            PaletteRedirectTriple redirectCommon = new PaletteRedirectTriple(redirector,
                                                                             _buttonCommon.StateDisabled, _buttonCommon.StateNormal,
                                                                             _buttonCommon.StatePressed, _buttonCommon.StateTracking,
                                                                             _buttonCommon.StateCheckedNormal, _buttonCommon.StateCheckedPressed,
                                                                             _buttonCommon.StateCheckedTracking,_buttonCommon.OverrideFocus,
                                                                             _buttonCommon.OverrideDefault);
            // Inform the button style to use the new redirector
            _buttonStandalone.SetRedirector(redirectCommon);
            _buttonAlternate.SetRedirector(redirectCommon);
            _buttonLowProfile.SetRedirector(redirectCommon);
            _buttonButtonSpec.SetRedirector(redirectCommon);
            _buttonBreadCrumb.SetRedirector(redirectCommon);
            _buttonCalendarDay.SetRedirector(redirectCommon);
            _buttonCluster.SetRedirector(redirectCommon);
            _buttonGallery.SetRedirector(redirectCommon);
            _buttonNavigatorStack.SetRedirector(redirectCommon);
            _buttonNavigatorOverflow.SetRedirector(redirectCommon);
            _buttonNavigatorMini.SetRedirector(redirectCommon);
            _buttonInputControl.SetRedirector(redirectCommon);
            _buttonListItem.SetRedirector(redirectCommon);
            _buttonForm.SetRedirector(redirectCommon);
            _buttonFormClose.SetRedirector(redirectCommon);
            _buttonCommand.SetRedirector(redirectCommon);
            _buttonCustom1.SetRedirector(redirectCommon);
            _buttonCustom2.SetRedirector(redirectCommon);
            _buttonCustom3.SetRedirector(redirectCommon);
        }
示例#6
0
        /// <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);
        }