GetPageColorTable(Office2007ScrollBarColorTable ct, ePageNavigatorPart part) { if (GetEnabled() == false) return (ct.Disabled); if (MouseDownPart == part) return (ct.Pressed); if (MouseOverPart == part) return (ct.MouseOver); return (ct.Default); }
public static void InitializeScrollBarColorTable(Office2007ScrollBarColorTable scrollBarColorTable, ColorFactory factory, MetroPartColors metroParts) { Office2007ScrollBarStateColorTable sct = scrollBarColorTable.Default; sct.Background = new LinearGradientColorTable(factory.GetColor(metroParts.CanvasColor)); sct.Border = LinearGradientColorTable.Empty; sct.ThumbSignBackground = new LinearGradientColorTable(factory.GetColor(metroParts.TextInactiveColor)); sct.TrackBackground.Clear(); sct.TrackInnerBorder = LinearGradientColorTable.Empty; sct.TrackOuterBorder = LinearGradientColorTable.Empty; sct.TrackSignBackground = new LinearGradientColorTable(factory.GetColor(metroParts.TextInactiveColor)); // Mouse Over sct = scrollBarColorTable.MouseOver; sct.Background = scrollBarColorTable.Default.Background; sct.Border = scrollBarColorTable.Default.Border; sct.ThumbBackground.Clear(); sct.ThumbInnerBorder = LinearGradientColorTable.Empty; sct.ThumbOuterBorder = LinearGradientColorTable.Empty; sct.ThumbSignBackground = new LinearGradientColorTable(factory.GetColor(metroParts.TextColor)); sct.TrackBackground.Clear(); sct.TrackInnerBorder = LinearGradientColorTable.Empty; sct.TrackOuterBorder = LinearGradientColorTable.Empty; sct.TrackSignBackground = new LinearGradientColorTable(factory.GetColor(metroParts.TextColor)); // Control Mouse Over sct = scrollBarColorTable.MouseOverControl; sct.Background = scrollBarColorTable.Default.Background; sct.Border = scrollBarColorTable.Default.Border; sct.ThumbBackground.Clear(); sct.ThumbInnerBorder = LinearGradientColorTable.Empty; sct.ThumbOuterBorder = new LinearGradientColorTable(factory.GetColor(metroParts.TextColor)); sct.ThumbSignBackground = scrollBarColorTable.Default.ThumbSignBackground; sct.TrackBackground.Clear(); sct.TrackInnerBorder = LinearGradientColorTable.Empty; sct.TrackOuterBorder = LinearGradientColorTable.Empty; sct.TrackSignBackground = new LinearGradientColorTable(factory.GetColor(metroParts.TextColor)); // Pressed sct = scrollBarColorTable.Pressed; sct.Background = scrollBarColorTable.Default.Background; sct.Border = scrollBarColorTable.Default.Border; sct.ThumbBackground.Clear(); sct.ThumbInnerBorder = LinearGradientColorTable.Empty; sct.ThumbOuterBorder = LinearGradientColorTable.Empty; sct.ThumbSignBackground = new LinearGradientColorTable(factory.GetColor(metroParts.TextColor)); sct.TrackBackground.Clear(); sct.TrackInnerBorder = LinearGradientColorTable.Empty; sct.TrackOuterBorder = LinearGradientColorTable.Empty; sct.TrackSignBackground = new LinearGradientColorTable(factory.GetColor(metroParts.TextColor)); // Disabled sct = scrollBarColorTable.Disabled; sct.Background = scrollBarColorTable.Default.Background; sct.Border = scrollBarColorTable.Default.Border; sct.ThumbBackground.Clear(); sct.ThumbInnerBorder = new LinearGradientColorTable(); sct.ThumbOuterBorder = new LinearGradientColorTable(); sct.ThumbSignBackground = new LinearGradientColorTable(factory.GetColor(metroParts.TextDisabledColor)); sct.TrackBackground.Clear(); sct.TrackInnerBorder = new LinearGradientColorTable(); sct.TrackOuterBorder = new LinearGradientColorTable(); sct.TrackSignBackground = new LinearGradientColorTable(); }
/// <summary> /// Draws the NextPage button /// </summary> /// <param name="g"></param> /// <param name="ct"></param> private void DrawNextPage(Graphics g, Office2007ScrollBarColorTable ct) { Office2007ScrollBarStateColorTable cst = GetPageColorTable(ct, ePageNavigatorPart.NextPage); float angle = (Orientation == eOrientation.Horizontal) ? 90f : 0f; using (LinearGradientBrush lbr = new LinearGradientBrush( _NextPageBounds, cst.Background.Start, cst.Background.End, angle)) { if (cst.TrackBackground.Count > 0) lbr.InterpolationColors = cst.TrackBackground.GetColorBlend(); g.FillRectangle(lbr, _NextPageBounds); } g.DrawImageUnscaled( GetNextPageBitmap(g, cst), CenterRect(_NextPageBounds)); }