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.GridHeaderColumnSheet:
case PaletteBackStyle.GridHeaderColumnCustom1:
case PaletteBackStyle.GridHeaderRowList:
case PaletteBackStyle.GridHeaderRowSheet:
case PaletteBackStyle.GridHeaderRowCustom1:
switch (state)
{
case PaletteState.Disabled:
return SystemColors.Control;
default:
case PaletteState.Normal:
case PaletteState.Tracking:
case PaletteState.Pressed:
return ColorTable.MenuStripGradientBegin;
case PaletteState.CheckedNormal:
return ColorTable.CheckBackground;
}
case PaletteBackStyle.GridDataCellList:
case PaletteBackStyle.GridDataCellSheet:
case PaletteBackStyle.GridDataCellCustom1:
if (state == PaletteState.CheckedNormal)
return ColorTable.ButtonPressedHighlight;
else
return SystemColors.Window;
case PaletteBackStyle.FormMain:
case PaletteBackStyle.FormCustom1:
return ColorTable.MenuStripGradientBegin;
case PaletteBackStyle.HeaderForm:
return Table.Header1End;
case PaletteBackStyle.PanelClient:
case PaletteBackStyle.PanelRibbonInactive:
case PaletteBackStyle.PanelCustom1:
case PaletteBackStyle.ControlGroupBox:
case PaletteBackStyle.SeparatorLowProfile:
case PaletteBackStyle.SeparatorCustom1:
case PaletteBackStyle.GridBackgroundList:
case PaletteBackStyle.GridBackgroundSheet:
case PaletteBackStyle.GridBackgroundCustom1:
return ColorTable.MenuStripGradientEnd;
case PaletteBackStyle.PanelAlternate:
return ColorTable.MenuStripGradientBegin;
case PaletteBackStyle.ControlClient:
case PaletteBackStyle.ControlAlternate:
case PaletteBackStyle.ControlCustom1:
return SystemColors.Window;
case PaletteBackStyle.ContextMenuHeading:
return ColorTable.OverflowButtonGradientBegin;
case PaletteBackStyle.ContextMenuSeparator:
case PaletteBackStyle.ContextMenuItemSplit:
switch (state)
{
case PaletteState.Disabled:
return SystemColors.Control;
case PaletteState.Tracking:
return ColorTable.ButtonSelectedBorder;
default:
return ColorTable.MenuBorder;
}
case PaletteBackStyle.ContextMenuItemImageColumn:
return ColorTable.ImageMarginGradientEnd;
case PaletteBackStyle.InputControlStandalone:
case PaletteBackStyle.InputControlRibbon:
case PaletteBackStyle.InputControlCustom1:
if (state == PaletteState.Disabled)
return SystemColors.Control;
else
return SystemColors.Window;
case PaletteBackStyle.ControlRibbon:
return _ribbonColors[(int)SchemeOfficeColors.RibbonTabSelected4];
case PaletteBackStyle.ControlRibbonAppMenu:
return _ribbonColors[(int)SchemeOfficeColors.AppButtonBack2];
case PaletteBackStyle.ContextMenuOuter:
case PaletteBackStyle.ContextMenuInner:
return ColorTable.ToolStripDropDownBackground;
case PaletteBackStyle.ContextMenuItemImage:
return ColorTable.ButtonSelectedHighlight;
case PaletteBackStyle.SeparatorHighInternalProfile:
case PaletteBackStyle.SeparatorHighProfile:
case PaletteBackStyle.HeaderPrimary:
case PaletteBackStyle.HeaderCalendar:
case PaletteBackStyle.HeaderCustom1:
case PaletteBackStyle.HeaderCustom2:
if (state == PaletteState.Disabled)
return SystemColors.Control;
else
return Table.Header1End;
case PaletteBackStyle.HeaderSecondary:
if (state == PaletteState.Disabled)
return SystemColors.Control;
else
return ColorTable.MenuStripGradientBegin;
case PaletteBackStyle.HeaderDockInactive:
if (state == PaletteState.Disabled)
return SystemColors.Control;
else
return ControlPaint.Light(SystemColors.GradientInactiveCaption);
case PaletteBackStyle.HeaderDockActive:
if (state == PaletteState.Disabled)
return SystemColors.Control;
else
return ControlPaint.Light(SystemColors.GradientActiveCaption);
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 SystemColors.Control;
case PaletteState.Normal:
if (style == PaletteBackStyle.TabLowProfile)
return Color.Empty;
else
return MergeColors(SystemColors.Window, 0.9f, SystemColors.ControlText, 0.1f);
case PaletteState.Tracking:
case PaletteState.Pressed:
if (style == PaletteBackStyle.TabLowProfile)
return Color.Empty;
else
return MergeColors(SystemColors.Window, 0.95f, SystemColors.ControlText, 0.05f);
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 SystemColors.Control;
case PaletteState.Normal:
return MergeColors(SystemColors.Control, 0.8f, SystemColors.ControlDark, 0.2f);
case PaletteState.Pressed:
case PaletteState.Tracking:
return MergeColors(SystemColors.Window, 0.8f, SystemColors.Highlight, 0.2f);
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 SystemColors.Control;
case PaletteState.Normal:
case PaletteState.CheckedNormal:
return MergeColors(SystemColors.Control, 0.8f, SystemColors.ControlDark, 0.2f);
case PaletteState.Pressed:
case PaletteState.CheckedPressed:
case PaletteState.Tracking:
case PaletteState.CheckedTracking:
return MergeColors(SystemColors.Window, 0.8f, SystemColors.Highlight, 0.2f);
default:
throw new ArgumentOutOfRangeException("state");
}
case PaletteBackStyle.ControlToolTip:
return _toolTipBack2;
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.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:
switch (state)
{
case PaletteState.Disabled:
return SystemColors.Control;
case PaletteState.Normal:
return ColorTable.MenuStripGradientBegin;
case PaletteState.CheckedNormal:
return ColorTable.ButtonPressedGradientMiddle;
case PaletteState.NormalDefaultOverride:
return ColorTable.MenuStripGradientBegin;
case PaletteState.Tracking:
return ColorTable.ButtonSelectedGradientEnd;
case PaletteState.Pressed:
case PaletteState.CheckedPressed:
if (style == PaletteBackStyle.ButtonAlternate)
return ColorTable.MenuStripGradientBegin;
else
return ColorTable.ButtonPressedGradientEnd;
case PaletteState.CheckedTracking:
return ColorTable.ButtonPressedGradientEnd;
default:
throw new ArgumentOutOfRangeException("state");
}
case PaletteBackStyle.ButtonCalendarDay:
switch (state)
{
case PaletteState.Disabled:
return SystemColors.Control;
case PaletteState.Normal:
case PaletteState.NormalDefaultOverride:
return ColorTable.MenuStripGradientEnd;
case PaletteState.CheckedNormal:
return ColorTable.ButtonPressedGradientEnd;
case PaletteState.Tracking:
return ColorTable.ButtonSelectedGradientBegin;
case PaletteState.Pressed:
case PaletteState.CheckedPressed:
case PaletteState.CheckedTracking:
return ColorTable.ButtonPressedGradientBegin;
default:
throw new ArgumentOutOfRangeException("state");
}
case PaletteBackStyle.ButtonInputControl:
switch (state)
{
case PaletteState.Disabled:
return SystemColors.Control;
case PaletteState.Normal:
return ColorTable.MenuStripGradientBegin;
case PaletteState.CheckedNormal:
return ColorTable.MenuStripGradientBegin;
case PaletteState.CheckedTracking:
case PaletteState.CheckedPressed:
case PaletteState.Tracking:
return ColorTable.ButtonSelectedGradientEnd;
case PaletteState.Pressed:
return ColorTable.ButtonPressedGradientEnd;
default:
throw new ArgumentOutOfRangeException("state");
}
case PaletteBackStyle.ContextMenuItemHighlight:
switch (state)
{
case PaletteState.Disabled:
return SystemColors.Control;
case PaletteState.Normal:
return Color.Empty;
case PaletteState.Tracking:
return ColorTable.MenuItemSelectedGradientEnd;
default:
throw new ArgumentOutOfRangeException("state");
}
default:
throw new ArgumentOutOfRangeException("style");
}
}