internal static void ApplyQatElementStyle(ElementStyle style, Ribbon.QatToolbar qat) { if (!(qat.Parent is RibbonControl)) return; style.Reset(); eDotNetBarStyle effectiveStyle = qat.EffectiveStyle; if (effectiveStyle == eDotNetBarStyle.Office2010 || effectiveStyle == eDotNetBarStyle.Metro) { Rendering.Office2007ColorTable ct = GetOffice2007ColorTable(qat.Parent as RibbonControl); Rendering.Office2007QuickAccessToolbarStateColorTable qatColors = ct.QuickAccessToolbar.Standalone; style.BackColor = qatColors.BottomBackground.Start; style.BackColor2 = qatColors.BottomBackground.End; style.BackColorGradientAngle = qatColors.BottomBackground.GradientAngle; style.Border = eStyleBorderType.Solid; style.BorderWidth = 1; style.CornerType = eCornerType.Square; //style.CornerDiameter = 2; style.BorderColor = qatColors.OutterBorderColor; style.BorderColorLight = qatColors.InnerBorderColor; } else if (effectiveStyle == eDotNetBarStyle.Windows7) { Rendering.Office2007ColorTable ct = GetOffice2007ColorTable(qat.Parent as RibbonControl); Rendering.Office2007QuickAccessToolbarStateColorTable qatColors = ct.QuickAccessToolbar.Standalone; style.BackColor = qatColors.BottomBackground.Start; style.BackColor2 = qatColors.BottomBackground.End; style.BackColorGradientAngle = qatColors.BottomBackground.GradientAngle; style.Border = eStyleBorderType.Solid; style.BorderWidth = 1; style.CornerType = eCornerType.Square; style.BorderColor = qatColors.OutterBorderColor; style.BorderColorLight = qatColors.InnerBorderColor; } else if (effectiveStyle == eDotNetBarStyle.Office2007) { Rendering.Office2007ColorTable ct = GetOffice2007ColorTable(qat.Parent as RibbonControl); Rendering.Office2007QuickAccessToolbarStateColorTable qatColors = ct.QuickAccessToolbar.Standalone; style.BackColor = qatColors.BottomBackground.Start; style.BackColor2 = qatColors.BottomBackground.End; style.BackColorGradientAngle = qatColors.BottomBackground.GradientAngle; style.Border = eStyleBorderType.Etched; style.BorderWidth = 1; style.CornerType = eCornerType.Rounded; style.CornerDiameter = 2; style.BorderColor = qatColors.OutterBorderColor; style.BorderColorLight = qatColors.InnerBorderColor; } else { style.BackColorSchemePart = eColorSchemePart.BarBackground; style.BackColor2SchemePart = eColorSchemePart.BarBackground2; style.BackColorGradientAngle = 90; } }
internal static void ApplyRibbonBarOffice2003ElementStyle(ElementStyle backStyle, ElementStyle backMouseOverStyle, ElementStyle titleStyle, ElementStyle titleMouseOverStyle) { backStyle.Reset(); backMouseOverStyle.Reset(); titleStyle.Reset(); titleMouseOverStyle.Reset(); backStyle.BackColorSchemePart = eColorSchemePart.BarBackground2; backStyle.BackColor2SchemePart = eColorSchemePart.BarBackground; backStyle.BackColorGradientAngle = 90; titleStyle.BackColorSchemePart = eColorSchemePart.PanelBackground; titleStyle.BackColor2SchemePart = eColorSchemePart.PanelBackground2; titleStyle.BackColorGradientAngle = 90; titleStyle.TextColorSchemePart = eColorSchemePart.PanelText; titleStyle.PaddingTop = 1; titleStyle.PaddingBottom = 1; titleStyle.PaddingLeft = 2; titleStyle.PaddingRight = 2; titleStyle.TextShadowColor = Color.Black; titleStyle.TextShadowOffset = new Point(1, 1); titleStyle.BorderColorSchemePart = eColorSchemePart.PanelBorder; titleStyle.Border = eStyleBorderType.Solid; titleStyle.BorderWidth = 1; }
internal static void ApplyRibbonBarOffice2007ElementStyle(ElementStyle backStyle, ElementStyle backMouseOverStyle, ElementStyle titleStyle, ElementStyle titleMouseOverStyle, Rendering.Office2007ColorTable c) { backStyle.Reset(); backMouseOverStyle.Reset(); titleStyle.Reset(); titleMouseOverStyle.Reset(); backStyle.Border = eStyleBorderType.Etched; backStyle.BorderWidth = 1; backStyle.CornerType = eCornerType.Rounded; backStyle.CornerDiameter = 2; backStyle.BorderColor = c.RibbonBar.Default.OuterBorder.Start; backStyle.BorderColor2 = c.RibbonBar.Default.OuterBorder.End; backStyle.BorderColorLight = c.RibbonBar.Default.InnerBorder.Start; backStyle.BorderColorLight2 = c.RibbonBar.Default.InnerBorder.End; backStyle.BackColorGradientAngle = 90; if (c.RibbonBar.Default.TopBackground != null && c.RibbonBar.Default.BottomBackground != null) { backStyle.BackColorBlend.Add(new BackgroundColorBlend(c.RibbonBar.Default.TopBackground.Start, 0)); backStyle.BackColorBlend.Add(new BackgroundColorBlend(c.RibbonBar.Default.TopBackground.End, c.RibbonBar.Default.TopBackgroundHeight)); backStyle.BackColorBlend.Add(new BackgroundColorBlend(c.RibbonBar.Default.BottomBackground.Start, c.RibbonBar.Default.TopBackgroundHeight)); backStyle.BackColorBlend.Add(new BackgroundColorBlend(c.RibbonBar.Default.BottomBackground.End, 1)); } backStyle.PaddingLeft = 2; backStyle.PaddingRight = 2; backMouseOverStyle.BorderColor = c.RibbonBar.MouseOver.OuterBorder.Start; backMouseOverStyle.BorderColor2 = c.RibbonBar.MouseOver.OuterBorder.End; backMouseOverStyle.BorderColorLight = c.RibbonBar.MouseOver.InnerBorder.Start; backMouseOverStyle.BorderColorLight2 = c.RibbonBar.MouseOver.InnerBorder.End; backMouseOverStyle.BackColorGradientAngle = 90; if (c.RibbonBar.MouseOver.TopBackground != null && c.RibbonBar.MouseOver.BottomBackground != null) { backMouseOverStyle.BackColorBlend.Add(new BackgroundColorBlend(c.RibbonBar.MouseOver.TopBackground.Start, 0)); backMouseOverStyle.BackColorBlend.Add(new BackgroundColorBlend(c.RibbonBar.MouseOver.TopBackground.End, c.RibbonBar.MouseOver.TopBackgroundHeight)); backMouseOverStyle.BackColorBlend.Add(new BackgroundColorBlend(c.RibbonBar.MouseOver.BottomBackground.Start, c.RibbonBar.MouseOver.TopBackgroundHeight)); backMouseOverStyle.BackColorBlend.Add(new BackgroundColorBlend(c.RibbonBar.MouseOver.BottomBackground.End, 1)); } if (c.RibbonBar.Default.TitleBackground != null) { titleStyle.BackColor = c.RibbonBar.Default.TitleBackground.Start; titleStyle.BackColor2 = c.RibbonBar.Default.TitleBackground.End; } titleStyle.BackColorGradientAngle = 90; titleStyle.TextAlignment = eStyleTextAlignment.Center; titleStyle.TextColor = c.RibbonBar.Default.TitleText; titleStyle.TextShadowOffset = Point.Empty; titleStyle.PaddingTop = 1; titleStyle.PaddingBottom = 1; if (c.RibbonBar.MouseOver != null) { if (c.RibbonBar.MouseOver.TitleBackground != null) { titleMouseOverStyle.BackColor = c.RibbonBar.MouseOver.TitleBackground.Start; titleMouseOverStyle.BackColor2 = c.RibbonBar.MouseOver.TitleBackground.End; } titleMouseOverStyle.BackColorGradientAngle = 90; titleMouseOverStyle.TextAlignment = eStyleTextAlignment.Center; titleMouseOverStyle.TextColor = c.RibbonBar.MouseOver.TitleText; } titleStyle.HideMnemonic = true; titleMouseOverStyle.HideMnemonic = true; }
internal static void ApplyRibbonOffice2003ElementStyle(ElementStyle backStyle) { backStyle.Reset(); backStyle.BackColorSchemePart = eColorSchemePart.BarBackground2; backStyle.BackColor2SchemePart = eColorSchemePart.BarBackground; backStyle.BackColorGradientAngle = 90; }
internal static void ApplyRibbonWindows7ElementStyle(ElementStyle backStyle, Rendering.Office2007ColorTable ct) { backStyle.Reset(); backStyle.BackColor = ct.RibbonControl.TabsBackground.Start; backStyle.BackColor2 = ct.RibbonControl.TabsBackground.End; backStyle.BackColorGradientAngle = ct.RibbonControl.TabsBackground.GradientAngle; backStyle.BackColorGradientType = eGradientType.Linear; }
internal static void ApplyRibbonOffice2010ElementStyle(ElementStyle backStyle, Rendering.Office2007ColorTable ct, bool isGlassEnabled) { backStyle.Reset(); backStyle.BackColor = ct.RibbonControl.TabsBackground.Start; backStyle.BackColor2 = ct.RibbonControl.TabsBackground.End; backStyle.BackColorGradientAngle = ct.RibbonControl.TabsBackground.GradientAngle; backStyle.BackColorGradientType = eGradientType.Linear; if (isGlassEnabled) { //backStyle.BackColor = ct.RibbonControl.TabsGlassBackground.Start; //backStyle.BackColor2 = ct.RibbonControl.TabsGlassBackground.End; //backStyle.BackColorGradientAngle = ct.RibbonControl.TabsGlassBackground.GradientAngle; //backStyle.BackColorGradientType = eGradientType.Linear; backStyle.BackColor = ct.RibbonControl.TabsGlassBackground.End; backStyle.BackColor2 = ct.RibbonControl.TabsGlassBackground.Start; backStyle.BackColorGradientAngle = ct.RibbonControl.TabsGlassBackground.GradientAngle; backStyle.BackColorGradientType = eGradientType.Radial; } }
/// <summary> /// Applies predefined lable style to the ElementStyle object. /// </summary> /// <param name="style">Reference to ElementStyle object.</param> protected virtual void ApplyLabelStyle(ElementStyle style) { style.Reset(); style.TextAlignment = eStyleTextAlignment.Center; style.BackColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground; style.BackColor2SchemePart = DevComponents.DotNetBar.eColorSchemePart.BarBackground2; style.BackgroundImagePosition = DevComponents.DotNetBar.eStyleBackgroundImage.Tile; style.BorderColorSchemePart = eColorSchemePart.BarDockedBorder; style.BorderWidth = 1; style.TextColorSchemePart = eColorSchemePart.ItemText; style.BackColorGradientAngle = 90; }