Implement storage for normal and disable navigator appearance.
Inheritance: ComponentFactory.Krypton.Toolkit.PaletteDoubleMetric
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 /// <param name="inheritNavigator">Source for inheriting.</param>
 public virtual void SetInherit(PaletteNavigator inheritNavigator)
 {
     CheckButton.SetInherit(inheritNavigator.CheckButton);
     OverflowButton.SetInherit(inheritNavigator.OverflowButton);
     MiniButton.SetInherit(inheritNavigator.MiniButton);
     Tab.SetInherit(inheritNavigator.Tab);
     RibbonTab.SetInherit(inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.Content);
 }
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 /// <param name="inheritNavigator">Source for inheriting.</param>
 public void SetInherit(PaletteNavigator inheritNavigator)
 {
     // Setup inheritance references for storage objects
     base.SetInherit(inheritNavigator);
     PalettePage.SetInherit(inheritNavigator.PalettePage);
     HeaderGroup.SetInherit(inheritNavigator.HeaderGroup);
     CheckButton.SetInherit(inheritNavigator.CheckButton);
     OverflowButton.SetInherit(inheritNavigator.OverflowButton);
     MiniButton.SetInherit(inheritNavigator.MiniButton);
     BorderEdge.SetInherit(inheritNavigator.BorderEdge);
     Separator.SetInherit(inheritNavigator.Separator);
     Tab.SetInherit(inheritNavigator.Tab);
     RibbonTab.SetInherit(inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.Content);
 }
Exemple #3
0
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 /// <param name="inheritNavigator">Source for inheriting.</param>
 public override void SetInherit(PaletteNavigator inheritNavigator)
 {
     Separator.SetInherit(inheritNavigator.Separator);
     base.SetInherit(inheritNavigator);
 }
Exemple #4
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);
        }
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 /// <param name="inheritNavigator">Source for inheriting.</param>
 public void SetInherit(PaletteNavigator inheritNavigator)
 {
     // Setup inheritance references for storage objects
     base.SetInherit(inheritNavigator);
     _palettePage.SetInherit(inheritNavigator.PalettePage);
     _paletteHeaderGroup.SetInherit(inheritNavigator.HeaderGroup);
     _paletteCheckButton.SetInherit(inheritNavigator.CheckButton);
     _paletteOverflowButton.SetInherit(inheritNavigator.OverflowButton);
     _paletteMiniButton.SetInherit(inheritNavigator.MiniButton);
     _paletteBorderEdge.SetInherit(inheritNavigator.BorderEdge);
     _paletteSeparator.SetInherit(inheritNavigator.Separator);
     _paletteTab.SetInherit(inheritNavigator.Tab);
     _paletteRibbonTab.SetInherit(inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.TabDraw, inheritNavigator.RibbonTab.Content);
 }
Exemple #6
0
        /// <summary>
        /// Define the state to use when inheriting state values.
        /// </summary>
        /// <param name="alignControl">Control to use when aligning rectangles.</param>
        /// <param name="common">State palette for inheriting common values.</param>
        /// <param name="disabled">State palette for inheriting disabled values.</param>
        /// <param name="normal">State palette for inheriting normal values.</param>
        /// <param name="tracking">State palette for inheriting tracking values.</param>
        /// <param name="pressed">State palette for inheriting pressed values.</param>
        /// <param name="selected">State palette for inheriting selected values.</param>
        /// <param name="focus">State palette for inheriting focus values.</param>
        public virtual void SetInherit(Control alignControl,
                                       PaletteNavigatorRedirect common,
                                       PaletteNavigator disabled,
                                       PaletteNavigator normal,
                                       PaletteNavigatorOtherEx tracking,
                                       PaletteNavigatorOtherEx pressed,
                                       PaletteNavigatorOther selected,
                                       PaletteNavigatorOtherRedirect focus)
        {
            ViewManager.AlignControl = alignControl;

            // Setup the redirection states
            _redirectNavigator.SetRedirectStates(disabled, disabled, normal, normal);
            _redirectNavigatorPage.SetRedirectStates(disabled.PalettePage, normal.PalettePage);
            _redirectNavigatorHeaderGroup.SetRedirectStates(disabled.HeaderGroup, disabled.HeaderGroup, normal.HeaderGroup, normal.HeaderGroup);
            _redirectNavigatorHeaderPrimary.SetRedirectStates(disabled.HeaderGroup.HeaderPrimary, disabled.HeaderGroup.HeaderPrimary, normal.HeaderGroup.HeaderPrimary, normal.HeaderGroup.HeaderPrimary);
            _redirectNavigatorHeaderSecondary.SetRedirectStates(disabled.HeaderGroup.HeaderSecondary, disabled.HeaderGroup.HeaderSecondary,  normal.HeaderGroup.HeaderSecondary, normal.HeaderGroup.HeaderSecondary);
            _redirectNavigatorHeaderBar.SetRedirectStates(disabled.HeaderGroup.HeaderBar, disabled.HeaderGroup.HeaderBar, normal.HeaderGroup.HeaderBar, normal.HeaderGroup.HeaderBar);
            _redirectNavigatorHeaderOverflow.SetRedirectStates(disabled.HeaderGroup.HeaderOverflow, disabled.HeaderGroup.HeaderOverflow, normal.HeaderGroup.HeaderOverflow, normal.HeaderGroup.HeaderOverflow);
            _redirectNavigatorCheckButton.SetRedirectStates(disabled.CheckButton, normal.CheckButton, pressed.CheckButton, tracking.CheckButton, selected.CheckButton, selected.CheckButton, selected.CheckButton, focus.CheckButton, null);
            _redirectNavigatorOverflowButton.SetRedirectStates(disabled.OverflowButton, normal.OverflowButton, pressed.OverflowButton, tracking.OverflowButton, selected.OverflowButton, selected.OverflowButton, selected.OverflowButton, focus.OverflowButton, null);
            _redirectNavigatorMiniButton.SetRedirectStates(disabled.MiniButton, normal.MiniButton, pressed.MiniButton, tracking.MiniButton, selected.MiniButton, selected.MiniButton, selected.MiniButton, focus.MiniButton, null);
            _redirectNavigatorBar.SetRedirectStates(common.Bar, common.Bar);
            _redirectNavigatorSeparator.SetRedirectStates(disabled.Separator, disabled.Separator, normal.Separator, normal.Separator, pressed.Separator, pressed.Separator, tracking.Separator, tracking.Separator);
            _redirectNavigatorTab.SetRedirectStates(disabled.Tab, normal.Tab, pressed.Tab, tracking.Tab, selected.Tab, selected.Tab, selected.Tab, focus.Tab, null);
            _redirectNavigatorRibbonTab.SetRedirectStates(disabled.RibbonTab, normal.RibbonTab, pressed.RibbonTab, tracking.RibbonTab, selected.RibbonTab, focus.RibbonTab);
            _stateCommon.RedirectBorderEdge = new PaletteRedirectBorderEdge(Redirector, disabled.BorderEdge, normal.BorderEdge);
            _stateCommon.RedirectRibbonGeneral = new PaletteRedirectRibbonGeneral(Redirector);
        }
 /// <summary>
 /// Sets the inheritence parent.
 /// </summary>
 /// <param name="inheritNavigator">Source for inheriting.</param>
 public override void SetInherit(PaletteNavigator inheritNavigator)
 {
     _paletteSeparator.SetInherit(inheritNavigator.Separator);
     base.SetInherit(inheritNavigator);
 }
Exemple #8
0
 /// <summary>
 /// Initialize a new instance of the PaletteNavigatorOverride class.
 /// </summary>
 /// <param name="normalOther">Normal palette to use.</param>
 /// <param name="overrideOther">Override palette to use.</param>
 /// <param name="overrideState">State used by the override.</param>
 public PaletteNavigatorOverride(PaletteNavigatorOtherRedirect normalOther,
                                 PaletteNavigator overrideOther,
                                 PaletteState overrideState)
     : this(normalOther.CheckButton, overrideOther.CheckButton, overrideState)
 {
 }
Exemple #9
0
        private void CreateStorageObjects()
        {
            // Create the page print specific delegate
            _needPagePaint = new NeedPaintHandler(OnNeedPagePaint);

            // Create state storage objects
            _stateCommon = new PaletteNavigatorRedirect(this, Redirector, _needPagePaint);
            _stateDisabled = new PaletteNavigator(_stateCommon, _needPagePaint);
            _stateNormal = new PaletteNavigator(_stateCommon, _needPagePaint);
            _stateTracking = new PaletteNavigatorOtherEx(_stateCommon, _needPagePaint);
            _statePressed = new PaletteNavigatorOtherEx(_stateCommon, _needPagePaint);
            _stateSelected = new PaletteNavigatorOther(_stateCommon, _needPagePaint);
            _stateFocus = new PaletteNavigatorOtherRedirect(Redirector, Redirector, Redirector,
                                                            Redirector, Redirector, _needPagePaint);

            // Create other storage objects
            _bar = new NavigatorBar(this, NeedPaintDelegate);
            _button = new NavigatorButton(this, NeedPaintDelegate);
            _group = new NavigatorGroup(this, NeedPaintDelegate);
            _header = new NavigatorHeader(this, NeedPaintDelegate);
            _outlook = new NavigatorOutlook(this, NeedPaintDelegate);
            _panel = new NavigatorPanel(this, NeedPaintDelegate);
            _popupPages = new NavigatorPopupPages(this, NeedPaintDelegate);
            _stack = new NavigatorStack(this, NeedPaintDelegate);
            _toolTips = new NavigatorToolTips(this, NeedPaintDelegate);

            // Need to know when the context button is about to show a context menu, so we
            // can then populate it with the correct set of values dependant on the current pages
            _button.ContextButton.KryptonContextMenu.Opening += new CancelEventHandler(OnOpeningContextMenu);
        }
 /// <summary>
 /// Initialize a new instance of the PaletteNavigatorOverride class.
 /// </summary>
 /// <param name="normalOther">Normal palette to use.</param>
 /// <param name="overrideOther">Override palette to use.</param>
 /// <param name="overrideState">State used by the override.</param>
 public PaletteNavigatorOverride(PaletteNavigatorOtherRedirect normalOther,
                                 PaletteNavigator overrideOther,
                                 PaletteState overrideState)
     : this(normalOther.CheckButton, overrideOther.CheckButton, overrideState)
 {
 }