/// <summary> /// Gets the first background color. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBackColor1(PaletteBackStyle style, PaletteState state) { // Only override system palette if a recognized office 2003 color scheme is used if (_usingOffice2003) { switch (style) { case PaletteBackStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Disabled: return SystemColors.Control; case PaletteState.Normal: return Color.Empty; case PaletteState.Tracking: return ColorTable.MenuItemSelectedGradientBegin; } break; case PaletteBackStyle.HeaderDockInactive: if (state == PaletteState.Disabled) return SystemColors.Control; else return ColorTable.ButtonCheckedHighlight; case PaletteBackStyle.HeaderDockActive: if (state == PaletteState.Disabled) return SystemColors.Control; else return SystemColors.Highlight; } } return base.GetBackColor1(style, state); }
/// <summary> /// Initialize a new instance of the KryptonPaletteForm class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="backStyle">Background style.</param> /// <param name="borderStyle">Border style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPaletteForm(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, NeedPaintHandler needPaint) : base(redirect, backStyle, borderStyle, needPaint) { }
/// <summary> /// Initialize a new instance of the PaletteTripleJustImageRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> public PaletteTripleJustImageRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle) : this(redirect, backStyle, borderStyle, contentStyle, null) { }
/// <summary> /// Gets the second back color. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) { IPaletteTriple inherit = GetInherit(state); if (inherit != null) return inherit.PaletteBack.GetBackColor2(state); else return base.GetBackColor2(style, state); }
/// <summary> /// Initialize a new instance of the PaletteTreeNodeTripleRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteTreeNodeTripleRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); _nodeRedirect = new PaletteTripleRedirect(redirect, backStyle, borderStyle, contentStyle, needPaint); }
/// <summary> /// Gets the second back color. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) { IPaletteBack inherit = GetInheritBack(style, state); if (inherit != null) return inherit.GetBackColor2(state); else return Target.GetBackColor2(style, state); }
/// <summary> /// Initialize a new instance of the DataGridViewStyles class. /// </summary> /// <param name="dataGridView">Reference to owning control.</param> public DataGridViewStyles(KryptonDataGridView dataGridView) { Debug.Assert(dataGridView != null); _dataGridView = dataGridView; _gridStyle = DataGridViewStyle.List; _columnStyle = GridStyle.List; _rowStyle = GridStyle.List; _dataCellStyle = GridStyle.List; _backgroundStyle = PaletteBackStyle.GridBackgroundList; }
/// <summary> /// Initialize a new instance of the PaletteTripleToPalette class. /// </summary> /// <param name="palette">Inheritence of values.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> public PaletteTripleToPalette(IPalette palette, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle) { // Store the inherit instances _back = new PaletteBackToPalette(palette, backStyle); _border = new PaletteBorderToPalette(palette, borderStyle); _content = new PaletteContentToPalette(palette, contentStyle); }
/// <summary> /// Initialize a new instance of KryptonPaletteDouble3 KryptonPaletteControl class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="backStyle">Background style.</param> /// <param name="borderStyle">Border style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPaletteDouble3(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateCommon = new PaletteDoubleRedirect(redirect, backStyle, borderStyle, needPaint); _stateDisabled = new PaletteDouble(_stateCommon, needPaint); _stateNormal = new PaletteDouble(_stateCommon, needPaint); }
/// <summary> /// Initialize a new instance of the KryptonPalettePanel class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="backStyle">Back style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPalettePanel(PaletteRedirect redirect, PaletteBackStyle backStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateInherit = new PaletteBackInheritRedirect(redirect, backStyle); _stateCommon = new PaletteBack(_stateInherit, needPaint); _stateDisabled = new PaletteBack(_stateCommon, needPaint); _stateNormal = new PaletteBack(_stateCommon, needPaint); }
/// <summary> /// Initialize a new instance of the KryptonPaletteHeader class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="backStyle">Background style.</param> /// <param name="borderStyle">Border style.</param> /// <param name="contentStyle">Content style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPaletteHeader(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateCommon = new PaletteHeaderRedirect(redirect, backStyle, borderStyle, contentStyle, needPaint); _stateDisabled = new PaletteTripleMetric(_stateCommon, needPaint); _stateNormal = new PaletteTripleMetric(_stateCommon, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteSplitContainerRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backContainerStyle">Initial split container background style.</param> /// <param name="borderContainerStyle">Initial split container border style.</param> /// <param name="backSeparatorStyle">Initial separator background style.</param> /// <param name="borderSeparatorStyle">Initial separator border style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteSplitContainerRedirect(PaletteRedirect redirect, PaletteBackStyle backContainerStyle, PaletteBorderStyle borderContainerStyle, PaletteBackStyle backSeparatorStyle, PaletteBorderStyle borderSeparatorStyle, NeedPaintHandler needPaint) : base(redirect, backContainerStyle, borderContainerStyle, needPaint) { // Create the embedded separator palette information _separator = new PaletteSeparatorPaddingRedirect(redirect, backSeparatorStyle, borderSeparatorStyle, needPaint); }
/// <summary> /// Initialize a new instance of the KryptonPaletteSeparator class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="backStyle">Background style.</param> /// <param name="borderStyle">Border style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPaletteSeparator(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateCommon = new PaletteSeparatorPaddingRedirect(redirect, backStyle, borderStyle, needPaint); _stateDisabled = new PaletteSeparatorPadding(_stateCommon, _stateCommon, needPaint); _stateNormal = new PaletteSeparatorPadding(_stateCommon, _stateCommon, needPaint); _stateTracking = new PaletteSeparatorPadding(_stateCommon, _stateCommon, needPaint); _statePressed = new PaletteSeparatorPadding(_stateCommon, _stateCommon, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteDoubleMetricRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Style for the background.</param> /// <param name="borderStyle">Style for the border.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteDoubleMetricRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, NeedPaintHandler needPaint) : base(redirect, backStyle, borderStyle, needPaint) { // Remember the redirect reference _redirect = redirect; }
/// <summary> /// Initialize a new instance of the PaletteSeparatorPaddingRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteSeparatorPaddingRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, NeedPaintHandler needPaint) : base(redirect, backStyle, borderStyle, needPaint) { Debug.Assert(redirect != null); // Remember the redirect reference _redirect = redirect; // Set default value for padding property _separatorPadding = CommonHelper.InheritPadding; }
/// <summary> /// Initialize a new instance of the NavigatorGroup class. /// </summary> /// <param name="navigator">Reference to owning navigator instance.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public NavigatorGroup(KryptonNavigator navigator, NeedPaintHandler needPaint) { Debug.Assert(navigator != null); // Remember back reference _navigator = navigator; // Store the provided paint notification delegate NeedPaint = needPaint; // Default values _groupBackStyle = PaletteBackStyle.ControlClient; _groupBorderStyle = PaletteBorderStyle.ControlClient; }
/// <summary> /// Initialize a new instance of the KryptonPaletteTabButton class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="backStyle">Background style.</param> /// <param name="borderStyle">Border style.</param> /// <param name="contentStyle">Content style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPaletteTabButton(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateFocus = new PaletteTabTripleRedirect(redirect, backStyle, borderStyle, contentStyle, needPaint); _stateCommon = new PaletteTabTripleRedirect(redirect, backStyle, borderStyle, contentStyle, needPaint); _stateDisabled = new PaletteTabTriple(_stateCommon, needPaint); _stateNormal = new PaletteTabTriple(_stateCommon, needPaint); _stateTracking = new PaletteTabTriple(_stateCommon, needPaint); _statePressed = new PaletteTabTriple(_stateCommon, needPaint); _stateSelected = new PaletteTabTriple(_stateCommon, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteHeaderButtonRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteHeaderButtonRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) : base(redirect, backStyle, borderStyle, contentStyle, needPaint) { Debug.Assert(redirect != null); // Remember the redirect reference _redirect = redirect; // Set default value for padding property _buttonPadding = CommonHelper.InheritPadding; _buttonEdgeInset = -1; }
/// <summary> /// Initialize a new instance of the PaletteTripleMetricRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Style for the background.</param> /// <param name="borderStyle">Style for the border.</param> /// <param name="contentStyle">Style for the content.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteTripleMetricRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) : base(redirect, backStyle, borderStyle, contentStyle, needPaint) { Debug.Assert(redirect != null); // Remember the redirect reference _redirect = redirect; }
/// <summary> /// Initialize a new instance of the PaletteListStateRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteListStateRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, NeedPaintHandler needPaint) : base(redirect, backStyle, borderStyle, needPaint) { Debug.Assert(redirect != null); // Remember the redirect reference _redirect = redirect; // Create the item redirector _itemRedirect = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonListItem, PaletteBorderStyle.ButtonListItem, PaletteContentStyle.ButtonListItem, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteTripleJustImageRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteTripleJustImageRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) { // Store the provided paint notification delegate NeedPaint = needPaint; // Store the inherit instances _backInherit = new PaletteBackInheritRedirect(redirect, backStyle); _borderInherit = new PaletteBorderInheritRedirect(redirect, borderStyle); _contentInherit = new PaletteContentInheritRedirect(redirect, contentStyle); // Create storage that maps onto the inherit instances _back = new PaletteBack(_backInherit, needPaint); _border = new PaletteBorder(_borderInherit, needPaint); _content = new PaletteContentJustImage(_contentInherit, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteDataGridViewTripleRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteDataGridViewTripleRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Store the inherit instances _backInherit = new PaletteBackInheritRedirect(redirect, backStyle); _borderInherit = new PaletteBorderInheritRedirect(redirect, borderStyle); _contentInherit = new PaletteContentInheritRedirect(redirect, contentStyle); // Create storage that maps onto the inherit instances _back = new PaletteBack(_backInherit, needPaint); _border = new PaletteBorder(_borderInherit, needPaint); _content = new PaletteDataGridViewContentCommon(_contentInherit, needPaint); }
/// <summary> /// Initialize a new instance of the VisualPopupTooltip class. /// </summary> /// <param name="redirector">Redirector for recovering palette values.</param> /// <param name="contentValues">Source of content values.</param> /// <param name="renderer">Drawing renderer.</param> /// <param name="backStyle">Style for the tooltip background.</param> /// <param name="borderStyle">Style for the tooltip border.</param> /// <param name="contentStyle">Style for the tooltip content.</param> public VisualPopupToolTip(PaletteRedirect redirector, IContentValues contentValues, IRenderer renderer, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle) : base(renderer, true) { Debug.Assert(contentValues != null); // Remember references needed later _contentValues = contentValues; // Create the triple redirector needed by view elements _palette = new PaletteTripleMetricRedirect(redirector, backStyle, borderStyle, contentStyle, NeedPaintDelegate); // Our view contains background and border with content inside _drawDocker = new ViewDrawDocker(_palette.Back, _palette.Border, null); _drawContent = new ViewDrawContent(_palette.Content, _contentValues, VisualOrientation.Top); _drawDocker.Add(_drawContent, ViewDockStyle.Fill); // Create the view manager instance ViewManager = new ViewManager(this, _drawDocker); }
/// <summary> /// Gets the color background drawing style. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color drawing style.</returns> public override PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state) { IPaletteDouble inherit = GetInherit(state); return(inherit != null?inherit.PaletteBack.GetBackColorStyle(state) : Target.GetBackColorStyle(style, state)); }
private void ResetGroupBackStyle() { GroupBackStyle = PaletteBackStyle.ControlGroupBox; }
/// <summary> /// Gets the color alignment. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color alignment style.</returns> public override PaletteRectangleAlign GetBackColorAlign(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) return PaletteRectangleAlign.Inherit; switch (style) { case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ControlRibbonAppMenu: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: return PaletteRectangleAlign.Control; case PaletteBackStyle.ControlToolTip: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderDockActive: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderForm: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonGallery: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowSheet: case PaletteBackStyle.GridHeaderRowCustom1: case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellSheet: case PaletteBackStyle.GridDataCellCustom1: case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: case PaletteBackStyle.ContextMenuItemImageColumn: return PaletteRectangleAlign.Local; default: throw new ArgumentOutOfRangeException("style"); } }
/// <summary> /// Gets a value indicating if background should be drawn. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) return InheritBool.Inherit; switch (style) { case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorCustom1: return InheritBool.False; case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return InheritBool.False; default: return InheritBool.True; } case PaletteBackStyle.ContextMenuItemImage: case PaletteBackStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return InheritBool.False; default: return InheritBool.True; } case PaletteBackStyle.ButtonInputControl: if ((state == PaletteState.Disabled) || (state == PaletteState.Normal)) return InheritBool.False; else return InheritBool.True; default: // Default to drawing the background return InheritBool.True; } }
private void ResetContainerBackStyle() { ContainerBackStyle = PaletteBackStyle.PanelClient; }
/// <summary> /// Initialize a new instance of the PaletteTripleJustImageRedirect class. /// </summary> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> public PaletteTripleJustImageRedirect(PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle) : this(null, backStyle, borderStyle, contentStyle, null) { }
/// <summary> /// Gets a background image. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image instance.</returns> public override Image GetBackImage(PaletteBackStyle style, PaletteState state) { IPaletteTriple inherit = GetInherit(state); return(inherit != null?inherit.PaletteBack.GetBackImage(state) : Target.GetBackImage(style, state)); }
/// <summary> /// Gets the image alignment. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image alignment style.</returns> public override PaletteRectangleAlign GetBackImageAlign(PaletteBackStyle style, PaletteState state) { IPaletteTriple inherit = GetInherit(state); return(inherit != null?inherit.PaletteBack.GetBackImageAlign(state) : Target.GetBackImageAlign(style, state)); }
/// <summary> /// Gets the second back color. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) { // Only override system palette if a recognized office 2003 color scheme is used if (_usingOffice2003) { switch (style) { case PaletteBackStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Disabled: return(SystemColors.Control); case PaletteState.Normal: return(Color.Empty); case PaletteState.Tracking: return(ColorTable.MenuItemSelectedGradientBegin); } break; case PaletteBackStyle.HeaderDockInactive: if (state == PaletteState.Disabled) { return(SystemColors.Control); } else { return(ColorTable.ButtonCheckedHighlight); } case PaletteBackStyle.HeaderDockActive: if (state == PaletteState.Disabled) { return(SystemColors.Control); } else { return(SystemColors.Highlight); } case PaletteBackStyle.TabDock: switch (state) { case PaletteState.Disabled: return(SystemColors.Control); case PaletteState.Normal: return(MergeColors(SystemColors.Window, 0.1f, ColorTable.ButtonCheckedHighlight, 0.9f)); case PaletteState.Pressed: case PaletteState.Tracking: return(MergeColors(SystemColors.Window, 0.4f, ColorTable.ButtonCheckedGradientMiddle, 0.6f)); case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return(SystemColors.Window); } break; } } return(base.GetBackColor2(style, state)); }
/// <summary> /// Gets the image alignment. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image alignment style.</returns> public override PaletteRectangleAlign GetBackImageAlign(PaletteBackStyle style, PaletteState state) { IPaletteBack inherit = GetInherit(state); return(inherit?.GetBackImageAlign(state) ?? Target.GetBackImageAlign(style, state)); }
/// <summary> /// Gets the background image style. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Image style value.</returns> public override PaletteImageStyle GetBackImageStyle(PaletteBackStyle style, PaletteState state) { IPaletteBack inherit = GetInherit(state); return(inherit?.GetBackImageStyle(state) ?? Target.GetBackImageStyle(style, state)); }
/// <summary> /// Gets the color background angle. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Angle used for color drawing.</returns> public override float GetBackColorAngle(PaletteBackStyle style, PaletteState state) { IPaletteBack inherit = GetInherit(state); return(inherit?.GetBackColorAngle(state) ?? Target.GetBackColorAngle(style, state)); }
/// <summary> /// Gets the graphics drawing hint for the background. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteGraphicsHint value.</returns> public override PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteState state) { IPaletteBack inherit = GetInherit(state); return(inherit?.GetBackGraphicsHint(state) ?? Target.GetBackGraphicsHint(style, state)); }
/// <summary> /// Initialize a new instance of the PaletteBackInheritRedirect class. /// </summary> /// <param name="redirect">Source for inherit requests.</param> /// <param name="style">Style used in requests.</param> public PaletteBackInheritRedirect(PaletteRedirect redirect, PaletteBackStyle style) { _redirect = redirect; Style = style; }
/// <summary> /// Update the combo box drop background style. /// </summary> /// <param name="style">New drop background style.</param> public void SetStyles(PaletteBackStyle style) => _dropBackRedirect.SetStyles(style, PaletteBorderStyle.ButtonStandalone);
// Style Redirection #endregion #region Identity /// <summary> /// Initialize a new instance of the PaletteDoubleRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="panelBackStyle">Initial background style.</param> /// <param name="needPaint">Paint delegate.</param> public PaletteRibbonRedirect(PaletteRedirect redirect, PaletteBackStyle panelBackStyle, NeedPaintHandler needPaint) : base(redirect) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Create the style redirection instances RibbonGroupButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint); RibbonGroupClusterButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint); RibbonGroupCollapsedButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint); RibbonGroupDialogButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint); RibbonKeyTip = new PaletteTripleRedirect(redirect, PaletteBackStyle.ControlToolTip, PaletteBorderStyle.ControlToolTip, PaletteContentStyle.LabelKeyTip, needPaint); RibbonQATButton = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonButtonSpec, PaletteBorderStyle.ButtonButtonSpec, PaletteContentStyle.ButtonButtonSpec, needPaint); RibbonScroller = new PaletteTripleRedirect(redirect, PaletteBackStyle.ButtonStandalone, PaletteBorderStyle.ButtonStandalone, PaletteContentStyle.ButtonStandalone, needPaint); // Create the redirection instances _ribbonAppButtonInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppButton); _ribbonAppMenuInnerInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuInner); _ribbonAppMenuOuterInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuOuter); _ribbonAppMenuDocsInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonAppMenuDocs); _ribbonAppMenuDocsTitleInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonAppMenuDocsTitle); _ribbonAppMenuDocsEntryInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonAppMenuDocsEntry); _ribbonGeneralInherit = new PaletteRibbonGeneralInheritRedirect(redirect); _ribbonGroupAreaInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupArea); _ribbonGroupButtonTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupButtonText); _ribbonGroupCheckBoxTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupCheckBoxText); _ribbonGroupCollapsedBackInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedBack); _ribbonGroupCollapsedBorderInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedBorder); _ribbonGroupCollapsedFrameBackInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBack); _ribbonGroupCollapsedFrameBorderInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupCollapsedFrameBorder); _ribbonGroupCollapsedTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupCollapsedText); _ribbonGroupNormalBorderInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupNormalBorder); _ribbonGroupNormalTitleInherit = new PaletteRibbonDoubleInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonGroupNormalTitle, PaletteRibbonTextStyle.RibbonGroupNormalTitle); _ribbonGroupRadioButtonTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupRadioButtonText); _ribbonGroupLabelTextInherit = new PaletteRibbonTextInheritRedirect(redirect, PaletteRibbonTextStyle.RibbonGroupLabelText); _ribbonTabInherit = new PaletteRibbonDoubleInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonTab, PaletteRibbonTextStyle.RibbonTab); _ribbonQATFullbarInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATFullbar); _ribbonQATMinibarInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATMinibar); _ribbonQATOverflowInherit = new PaletteRibbonBackInheritRedirect(redirect, PaletteRibbonBackStyle.RibbonQATOverflow); // Create storage that maps onto the inherit instances _ribbonAppButton = new PaletteRibbonBack(_ribbonAppButtonInherit, needPaint); _ribbonAppMenuInner = new PaletteRibbonBack(_ribbonAppMenuInnerInherit, needPaint); _ribbonAppMenuOuter = new PaletteRibbonBack(_ribbonAppMenuOuterInherit, needPaint); _ribbonAppMenuDocs = new PaletteRibbonBack(_ribbonAppMenuDocsInherit, needPaint); _ribbonAppMenuDocsTitle = new PaletteRibbonText(_ribbonAppMenuDocsTitleInherit, needPaint); _ribbonAppMenuDocsEntry = new PaletteRibbonText(_ribbonAppMenuDocsEntryInherit, needPaint); _ribbonGeneral = new PaletteRibbonGeneral(_ribbonGeneralInherit, needPaint); _ribbonGroupArea = new PaletteRibbonBack(_ribbonGroupAreaInherit, needPaint); _ribbonGroupButtonText = new PaletteRibbonText(_ribbonGroupButtonTextInherit, needPaint); _ribbonGroupCheckBoxText = new PaletteRibbonText(_ribbonGroupCheckBoxTextInherit, needPaint); _ribbonGroupCollapsedBack = new PaletteRibbonBack(_ribbonGroupCollapsedBackInherit, needPaint); _ribbonGroupCollapsedBorder = new PaletteRibbonBack(_ribbonGroupCollapsedBorderInherit, needPaint); _ribbonGroupCollapsedFrameBack = new PaletteRibbonBack(_ribbonGroupCollapsedFrameBackInherit, needPaint); _ribbonGroupCollapsedFrameBorder = new PaletteRibbonBack(_ribbonGroupCollapsedFrameBorderInherit, needPaint); _ribbonGroupCollapsedText = new PaletteRibbonText(_ribbonGroupCollapsedTextInherit, needPaint); _ribbonGroupNormalBorder = new PaletteRibbonBack(_ribbonGroupNormalBorderInherit, needPaint); _ribbonGroupNormalTitle = new PaletteRibbonDouble(_ribbonGroupNormalTitleInherit, _ribbonGroupNormalTitleInherit, needPaint); _ribbonGroupRadioButtonText = new PaletteRibbonText(_ribbonGroupRadioButtonTextInherit, needPaint); _ribbonGroupLabelText = new PaletteRibbonText(_ribbonGroupLabelTextInherit, needPaint); _ribbonTab = new PaletteRibbonDouble(_ribbonTabInherit, _ribbonTabInherit, needPaint); _ribbonQATFullbar = new PaletteRibbonBack(_ribbonQATFullbarInherit, needPaint); _ribbonQATMinibarActive = new PaletteRibbonBack(_ribbonQATMinibarInherit, needPaint); _ribbonQATMinibarInactive = new PaletteRibbonBack(_ribbonQATMinibarInherit, needPaint); _ribbonQATOverflow = new PaletteRibbonBack(_ribbonQATOverflowInherit, needPaint); _ribbonImages = new PaletteRibbonImages(redirect, NeedPaintDelegate); }
/// <summary> /// Initialize a new instance of the PaletteBack class. /// </summary> /// <param name="palette">Source for getting all values.</param> /// <param name="style">Style of values required.</param> public PaletteBackToPalette(IPalette palette, PaletteBackStyle style) { // Remember source palette _palette = palette; _style = style; }
/// <summary> /// Gets the color background drawing style. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color drawing style.</returns> public override PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state) { switch (style) { case PaletteBackStyle.HeaderForm: return PaletteColorStyle.Rounding2; default: return base.GetBackColorStyle(style, state); } }
/// <summary> /// Gets the color background angle. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Angle used for color drawing.</returns> public override float GetBackColorAngle(PaletteBackStyle style, PaletteState state) { IPaletteTriple inherit = GetInherit(state); return(inherit != null?inherit.PaletteBack.GetBackColorAngle(state) : Target.GetBackColorAngle(style, state)); }
/// <summary> /// Gets the color background drawing style. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color drawing style.</returns> public override PaletteColorStyle GetBackColorStyle(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideState(state)) return PaletteColorStyle.Inherit; switch (style) { case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnCustom1: return PaletteColorStyle.RoundedTopLeftWhite; case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowCustom1: if (state == PaletteState.CheckedNormal) return PaletteColorStyle.Linear; else return PaletteColorStyle.RoundedTopLeftWhite; case PaletteBackStyle.GridHeaderColumnSheet: case PaletteBackStyle.GridHeaderRowSheet: return PaletteColorStyle.Linear; case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellCustom1: return PaletteColorStyle.Solid; case PaletteBackStyle.GridDataCellSheet: return PaletteColorStyle.GlassCheckedSimple; case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: switch (state) { case PaletteState.Tracking: case PaletteState.Pressed: case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: return PaletteColorStyle.GlassFade; default: return PaletteColorStyle.QuarterPhase; } case PaletteBackStyle.TabStandardProfile: switch (state) { case PaletteState.CheckedNormal: case PaletteState.CheckedTracking: case PaletteState.CheckedPressed: return PaletteColorStyle.Solid; case PaletteState.Tracking: case PaletteState.Pressed: return PaletteColorStyle.GlassFade; default: return PaletteColorStyle.QuarterPhase; } case PaletteBackStyle.TabLowProfile: return PaletteColorStyle.Solid; case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabDock: case PaletteBackStyle.TabDockAutoHidden: return PaletteColorStyle.OneNote; case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelAlternate: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.ControlRibbon: case PaletteBackStyle.ContextMenuOuter: case PaletteBackStyle.ContextMenuInner: case PaletteBackStyle.ControlCustom1: case PaletteBackStyle.ContextMenuHeading: case PaletteBackStyle.ContextMenuItemImageColumn: case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: case PaletteBackStyle.HeaderCalendar: case PaletteBackStyle.ButtonCalendarDay: return PaletteColorStyle.Solid; case PaletteBackStyle.ControlRibbonAppMenu: return PaletteColorStyle.Switch90; case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: if (state == PaletteState.Tracking) return PaletteColorStyle.GlassTrackingFull; else return PaletteColorStyle.Solid; case PaletteBackStyle.ControlToolTip: return PaletteColorStyle.Linear; case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: return PaletteColorStyle.SolidInside; case PaletteBackStyle.SeparatorHighInternalProfile: case PaletteBackStyle.SeparatorHighProfile: return PaletteColorStyle.RoundedTopLight; case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderSecondary: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: return PaletteColorStyle.RoundedTopLeftWhite; case PaletteBackStyle.HeaderDockActive: return PaletteColorStyle.Rounded; case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: case PaletteState.CheckedNormal: return PaletteColorStyle.GlassNormalFull; case PaletteState.Tracking: case PaletteState.CheckedTracking: return PaletteColorStyle.GlassCenter; case PaletteState.Pressed: case PaletteState.CheckedPressed: return PaletteColorStyle.GlassBottom; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.ButtonGallery: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: case PaletteState.NormalDefaultOverride: case PaletteState.CheckedNormal: return PaletteColorStyle.GlassSimpleFull; case PaletteState.Tracking: case PaletteState.CheckedTracking: return PaletteColorStyle.GlassTrackingFull; case PaletteState.Pressed: case PaletteState.CheckedPressed: return PaletteColorStyle.GlassPressedFull; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.ButtonAlternate: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: return PaletteColorStyle.GlassNormalStump; case PaletteState.Tracking: return PaletteColorStyle.GlassTrackingStump; case PaletteState.Pressed: case PaletteState.CheckedPressed: return PaletteColorStyle.GlassPressedStump; case PaletteState.CheckedNormal: return PaletteColorStyle.GlassCheckedStump; case PaletteState.CheckedTracking: return PaletteColorStyle.GlassCheckedTrackingStump; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: if (style == PaletteBackStyle.ButtonCluster) return PaletteColorStyle.GlassThreeEdge; else return PaletteColorStyle.GlassNormalFull; case PaletteState.Tracking: return PaletteColorStyle.GlassTrackingFull; case PaletteState.Pressed: case PaletteState.CheckedPressed: return PaletteColorStyle.GlassPressedFull; case PaletteState.CheckedNormal: return PaletteColorStyle.GlassCheckedFull; case PaletteState.CheckedTracking: return PaletteColorStyle.GlassCheckedTrackingFull; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.ContextMenuItemImage: return PaletteColorStyle.Solid; case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonInputControl: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: return PaletteColorStyle.GlassNormalSimple; case PaletteState.Tracking: return PaletteColorStyle.GlassTrackingSimple; case PaletteState.Pressed: case PaletteState.CheckedPressed: return PaletteColorStyle.GlassPressedSimple; case PaletteState.CheckedNormal: return PaletteColorStyle.GlassCheckedSimple; case PaletteState.CheckedTracking: return PaletteColorStyle.GlassCheckedTrackingSimple; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.ButtonNavigatorMini: switch (state) { case PaletteState.Normal: return PaletteColorStyle.RoundedTopLeftWhite; default: return PaletteColorStyle.Solid; } default: throw new ArgumentOutOfRangeException("style"); } }
/// <summary> /// Gets a value indicating if background should be drawn. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) { IPaletteDouble inherit = GetInherit(state); return(inherit != null?inherit.PaletteBack.GetBackDraw(state) : Target.GetBackDraw(style, state)); }
/// <summary> /// Gets the second back color. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) { // We do not provide override values if (CommonHelper.IsOverrideStateExclude(state, PaletteState.NormalDefaultOverride)) return Color.Empty; switch (style) { case PaletteBackStyle.GridHeaderColumnList: case PaletteBackStyle.GridHeaderColumnCustom1: case PaletteBackStyle.GridHeaderRowList: case PaletteBackStyle.GridHeaderRowCustom1: switch (state) { case PaletteState.Disabled: return _disabledBack; default: case PaletteState.Normal: case PaletteState.Tracking: return _ribbonColors[(int)SchemeOfficeColors.GridListNormal2]; case PaletteState.Pressed: return _ribbonColors[(int)SchemeOfficeColors.GridListPressed2]; case PaletteState.CheckedNormal: return _ribbonColors[(int)SchemeOfficeColors.GridListSelected]; } case PaletteBackStyle.GridHeaderColumnSheet: switch (state) { case PaletteState.Disabled: return _disabledBack; default: case PaletteState.Normal: return _ribbonColors[(int)SchemeOfficeColors.GridSheetColNormal2]; case PaletteState.Tracking: case PaletteState.Pressed: return _ribbonColors[(int)SchemeOfficeColors.GridSheetColPressed2]; case PaletteState.CheckedNormal: return _ribbonColors[(int)SchemeOfficeColors.GridSheetColSelected2]; } case PaletteBackStyle.GridHeaderRowSheet: switch (state) { case PaletteState.Disabled: return _disabledBack; default: case PaletteState.Normal: return _ribbonColors[(int)SchemeOfficeColors.GridSheetRowNormal]; case PaletteState.Tracking: case PaletteState.Pressed: return _ribbonColors[(int)SchemeOfficeColors.GridSheetRowPressed]; case PaletteState.CheckedNormal: return _ribbonColors[(int)SchemeOfficeColors.GridSheetRowSelected]; } case PaletteBackStyle.GridDataCellList: case PaletteBackStyle.GridDataCellCustom1: if (state == PaletteState.CheckedNormal) return _ribbonColors[(int)SchemeOfficeColors.GridDataCellSelected]; else return SystemColors.Window; case PaletteBackStyle.GridDataCellSheet: if (state == PaletteState.CheckedNormal) return _buttonBackColors[7]; else return SystemColors.Window; case PaletteBackStyle.TabHighProfile: case PaletteBackStyle.TabStandardProfile: case PaletteBackStyle.TabLowProfile: case PaletteBackStyle.TabOneNote: case PaletteBackStyle.TabCustom1: case PaletteBackStyle.TabCustom2: case PaletteBackStyle.TabCustom3: switch (state) { case PaletteState.Disabled: if (style == PaletteBackStyle.TabLowProfile) return Color.Empty; else return _disabledBack; case PaletteState.Normal: if (style == PaletteBackStyle.TabLowProfile) return Color.Empty; else return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalBack2]; case PaletteState.Tracking: case PaletteState.Pressed: if (style == PaletteBackStyle.TabLowProfile) return Color.Empty; else return SystemColors.Window; case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return SystemColors.Window; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.TabDock: switch (state) { case PaletteState.Disabled: return _disabledBack; case PaletteState.Normal: return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalBack2]; case PaletteState.Tracking: case PaletteState.Pressed: return _buttonBackColors[3]; case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: return SystemColors.Window; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.TabDockAutoHidden: switch (state) { case PaletteState.Disabled: return _disabledBack; case PaletteState.Normal: case PaletteState.CheckedNormal: return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalBack2]; case PaletteState.Tracking: case PaletteState.CheckedTracking: case PaletteState.Pressed: case PaletteState.CheckedPressed: return _buttonBackColors[3]; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.HeaderForm: if (state == PaletteState.Disabled) return _ribbonColors[(int)SchemeOfficeColors.FormBorderHeaderInactive2]; else return _ribbonColors[(int)SchemeOfficeColors.FormBorderHeaderActive2]; case PaletteBackStyle.HeaderCalendar: if (state == PaletteState.Disabled) return _ribbonColors[(int)SchemeOfficeColors.HeaderPrimaryBack1]; else return _ribbonColors[(int)SchemeOfficeColors.HeaderPrimaryBack2]; case PaletteBackStyle.HeaderPrimary: case PaletteBackStyle.HeaderDockInactive: case PaletteBackStyle.HeaderCustom1: case PaletteBackStyle.HeaderCustom2: if (state == PaletteState.Disabled) return _disabledBack; else return _ribbonColors[(int)SchemeOfficeColors.HeaderPrimaryBack2]; case PaletteBackStyle.HeaderDockActive: if (state == PaletteState.Disabled) return _disabledBack; else return _buttonBackColors[7]; case PaletteBackStyle.HeaderSecondary: if (state == PaletteState.Disabled) return _disabledBack; else return _ribbonColors[(int)SchemeOfficeColors.HeaderSecondaryBack2]; case PaletteBackStyle.SeparatorHighInternalProfile: if (state == PaletteState.Disabled) return _disabledBack; else return _ribbonColors[(int)SchemeOfficeColors.SeparatorHighInternalBorder2]; case PaletteBackStyle.SeparatorHighProfile: if (state == PaletteState.Disabled) return _disabledBack; else return _ribbonColors[(int)SchemeOfficeColors.SeparatorHighBorder2]; case PaletteBackStyle.SeparatorLowProfile: case PaletteBackStyle.SeparatorCustom1: case PaletteBackStyle.PanelClient: case PaletteBackStyle.PanelRibbonInactive: case PaletteBackStyle.PanelCustom1: case PaletteBackStyle.ControlGroupBox: case PaletteBackStyle.GridBackgroundList: case PaletteBackStyle.GridBackgroundSheet: case PaletteBackStyle.GridBackgroundCustom1: return _ribbonColors[(int)SchemeOfficeColors.PanelClient]; case PaletteBackStyle.PanelAlternate: return _ribbonColors[(int)SchemeOfficeColors.PanelAlternative]; case PaletteBackStyle.FormMain: case PaletteBackStyle.FormCustom1: if (state == PaletteState.Disabled) return _ribbonColors[(int)SchemeOfficeColors.FormBorderInactiveDark]; else return _ribbonColors[(int)SchemeOfficeColors.FormBorderActiveDark]; case PaletteBackStyle.ControlClient: case PaletteBackStyle.ControlAlternate: case PaletteBackStyle.ControlCustom1: return SystemColors.Window; case PaletteBackStyle.InputControlStandalone: case PaletteBackStyle.InputControlRibbon: case PaletteBackStyle.InputControlCustom1: if (state == PaletteState.Disabled) return _ribbonColors[(int)SchemeOfficeColors.InputControlBackDisabled]; else { if ((state == PaletteState.Tracking) || (style == PaletteBackStyle.InputControlStandalone)) return _ribbonColors[(int)SchemeOfficeColors.InputControlBackNormal]; else return _ribbonColors[(int)SchemeOfficeColors.InputControlBackInactive]; } case PaletteBackStyle.ControlRibbon: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSelected4]; case PaletteBackStyle.ControlRibbonAppMenu: return _ribbonColors[(int)SchemeOfficeColors.AppButtonBack2]; case PaletteBackStyle.ControlToolTip: return _toolTipBack2; case PaletteBackStyle.ContextMenuOuter: return _contextMenuOuterBack; case PaletteBackStyle.ContextMenuSeparator: case PaletteBackStyle.ContextMenuItemSplit: switch (state) { case PaletteState.Tracking: return _buttonBackColors[3]; default: return _contextMenuOuterBack; } case PaletteBackStyle.ContextMenuInner: return _contextMenuInnerBack; case PaletteBackStyle.ContextMenuHeading: return _ribbonColors[(int)SchemeOfficeColors.ContextMenuHeadingBack]; case PaletteBackStyle.ContextMenuItemImageColumn: return _ribbonColors[(int)SchemeOfficeColors.ContextMenuImageColumn]; case PaletteBackStyle.ContextMenuItemImage: return _contextMenuImageBackChecked; case PaletteBackStyle.ButtonGallery: switch (state) { case PaletteState.Disabled: return _disabledBack2; case PaletteState.Normal: case PaletteState.NormalDefaultOverride: case PaletteState.CheckedNormal: return _ribbonColors[(int)SchemeOfficeColors.RibbonGalleryBack2]; case PaletteState.Tracking: case PaletteState.CheckedTracking: return _buttonBackColors[2]; case PaletteState.Pressed: case PaletteState.CheckedPressed: return _buttonBackColors[4]; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.ButtonForm: case PaletteBackStyle.ButtonFormClose: switch (state) { case PaletteState.Disabled: case PaletteState.Normal: case PaletteState.NormalDefaultOverride: return Color.Empty; case PaletteState.CheckedNormal: return _ribbonColors[(int)SchemeOfficeColors.FormButtonBack2Checked]; case PaletteState.Tracking: return _ribbonColors[(int)SchemeOfficeColors.FormButtonBack2Track]; case PaletteState.CheckedTracking: return _ribbonColors[(int)SchemeOfficeColors.FormButtonBack2CheckTrack]; case PaletteState.Pressed: case PaletteState.CheckedPressed: return _ribbonColors[(int)SchemeOfficeColors.FormButtonBack2Pressed]; default: throw new ArgumentOutOfRangeException("state"); } case PaletteBackStyle.ButtonStandalone: case PaletteBackStyle.ButtonAlternate: case PaletteBackStyle.ButtonLowProfile: case PaletteBackStyle.ButtonBreadCrumb: case PaletteBackStyle.ButtonListItem: case PaletteBackStyle.ButtonCommand: case PaletteBackStyle.ButtonButtonSpec: case PaletteBackStyle.ButtonCalendarDay: case PaletteBackStyle.ButtonCluster: case PaletteBackStyle.ButtonNavigatorStack: case PaletteBackStyle.ButtonNavigatorOverflow: case PaletteBackStyle.ButtonNavigatorMini: case PaletteBackStyle.ButtonCustom1: case PaletteBackStyle.ButtonCustom2: case PaletteBackStyle.ButtonCustom3: case PaletteBackStyle.ButtonInputControl: case PaletteBackStyle.ContextMenuItemHighlight: switch (state) { case PaletteState.Disabled: return _buttonBackColors[1]; case PaletteState.Normal: if (style == PaletteBackStyle.ButtonNavigatorStack) return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalNavigatorBack2]; else if (style == PaletteBackStyle.ButtonNavigatorMini) return _ribbonColors[(int)SchemeOfficeColors.NavigatorMiniBackColor]; else if (style == PaletteBackStyle.ButtonCluster) return _ribbonColors[(int)SchemeOfficeColors.ButtonClusterButtonBack2]; else return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalBack2]; case PaletteState.NormalDefaultOverride: if ((style == PaletteBackStyle.ButtonLowProfile) || (style == PaletteBackStyle.ButtonBreadCrumb) || (style == PaletteBackStyle.ButtonListItem) || (style == PaletteBackStyle.ButtonCommand) || (style == PaletteBackStyle.ButtonButtonSpec) || (style == PaletteBackStyle.ContextMenuItemHighlight)) return Color.Empty; else return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalDefaultBack2]; case PaletteState.CheckedNormal: if (style == PaletteBackStyle.ButtonInputControl) return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalBack2]; else return _buttonBackColors[7]; case PaletteState.Tracking: return _buttonBackColors[3]; case PaletteState.Pressed: case PaletteState.CheckedPressed: if (style == PaletteBackStyle.ButtonAlternate) return _ribbonColors[(int)SchemeOfficeColors.AlternatePressedBack2]; else return _buttonBackColors[5]; case PaletteState.CheckedTracking: if (style == PaletteBackStyle.ButtonInputControl) return _ribbonColors[(int)SchemeOfficeColors.ButtonNormalBack1]; else return _buttonBackColors[9]; default: throw new ArgumentOutOfRangeException("state"); } default: throw new ArgumentOutOfRangeException("style"); } }
/// <summary> /// Gets the graphics drawing hint for the background. /// </summary> /// <param name="style">Border style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>PaletteGraphicsHint value.</returns> public override PaletteGraphicsHint GetBackGraphicsHint(PaletteBackStyle style, PaletteState state) { IPaletteTriple inherit = GetInherit(state); return(inherit != null?inherit.PaletteBack.GetBackGraphicsHint(state) : Target.GetBackGraphicsHint(style, state)); }
private void ResetStyleBackground() { StyleBackground = PaletteBackStyle.GridBackgroundList; }
private void ResetGroupBackStyle() { GroupBackStyle = PaletteBackStyle.ControlClient; }
/// <summary> /// Initialize a new instance of the PaletteTripleRedirect class. /// </summary> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> /// <param name="contentStyle">Initial content style.</param> public PaletteTripleRedirect(PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle) : this(null, backStyle, borderStyle, contentStyle, null) { }
private void ResetPanelBackStyle() { PanelBackStyle = PaletteBackStyle.PanelClient; }
/// <summary> /// Update each individual style. /// </summary> /// <param name="backStyle">New background style.</param> /// <param name="borderStyle">New border style.</param> /// <param name="contentStyle">New content style.</param> public void SetStyles(PaletteBackStyle backStyle, PaletteBorderStyle borderStyle, PaletteContentStyle contentStyle) { BackStyle = backStyle; BorderStyle = borderStyle; ContentStyle = contentStyle; }
/// <summary> /// Gets a value indicating if background should be drawn. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>InheritBool value.</returns> public override InheritBool GetBackDraw(PaletteBackStyle style, PaletteState state) { IPaletteBack inherit = GetInherit(state); return(inherit?.GetBackDraw(state) ?? Target.GetBackDraw(style, state)); }
/// <summary> /// Update the palette styles to the separator style. /// </summary> /// <param name="backStyle">New back style.</param> /// <param name="borderStyle">New border style.</param> public void SetStyles(PaletteBackStyle backStyle, PaletteBorderStyle borderStyle) { BackStyle = backStyle; BorderStyle = borderStyle; }
/// <summary> /// Initialize a new instance of the PaletteDoubleRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Initial background style.</param> /// <param name="borderStyle">Initial border style.</param> public PaletteDoubleRedirect(PaletteRedirect redirect, PaletteBackStyle backStyle, PaletteBorderStyle borderStyle) : this(redirect, backStyle, borderStyle, null) { }
/// <summary> /// Gets the second back color. /// </summary> /// <param name="style">Background style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetBackColor2(PaletteBackStyle style, PaletteState state) { IPaletteTriple inherit = GetInherit(state); return(inherit != null?inherit.PaletteBack.GetBackColor2(state) : base.GetBackColor2(style, state)); }
private void ResetControlBackStyle() { ControlBackStyle = PaletteBackStyle.PanelAlternate; }