public ScrollBarThumb(ScrollBarThumbDefaults type) { this._imageAttributes = new ImageAttributes(); this._imageAttributes.ClearColorKey(); this._gripImageAttributes = new ImageAttributes(); this._gripImageAttributes.ClearColorKey(); switch (type) { case ScrollBarThumbDefaults.Normal: this._color = SystemColors.ScrollBar; this._gripColor = SystemColors.ControlText; break; case ScrollBarThumbDefaults.Highlight: this._color = SystemColors.ControlText; this._gripColor = SystemColors.HighlightText; break; } this._borderStyle = ScrollBarBorderStyle.Solid; this._borderColor = SystemColors.ControlText; this._gradientColor = new Resco.Controls.ScrollBar.GradientColor(FillDirection.Horizontal); this._gradientColor.PropertyChanged += new EventHandler(this.GradientColor_PropertyChanged); this._image = null; this._imageLayout = ScrollBarThumbImageLayout.Stretch; this._imageTransparentColor = System.Drawing.Color.Transparent; this._gripStyle = ScrollBarThumbGripStyle.Lines; this._gripImage = null; this._gripImageTransparentColor = System.Drawing.Color.Transparent; this._gripLines = 3; }
public ScrollBarButton(ScrollBarButtonDefaults type) { this._imageAttributes = new ImageAttributes(); this._imageAttributes.ClearColorKey(); switch (type) { case ScrollBarButtonDefaults.Normal: this._color = SystemColors.ScrollBar; this._arrowColor = SystemColors.ControlText; break; case ScrollBarButtonDefaults.Highlight: this._color = SystemColors.ControlText; this._arrowColor = SystemColors.HighlightText; break; case ScrollBarButtonDefaults.Disabled: this._color = SystemColors.ScrollBar; this._arrowColor = SystemColors.GrayText; break; } this._borderStyle = ScrollBarBorderStyle.Solid; this._borderColor = SystemColors.ControlText; this._borderClosed = false; this._gradientColor = new Resco.Controls.ScrollBar.GradientColor(FillDirection.Horizontal); this._gradientColor.PropertyChanged += new EventHandler(this.GradientColor_PropertyChanged); this._image = null; this._arrowImage = null; this._arrowImageLayout = ScrollBarButtonArrowImageLayout.Center; this._arrowImageTransparentColor = System.Drawing.Color.Transparent; }
public LetterBar() { this._stringCenter.Alignment = StringAlignment.Center; this._stringCenter.LineAlignment = StringAlignment.Center; this._letters = new List <char>(0x1a); this._disabledLetters = 0; this._borderStyle = ScrollBarBorderStyle.Solid; this._borderColor = SystemColors.ControlText; this._borderClosed = false; this._color = SystemColors.Control; this._gradientColor = new Resco.Controls.ScrollBar.GradientColor(FillDirection.Horizontal); this._gradientColor.PropertyChanged += new EventHandler(this.GradientColor_PropertyChanged); this._image = null; this._font = new System.Drawing.Font(FontFamily.GenericSansSerif, 8f, FontStyle.Regular); this._foreColor = SystemColors.ControlText; this._highlightColor = SystemColors.HighlightText; this._disabledColor = SystemColors.GrayText; }
public ScrollBarTrack(ScrollBarTrackDefaults type) { switch (type) { case ScrollBarTrackDefaults.Normal: this._color = SystemColors.Window; break; case ScrollBarTrackDefaults.Highlight: this._color = SystemColors.ControlText; break; case ScrollBarTrackDefaults.Disabled: this._color = SystemColors.Window; break; } this._borderStyle = ScrollBarBorderStyle.Solid; this._borderColor = SystemColors.ControlText; this._gradientColor = new Resco.Controls.ScrollBar.GradientColor(FillDirection.Horizontal); this._gradientColor.PropertyChanged += new EventHandler(this.GradientColor_PropertyChanged); this._image = null; this._trackLayout = ScrollBarTrackLayout.FixedToTrack; }
internal static void DoDrawBorder(Graphics gr, ScrollBarBorderStyle style, Color c, Rectangle rect, BorderSide sides, Color parentColor) { if (((style != ScrollBarBorderStyle.None) && (rect.Width > 0)) && ((rect.Height > 0) && (sides != BorderSide.None))) { Pen pen = GetPen(c); if ((rect.Width == 1) && (rect.Height == 1)) { DrawPixel(gr, c, rect.Left, rect.Top); } else if (rect.Width == 1) { if ((sides & (BorderSide.Right | BorderSide.Left)) != BorderSide.None) { gr.DrawLine(pen, rect.Left, rect.Top, rect.Left, rect.Bottom - 1); } } else if (rect.Height == 1) { if ((sides & (BorderSide.Down | BorderSide.Up)) != BorderSide.None) { gr.DrawLine(pen, rect.Left, rect.Top, rect.Right - 1, rect.Top); } } else { int left = rect.Left; int top = rect.Top; int num3 = rect.Right - 1; int num4 = rect.Bottom - 1; if ((style == ScrollBarBorderStyle.Solid) || ((style == ScrollBarBorderStyle.Rounded) && ((rect.Width == 2) || (rect.Height == 2)))) { if ((sides & BorderSide.Left) == BorderSide.Left) { gr.DrawLine(pen, left, top, left, num4); } if ((sides & BorderSide.Up) == BorderSide.Up) { gr.DrawLine(pen, left, top, num3, top); } if ((sides & BorderSide.Right) == BorderSide.Right) { gr.DrawLine(pen, num3, top, num3, num4); } if ((sides & BorderSide.Down) == BorderSide.Down) { gr.DrawLine(pen, left, num4, num3, num4); } } else { if (rect.Width == 3) { if ((sides & BorderSide.Up) == BorderSide.Up) { if ((sides & BorderSide.Left) == BorderSide.None) { gr.DrawLine(pen, left, top, left + 1, top); } else if ((sides & BorderSide.Right) == BorderSide.None) { gr.DrawLine(pen, left + 1, top, num3, top); } else { DrawPixel(gr, c, left + 1, top); } } if ((sides & BorderSide.Down) == BorderSide.Down) { if ((sides & BorderSide.Left) == BorderSide.None) { gr.DrawLine(pen, left, num4, left + 1, num4); } else if ((sides & BorderSide.Right) == BorderSide.None) { gr.DrawLine(pen, left + 1, num4, num3, num4); } else { DrawPixel(gr, c, left + 1, num4); } } } else { if ((sides & BorderSide.Up) == BorderSide.Up) { gr.DrawLine(pen, left + (((sides & BorderSide.Left) == BorderSide.Left) ? 1 : 0), top, num3 - (((sides & BorderSide.Right) == BorderSide.Right) ? 1 : 0), top); } if ((sides & BorderSide.Down) == BorderSide.Down) { gr.DrawLine(pen, left + (((sides & BorderSide.Left) == BorderSide.Left) ? 1 : 0), num4, num3 - (((sides & BorderSide.Right) == BorderSide.Right) ? 1 : 0), num4); } } if (rect.Height == 3) { if ((sides & BorderSide.Left) == BorderSide.Left) { if ((sides & BorderSide.Up) == BorderSide.None) { gr.DrawLine(pen, left, top, left, top + 1); } else if ((sides & BorderSide.Down) == BorderSide.None) { gr.DrawLine(pen, left, top + 1, left, num4); } else { DrawPixel(gr, c, left, top + 1); } } if ((sides & BorderSide.Right) == BorderSide.Right) { if ((sides & BorderSide.Up) == BorderSide.None) { gr.DrawLine(pen, num3, top, num3, top + 1); } else if ((sides & BorderSide.Down) == BorderSide.None) { gr.DrawLine(pen, num3, top + 1, num3, num4); } else { DrawPixel(gr, c, num3, top + 1); } } } else { if ((sides & BorderSide.Left) == BorderSide.Left) { gr.DrawLine(pen, left, top + (((sides & BorderSide.Up) == BorderSide.Up) ? 1 : 0), left, num4 - (((sides & BorderSide.Down) == BorderSide.Down) ? 1 : 0)); } if ((sides & BorderSide.Right) == BorderSide.Right) { gr.DrawLine(pen, num3, top + (((sides & BorderSide.Up) == BorderSide.Up) ? 1 : 0), num3, num4 - (((sides & BorderSide.Down) == BorderSide.Down) ? 1 : 0)); } } if (parentColor != Color.Transparent) { if ((sides & (BorderSide.Up | BorderSide.Left)) == (BorderSide.Up | BorderSide.Left)) { DrawPixel(gr, parentColor, left, top); } if ((sides & (BorderSide.Right | BorderSide.Up)) == (BorderSide.Right | BorderSide.Up)) { DrawPixel(gr, parentColor, num3, top); } if ((sides & (BorderSide.Down | BorderSide.Left)) == (BorderSide.Down | BorderSide.Left)) { DrawPixel(gr, parentColor, left, num4); } if ((sides & (BorderSide.Down | BorderSide.Right)) == (BorderSide.Down | BorderSide.Right)) { DrawPixel(gr, parentColor, num3, num4); } } } } } }