Vahid Pourlotfali
Trackbar contol did not have proper position value in case of SB_THUMBTRACK notification message: it was always sending 0. Jim Aston <jima@corel.ca> Made the slider control a rect. It had been trying to draw a notched slider, but the result didn't look right.
This commit is contained in:
parent
20c68be907
commit
d37c1bb570
|
@ -430,8 +430,7 @@ TRACKBAR_Refresh (HWND hwnd, HDC hdc)
|
||||||
FillRect (hdc, &thumb, hbr);
|
FillRect (hdc, &thumb, hbr);
|
||||||
DrawEdge (hdc, &thumb, EDGE_RAISED, BF_TOPLEFT);
|
DrawEdge (hdc, &thumb, EDGE_RAISED, BF_TOPLEFT);
|
||||||
} else {
|
} else {
|
||||||
|
POINT points[5];
|
||||||
POINT points[6];
|
|
||||||
|
|
||||||
/* first, fill the thumb */
|
/* first, fill the thumb */
|
||||||
/* FIXME: revamp. check for TBS_VERT */
|
/* FIXME: revamp. check for TBS_VERT */
|
||||||
|
@ -443,32 +442,16 @@ TRACKBAR_Refresh (HWND hwnd, HDC hdc)
|
||||||
points[1].y=thumb.top;
|
points[1].y=thumb.top;
|
||||||
points[2].x=thumb.right - 1;
|
points[2].x=thumb.right - 1;
|
||||||
points[2].y=thumb.bottom -2;
|
points[2].y=thumb.bottom -2;
|
||||||
points[3].x=(thumb.right + thumb.left-1)/2;
|
points[3].x=thumb.left;
|
||||||
points[3].y=thumb.bottom+4;
|
points[3].y=thumb.bottom -2;
|
||||||
points[4].x=thumb.left;
|
points[4].x=points[0].x;
|
||||||
points[4].y=thumb.bottom -2;
|
points[4].y=points[0].y;
|
||||||
points[5].x=points[0].x;
|
Polygon (hdc, points, 5);
|
||||||
points[5].y=points[0].y;
|
|
||||||
Polygon (hdc, points, 6);
|
|
||||||
|
|
||||||
if (dwStyle & TBS_VERT) {
|
if (dwStyle & TBS_VERT) {
|
||||||
/* draw edge */
|
/* draw edge */
|
||||||
} else {
|
} else {
|
||||||
RECT triangle; /* for correct shadows of thumb */
|
|
||||||
DrawEdge (hdc, &thumb, EDGE_RAISED, BF_TOPLEFT);
|
DrawEdge (hdc, &thumb, EDGE_RAISED, BF_TOPLEFT);
|
||||||
|
|
||||||
/* draw notch */
|
|
||||||
|
|
||||||
triangle.right = thumb.right+5;
|
|
||||||
triangle.left = points[3].x+5;
|
|
||||||
triangle.top = thumb.bottom +5;
|
|
||||||
triangle.bottom= thumb.bottom +1;
|
|
||||||
DrawEdge (hdc, &triangle, EDGE_SUNKEN,
|
|
||||||
BF_DIAGONAL | BF_TOP | BF_RIGHT);
|
|
||||||
triangle.left = thumb.left+6;
|
|
||||||
triangle.right = points[3].x+6;
|
|
||||||
DrawEdge (hdc, &triangle, EDGE_RAISED,
|
|
||||||
BF_DIAGONAL | BF_TOP | BF_LEFT);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DeleteObject (hbr);
|
DeleteObject (hbr);
|
||||||
|
@ -1352,7 +1335,7 @@ TRACKBAR_MouseMove (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
infoPtr->dragPos = dragPos;
|
infoPtr->dragPos = dragPos;
|
||||||
|
|
||||||
infoPtr->flags |= TB_DRAGPOSVALID;
|
infoPtr->flags |= TB_DRAGPOSVALID;
|
||||||
TRACKBAR_SendNotify (hwnd, TB_THUMBTRACK | (infoPtr->nPos>>16));
|
TRACKBAR_SendNotify (hwnd, TB_THUMBTRACK | (infoPtr->nPos<<16));
|
||||||
|
|
||||||
if (infoPtr->flags & TB_SHOW_TOOLTIP) {
|
if (infoPtr->flags & TB_SHOW_TOOLTIP) {
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
|
Loading…
Reference in New Issue