/// <summary> /// Initialize a new instance of the PaletteRibbonTextInheritRedirect class. /// </summary> /// <param name="redirect">Source for inherit requests.</param> /// <param name="styleText">Ribbon item text style.</param> public PaletteRibbonTextInheritRedirect(PaletteRedirect redirect, PaletteRibbonTextStyle styleText) { Debug.Assert(redirect != null); _redirect = redirect; StyleText = styleText; }
/// <summary> /// Initialize a new instance of the PaletteRibbonTextInheritRedirect class. /// </summary> /// <param name="redirect">Source for inherit requests.</param> /// <param name="styleText">Ribbon item text style.</param> public PaletteRibbonTextInheritRedirect(PaletteRedirect redirect, PaletteRibbonTextStyle styleText) { Debug.Assert(redirect != null); _redirect = redirect; _styleText = styleText; }
/// <summary> /// Initialize a new instance of the KryptonPaletteRibbonGroupBaseText class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="textStyle">Inherit text style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPaletteRibbonGroupBaseText(PaletteRedirect redirect, PaletteRibbonTextStyle textStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateInherit = new PaletteRibbonTextInheritRedirect(redirect, textStyle); StateCommon = new PaletteRibbonText(_stateInherit, needPaint); StateNormal = new PaletteRibbonText(StateCommon, needPaint); StateDisabled = new PaletteRibbonText(StateCommon, needPaint); }
/// <summary> /// Initialize a new instance of the PaletteRibbonDoubleInheritRedirect class. /// </summary> /// <param name="redirect">Source for inherit requests.</param> /// <param name="styleBack">Ribbon item background style.</param> /// <param name="styleText">Ribbon item text style.</param> public PaletteRibbonDoubleInheritRedirect(PaletteRedirect redirect, PaletteRibbonBackStyle styleBack, PaletteRibbonTextStyle styleText) { Debug.Assert(redirect != null); _redirect = redirect; _styleBack = styleBack; _styleText = styleText; }
/// <summary> /// Initialize a new instance of the KryptonPaletteRibbonGroupBaseText class. /// </summary> /// <param name="redirect">Redirector to inherit values from.</param> /// <param name="textStyle">Inherit text style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public KryptonPaletteRibbonGroupBaseText(PaletteRedirect redirect, PaletteRibbonTextStyle textStyle, NeedPaintHandler needPaint) { // Create the storage objects _stateInherit = new PaletteRibbonTextInheritRedirect(redirect, textStyle); _stateCommon = new PaletteRibbonText(_stateInherit, needPaint); _stateNormal = new PaletteRibbonText(_stateCommon, needPaint); _stateDisabled = new PaletteRibbonText(_stateCommon, needPaint); }
/// <summary> /// Gets the tab color for the item text. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <param name="style">Style of the ribbon color requested.</param> /// <returns>Color value.</returns> public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) { IPaletteRibbonText inherit = GetTextInherit(state); if (inherit != null) { return(inherit.GetRibbonTextColor(state)); } else { return(Target.GetRibbonTextColor(style, state)); } }
/// <summary> /// Initialize a new instance of the PaletteRibbonDoubleRedirect class. /// </summary> /// <param name="redirect">Inheritence redirection instance.</param> /// <param name="backStyle">Inheritence ribbon back style.</param> /// <param name="textStyle">Inheritence ribbon text style.</param> /// <param name="needPaint">Delegate for notifying paint requests.</param> public PaletteRibbonDoubleRedirect(PaletteRedirect redirect, PaletteRibbonBackStyle backStyle, PaletteRibbonTextStyle textStyle, NeedPaintHandler needPaint) { Debug.Assert(redirect != null); // Store the provided paint notification delegate NeedPaint = needPaint; // Store the inherit instances _inheritBack = new PaletteRibbonBackInheritRedirect(redirect, backStyle); _inheritText = new PaletteRibbonTextInheritRedirect(redirect, textStyle); // Define default values _backColor1 = Color.Empty; _backColor2 = Color.Empty; _backColor3 = Color.Empty; _backColor4 = Color.Empty; _backColor5 = Color.Empty; _textColor = Color.Empty; }
/// <summary> /// Gets the =color for the item text. /// </summary> /// <param name="style">Text style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) { switch (style) { case PaletteRibbonTextStyle.RibbonGroupNormalTitle: if (state == PaletteState.Disabled) { return(_disabledRibbonText); } break; case PaletteRibbonTextStyle.RibbonGroupButtonText: case PaletteRibbonTextStyle.RibbonGroupLabelText: case PaletteRibbonTextStyle.RibbonGroupCheckBoxText: case PaletteRibbonTextStyle.RibbonGroupRadioButtonText: if (state == PaletteState.Disabled) { return(_disabledRibbonText); } break; } return(base.GetRibbonTextColor(style, state)); }
/// <summary> /// Gets the tab color for the item text. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <param name="style">Style of the ribbon color requested.</param> /// <returns>Color value.</returns> public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) { IPaletteRibbonText inherit = GetTextInherit(state); return(inherit?.GetRibbonTextColor(state) ?? Target.GetRibbonTextColor(style, state)); }
/// <summary> /// Gets the tab color for the item text. /// </summary> /// <param name="state">Palette value should be applicable to this state.</param> /// <param name="style">Style of the ribbon color requested.</param> /// <returns>Color value.</returns> public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) { IPaletteRibbonText inherit = GetTextInherit(state); if (inherit != null) return inherit.GetRibbonTextColor(state); else return Target.GetRibbonTextColor(style, state); }
/// <summary> /// Gets the =color for the item text. /// </summary> /// <param name="style">Text style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) { switch (style) { case PaletteRibbonTextStyle.RibbonAppMenuDocsTitle: case PaletteRibbonTextStyle.RibbonAppMenuDocsEntry: return _ribbonColors[(int)SchemeOfficeColors.AppButtonMenuDocsText]; case PaletteRibbonTextStyle.RibbonTab: case PaletteRibbonTextStyle.RibbonGroupNormalTitle: switch (state) { case PaletteState.Disabled: return _disabledText; case PaletteState.CheckedNormal: case PaletteState.CheckedPressed: case PaletteState.CheckedTracking: case PaletteState.ContextCheckedNormal: case PaletteState.ContextCheckedTracking: case PaletteState.FocusOverride: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTextChecked]; default: return _ribbonColors[(int)SchemeOfficeColors.RibbonTabTextNormal]; } case PaletteRibbonTextStyle.RibbonGroupCollapsedText: return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupCollapsedText]; case PaletteRibbonTextStyle.RibbonGroupButtonText: case PaletteRibbonTextStyle.RibbonGroupLabelText: case PaletteRibbonTextStyle.RibbonGroupCheckBoxText: case PaletteRibbonTextStyle.RibbonGroupRadioButtonText: if (state == PaletteState.Disabled) return _disabledText; else return _ribbonColors[(int)SchemeOfficeColors.RibbonGroupCollapsedText]; default: // Should never happen! Debug.Assert(false); break; } return Color.Red; }
/// <summary> /// Gets the tab color for the item text. /// </summary> /// <param name="style">Text style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public virtual Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) { return _target.GetRibbonTextColor(style, state); }
/// <summary> /// Gets the tab color for the item text. /// </summary> /// <param name="style">Text style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public abstract Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state);
/// <summary> /// Gets the =color for the item text. /// </summary> /// <param name="style">Text style.</param> /// <param name="state">Palette value should be applicable to this state.</param> /// <returns>Color value.</returns> public override Color GetRibbonTextColor(PaletteRibbonTextStyle style, PaletteState state) { switch (style) { case PaletteRibbonTextStyle.RibbonGroupNormalTitle: if (state == PaletteState.Disabled) return _disabledRibbonText; break; case PaletteRibbonTextStyle.RibbonGroupButtonText: case PaletteRibbonTextStyle.RibbonGroupLabelText: case PaletteRibbonTextStyle.RibbonGroupCheckBoxText: case PaletteRibbonTextStyle.RibbonGroupRadioButtonText: if (state == PaletteState.Disabled) return _disabledRibbonText; break; } return base.GetRibbonTextColor(style, state); }