本文整理汇总了C#中PaletteState类的典型用法代码示例。如果您正苦于以下问题:C# PaletteState类的具体用法?C# PaletteState怎么用?C# PaletteState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PaletteState类属于命名空间,在下文中一共展示了PaletteState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetContentLongTextColor1
/// <summary>
/// Gets the first back color for the long text.
/// </summary>
/// <param name="state">Palette value should be applicable to this state.</param>
/// <returns>Color value.</returns>
public override Color GetContentLongTextColor1(PaletteState state)
{
if (_overrideTextColor != Color.Empty)
return _overrideTextColor;
else
return RibbonGeneral.GetRibbonContextTextColor(state);
}
示例2: GetBackColor1
/// <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);
}
示例3: GetContentLongTextColor2
/// <summary>
/// Gets the second back color for the long text.
/// </summary>
/// <param name="state">Palette value should be applicable to this state.</param>
/// <returns>Color value.</returns>
public override Color GetContentLongTextColor2(PaletteState state)
{
if (state == PaletteState.Normal)
return _ribbon.StateCommon.RibbonGeneral.GetRibbonGroupSeparatorLight(state);
else
return _ribbon.StateCommon.RibbonGroupButton.Content.GetContentShortTextColor1(state);
}
示例4: GetContentLongTextColor2
/// <summary>
/// Gets the second back color for the long text.
/// </summary>
/// <param name="state">Palette value should be applicable to this state.</param>
/// <returns>Color value.</returns>
public override Color GetContentLongTextColor2(PaletteState state)
{
if (state == PaletteState.Disabled)
return _ribbonGroupTextDisabled.GetRibbonTextColor(state);
else
return _ribbonGroupTextNormal.GetRibbonTextColor(state);
}
示例5: DrawInputControlDropDownGlyph
/// <summary>
/// Draw a drop down grid appropriate for a input control.
/// </summary>
/// <param name="context">Render context.</param>
/// <param name="cellRect">Available drawing rectangle space.</param>
/// <param name="paletteContent">Content palette for getting colors.</param>
/// <param name="state">State associated with rendering.</param>
public override void DrawInputControlDropDownGlyph(RenderContext context,
Rectangle cellRect,
IPaletteContent paletteContent,
PaletteState state)
{
Debug.Assert(context != null);
Debug.Assert(paletteContent != null);
// Validate parameter references
if (context == null) throw new ArgumentNullException("context");
if (paletteContent == null) throw new ArgumentNullException("paletteContent");
Color c1 = paletteContent.GetContentShortTextColor1(state);
// Find the top left starting position for drawing lines
int xStart = cellRect.Left + (cellRect.Right - cellRect.Left - 4) / 2;
int yStart = cellRect.Top + (cellRect.Bottom - cellRect.Top - 3) / 2;
using (Pen darkPen = new Pen(c1))
{
context.Graphics.DrawLine(darkPen, xStart, yStart, xStart + 4, yStart);
context.Graphics.DrawLine(darkPen, xStart + 1, yStart + 1, xStart + 3, yStart + 1);
context.Graphics.DrawLine(darkPen, xStart + 2, yStart + 2, xStart + 2, yStart + 1);
}
}
示例6: GetDropDownButtonImage
/// <summary>
/// Gets a drop down button image appropriate for the provided state.
/// </summary>
/// <param name="state">PaletteState for which image is required.</param>
public override Image GetDropDownButtonImage(PaletteState state)
{
// Grab state specific image
Image retImage = null;
switch(state)
{
case PaletteState.Disabled:
retImage = _images.Disabled;
break;
case PaletteState.Normal:
retImage = _images.Normal;
break;
case PaletteState.Tracking:
retImage = _images.Tracking;
break;
case PaletteState.Pressed:
retImage = _images.Pressed;
break;
}
// Not found, then get the common image
if (retImage == null)
retImage = _images.Common;
// Not found, then inherit from target
if (retImage == null)
retImage = Target.GetDropDownButtonImage(state);
return retImage;
}
示例7: PaletteRibbonTabContentInheritOverride
/// <summary>
/// Initialize a new instance of the PaletteRibbonTabContentInheritOverride class.
/// </summary>
/// <param name="primaryBack">First choice inheritence background.</param>
/// <param name="primaryText">First choice inheritence text.</param>
/// <param name="primaryContent">First choice inheritence content.</param>
/// <param name="backupBack">Backup inheritence background.</param>
/// <param name="backupText">Backup inheritence text.</param>
/// <param name="backupContent">Backup inheritence content.</param>
/// <param name="state">Palette state to override.</param>
public PaletteRibbonTabContentInheritOverride(IPaletteRibbonBack primaryBack,
IPaletteRibbonText primaryText,
IPaletteContent primaryContent,
IPaletteRibbonBack backupBack,
IPaletteRibbonText backupText,
IPaletteContent backupContent,
PaletteState state)
{
Debug.Assert(primaryBack != null);
Debug.Assert(primaryText != null);
Debug.Assert(primaryContent != null);
Debug.Assert(backupBack != null);
Debug.Assert(backupText != null);
Debug.Assert(backupContent != null);
// Remember values
_primaryBack = primaryBack;
_primaryText = primaryText;
_primaryContent = primaryContent;
_backupBack = backupBack;
_backupText = backupText;
_backupContent = backupContent;
// Default state
_apply = false;
_override = true;
_state = state;
}
示例8: DrawSeparator
/// <summary>
/// Perform drawing of a separator glyph.
/// </summary>
/// <param name="context">Render context.</param>
/// <param name="displayRect">Display area available for drawing.</param>
/// <param name="paletteBack">Background palette details.</param>
/// <param name="paletteBorder">Border palette details.</param>
/// <param name="orientation">Visual orientation of the content.</param>
/// <param name="state">State associated with rendering.</param>
/// <param name="canMove">Can the separator be moved.</param>
public override void DrawSeparator(RenderContext context,
Rectangle displayRect,
IPaletteBack paletteBack,
IPaletteBorder paletteBorder,
Orientation orientation,
PaletteState state,
bool canMove)
{
// Let base class perform standard processing
base.DrawSeparator(context,
displayRect,
paletteBack,
paletteBorder,
orientation,
state,
canMove);
// If we are drawing the background then draw grab handles on top
if (paletteBack.GetBackDraw(state) == InheritBool.True)
{
// Only draw grab handle if the user can move the separator
if (canMove)
DrawGrabHandleGlyph(context, displayRect, orientation, state);
}
}
示例9: GetBackColor2
/// <summary>
/// Gets the second back color.
/// </summary>
/// <param name="state">Palette value should be applicable to this state.</param>
/// <returns>Color value.</returns>
public override Color GetBackColor2(PaletteState state)
{
if ((TreeNode != null) && (TreeNode.BackColor != Color.Empty))
return TreeNode.BackColor;
else
return _inherit.GetBackColor2(state);
}
示例10: KryptonBorderEdge
/// <summary>
/// Initialize a new instance of the KryptonBorderEdge class.
/// </summary>
public KryptonBorderEdge()
{
// The label cannot take the focus
SetStyle(ControlStyles.Selectable, false);
// Set default label style
_orientation = Orientation.Horizontal;
// Create the palette storage
_borderRedirect = new PaletteBorderInheritRedirect(Redirector, PaletteBorderStyle.ControlClient);
_stateCommon = new PaletteBorderEdgeRedirect(_borderRedirect, NeedPaintDelegate);
_stateDisabled = new PaletteBorderEdge(_stateCommon, NeedPaintDelegate);
_stateNormal = new PaletteBorderEdge(_stateCommon, NeedPaintDelegate);
_stateCurrent = _stateNormal;
_state = PaletteState.Normal;
// Our view contains just a simple canvas that covers entire client area
_drawPanel = new ViewDrawPanel(_stateNormal);
// Create the view manager instance
ViewManager = new ViewManager(this, _drawPanel);
// We want to be auto sized by default, but not the property default!
AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink;
}
示例11: GetBackColor2
/// <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);
}
示例12: GetMetricBool
/// <summary>
/// Gets a boolean metric value.
/// </summary>
/// <param name="state">Palette value should be applicable to this state.</param>
/// <param name="metric">Requested metric.</param>
/// <returns>InheritBool value.</returns>
public override InheritBool GetMetricBool(PaletteState state, PaletteMetricBool metric)
{
IPaletteMetric inherit = GetInherit(state);
if (inherit != null)
return inherit.GetMetricBool(state, metric);
else
return Target.GetMetricBool(state, metric);
}
示例13: GetBorderColor1
/// <summary>
/// Gets the first border color.
/// </summary>
/// <param name="style">Border style.</param>
/// <param name="state">Palette value should be applicable to this state.</param>
/// <returns>Color value.</returns>
public override Color GetBorderColor1(PaletteBorderStyle style, PaletteState state)
{
PaletteBorderEdge inherit = GetInherit(state);
if (inherit != null)
return inherit.GetBackColor1(state);
else
return Target.GetBorderColor1(style, state);
}
示例14: GetBackColor2
/// <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);
}
示例15: GetBorderDrawBorders
/// <summary>
/// Gets a value indicating which borders to draw.
/// </summary>
/// <param name="style">Border style.</param>
/// <param name="state">Palette value should be applicable to this state.</param>
/// <returns>PaletteDrawBorders value.</returns>
public override PaletteDrawBorders GetBorderDrawBorders(PaletteBorderStyle style, PaletteState state)
{
PaletteDrawBorders paletteBorder = base.GetBorderDrawBorders(style, state);
// The ribbon caption area should only ever draw a bottom border as the maximum
if ((paletteBorder & PaletteDrawBorders.Bottom) == PaletteDrawBorders.Bottom)
return PaletteDrawBorders.Bottom;
else
return PaletteDrawBorders.None;
}