|
Lines 4222-4236
Link Here
|
| 4222 |
|
4222 |
|
| 4223 |
/* Convert thumb position from mouse position to value*/ |
4223 |
/* Convert thumb position from mouse position to value*/ |
| 4224 |
if (mouse_value) { |
4224 |
if (mouse_value) { |
| 4225 |
if (value_pos < thumb_area.Bottom) |
4225 |
if (tb.mouse_moved) { |
| 4226 |
value_pos = (int) ((thumb_area.Bottom - value_pos) / pixels_betweenticks); |
4226 |
value_pos += (int) pixels_betweenticks / 2; |
| 4227 |
else |
4227 |
if (value_pos < thumb_area.Bottom) { |
| 4228 |
value_pos = 0; |
4228 |
value_pos = (int) ((thumb_area.Bottom - value_pos - (int)(thumb_pos.Width / 2)) / pixels_betweenticks); |
|
|
4229 |
} else { |
| 4230 |
value_pos = 0; |
| 4231 |
} |
| 4232 |
|
| 4233 |
if (value_pos + tb.Minimum > tb.Maximum) |
| 4234 |
value_pos = tb.Maximum - tb.Minimum; |
| 4235 |
else if (value_pos + tb.Minimum < tb.Minimum) |
| 4236 |
value_pos = 0; |
| 4229 |
|
4237 |
|
| 4230 |
if (value_pos + tb.Minimum > tb.Maximum) |
4238 |
tb.Value = value_pos + tb.Minimum; |
| 4231 |
value_pos = tb.Maximum - tb.Minimum; |
4239 |
} else { |
| 4232 |
|
4240 |
value_pos = tb.Value - tb.Minimum; |
| 4233 |
tb.Value = value_pos + tb.Minimum; |
4241 |
} |
| 4234 |
} |
4242 |
} |
| 4235 |
|
4243 |
|
| 4236 |
// thumb_pos.Y = channel_startpoint.Y ; // + (int) (pixels_betweenticks * (float) value_pos); |
4244 |
// thumb_pos.Y = channel_startpoint.Y ; // + (int) (pixels_betweenticks * (float) value_pos); |
|
Lines 4366-4372
Link Here
|
| 4366 |
Does not matter the size of the control, Win32 always draws: |
4374 |
Does not matter the size of the control, Win32 always draws: |
| 4367 |
- Ticks starting from pixel 13, 8 |
4375 |
- Ticks starting from pixel 13, 8 |
| 4368 |
- Channel starting at pos 8, 19 and ends at Width - 8 |
4376 |
- Channel starting at pos 8, 19 and ends at Width - 8 |
| 4369 |
- Autosize makes always the control 40 pixels height |
4377 |
- Autosize makes always the control DefaultSize.Height pixels high |
| 4370 |
- Ticks are draw at (channel.Witdh - 10) / (Maximum - Minimum) |
4378 |
- Ticks are draw at (channel.Witdh - 10) / (Maximum - Minimum) |
| 4371 |
|
4379 |
|
| 4372 |
*/ |
4380 |
*/ |
|
Lines 4428-4442
Link Here
|
| 4428 |
|
4436 |
|
| 4429 |
/* Convert thumb position from mouse position to value*/ |
4437 |
/* Convert thumb position from mouse position to value*/ |
| 4430 |
if (mouse_value) { |
4438 |
if (mouse_value) { |
| 4431 |
if (value_pos >= channel_startpoint.X) |
4439 |
if (tb.mouse_moved) { |
| 4432 |
value_pos = (int)(((float) (value_pos - channel_startpoint.X)) / pixels_betweenticks); |
4440 |
value_pos += (int) pixels_betweenticks / 2; |
| 4433 |
else |
4441 |
if (value_pos >= channel_startpoint.X) { |
| 4434 |
value_pos = 0; |
4442 |
value_pos = (int)(((float) (value_pos - channel_startpoint.X - (int)(thumb_pos.Width / 2))) / pixels_betweenticks); |
|
|
4443 |
} else |
| 4444 |
value_pos = 0; |
| 4445 |
|
| 4446 |
if (value_pos + tb.Minimum > tb.Maximum) |
| 4447 |
value_pos = tb.Maximum - tb.Minimum; |
| 4448 |
else if(value_pos + tb.Minimum < tb.Minimum) |
| 4449 |
value_pos = 0; |
| 4435 |
|
4450 |
|
| 4436 |
if (value_pos + tb.Minimum > tb.Maximum) |
4451 |
tb.Value = value_pos + tb.Minimum; |
| 4437 |
value_pos = tb.Maximum - tb.Minimum; |
4452 |
} else { |
| 4438 |
|
4453 |
value_pos = tb.Value - tb.Minimum; |
| 4439 |
tb.Value = value_pos + tb.Minimum; |
4454 |
} |
| 4440 |
} |
4455 |
} |
| 4441 |
|
4456 |
|
| 4442 |
thumb_pos.X = channel_startpoint.X + (int) (pixels_betweenticks * (float) value_pos); |
4457 |
thumb_pos.X = channel_startpoint.X + (int) (pixels_betweenticks * (float) value_pos); |
|
Lines 4594-4606
Link Here
|
| 4594 |
dc.FillRectangle (ResPool.GetSolidBrush (tb.BackColor), clip_rectangle); |
4609 |
dc.FillRectangle (ResPool.GetSolidBrush (tb.BackColor), clip_rectangle); |
| 4595 |
} |
4610 |
} |
| 4596 |
|
4611 |
|
| 4597 |
|
|
|
| 4598 |
if (tb.Focused) { |
4612 |
if (tb.Focused) { |
| 4599 |
Brush brush = ResPool.GetHatchBrush (HatchStyle.Percent50, ColorControl, Color.Black); |
4613 |
CPDrawFocusRectangle(dc, area, tb.ForeColor, tb.BackColor); |
| 4600 |
dc.FillRectangle (brush, area.X, area.Y, area.Width - 1, 1); |
|
|
| 4601 |
dc.FillRectangle (brush, area.X, area.Y + area.Height - 1, area.Width - 1, 1); |
| 4602 |
dc.FillRectangle (brush, area.X, area.Y, 1, area.Height - 1); |
| 4603 |
dc.FillRectangle (brush, area.X + area.Width - 1, area.Y, 1, area.Height - 1); |
| 4604 |
} |
4614 |
} |
| 4605 |
|
4615 |
|
| 4606 |
if (tb.Orientation == Orientation.Vertical) { |
4616 |
if (tb.Orientation == Orientation.Vertical) { |