public override void DrawTrackBar (Graphics dc, Rectangle clip_rectangle, TrackBar tb)
{
Brush br_thumb;
int value_pos;
bool mouse_value;
float ticks = (tb.Maximum - tb.Minimum) / tb.tickFrequency; /* N of ticks draw*/
Rectangle area;
Rectangle thumb_pos = tb.ThumbPos;
Rectangle thumb_area = tb.ThumbArea;
if (tb.thumb_pressed) {
value_pos = tb.thumb_mouseclick;
mouse_value = true;
} else {
value_pos = tb.Value - tb.Minimum;
mouse_value = false;
}
area = tb.ClientRectangle;
if (!tb.Enabled) {
br_thumb = (Brush) ResPool.GetHatchBrush (HatchStyle.Percent50, ColorControlLightLight, ColorControlLight);
} else if (tb.thumb_pressed == true) {
br_thumb = (Brush) ResPool.GetHatchBrush (HatchStyle.Percent50, ColorControlLight, ColorControl);
} else {
br_thumb = SystemBrushes.Control;
}
/* Control Background */
if (tb.BackColor.ToArgb () == DefaultControlBackColor.ToArgb ()) {
dc.FillRectangle (SystemBrushes.Control, clip_rectangle);
} else {
dc.FillRectangle (ResPool.GetSolidBrush (tb.BackColor), clip_rectangle);
}
if (tb.Focused) {
CPDrawFocusRectangle(dc, area, tb.ForeColor, tb.BackColor);
}
if (tb.Orientation == Orientation.Vertical) {
DrawTrackBar_Vertical (dc, clip_rectangle, tb, ref thumb_pos, ref thumb_area,
br_thumb, ticks, value_pos, mouse_value);
} else {
DrawTrackBar_Horizontal (dc, clip_rectangle, tb, ref thumb_pos, ref thumb_area,
br_thumb, ticks, value_pos, mouse_value);
}
tb.ThumbPos = thumb_pos;
tb.ThumbArea = thumb_area;
}