even more cleanups! omg, I'm productive!
This commit is contained in:
parent
47b9c5f88c
commit
259fdd957b
@ -11,7 +11,7 @@ static const int fontHeight = 16;
|
|||||||
static const int fontWidth = 12;
|
static const int fontWidth = 12;
|
||||||
|
|
||||||
static const int lines = 0x80;
|
static const int lines = 0x80;
|
||||||
static const int tracks = 16;
|
static const int tracks = 8;
|
||||||
|
|
||||||
void TrackView::onCreate(HWND hwnd)
|
void TrackView::onCreate(HWND hwnd)
|
||||||
{
|
{
|
||||||
@ -49,8 +49,8 @@ void TrackView::paintTracks(HDC hdc, RECT rcTracks)
|
|||||||
{
|
{
|
||||||
char temp[256];
|
char temp[256];
|
||||||
|
|
||||||
int firstLine = max((rcTracks.top - topMarginHeight) / fontHeight, 0);
|
int firstLine = scrollPosY + max((rcTracks.top - topMarginHeight) / fontHeight, 0);
|
||||||
int lastLine = scrollPosY + ((rcTracks.bottom - topMarginHeight) + (fontHeight - 1)) / fontHeight;
|
int lastLine = scrollPosY + min(((rcTracks.bottom - topMarginHeight) + (fontHeight - 1)) / fontHeight, lines - 1);
|
||||||
|
|
||||||
lastLine = min(lastLine, lines);
|
lastLine = min(lastLine, lines);
|
||||||
|
|
||||||
@ -150,7 +150,7 @@ void TrackView::paintTracks(HDC hdc, RECT rcTracks)
|
|||||||
bottomMargin.bottom = rcTracks.bottom;
|
bottomMargin.bottom = rcTracks.bottom;
|
||||||
bottomMargin.left = trackLeft;
|
bottomMargin.left = trackLeft;
|
||||||
bottomMargin.right = trackLeft + trackWidth;
|
bottomMargin.right = trackLeft + trackWidth;
|
||||||
FillRect( hdc, &bottomMargin, (HBRUSH)GetStockObject(LTGRAY_BRUSH));
|
FillRect( hdc, &bottomMargin, (HBRUSH)GetStockObject(WHITE_BRUSH));
|
||||||
|
|
||||||
trackLeft += trackWidth;
|
trackLeft += trackWidth;
|
||||||
}
|
}
|
||||||
@ -161,17 +161,17 @@ void TrackView::paintTracks(HDC hdc, RECT rcTracks)
|
|||||||
topMargin.bottom = topMarginHeight;
|
topMargin.bottom = topMarginHeight;
|
||||||
topMargin.left = trackLeft;
|
topMargin.left = trackLeft;
|
||||||
topMargin.right = rcTracks.right;
|
topMargin.right = rcTracks.right;
|
||||||
FillRect( hdc, &topMargin, (HBRUSH)GetStockObject(LTGRAY_BRUSH));
|
DrawEdge(hdc, &topMargin, BDR_SUNKENINNER | BDR_RAISEDOUTER, BF_ADJUST | BF_LEFT);
|
||||||
|
FillRect(hdc, &topMargin, (HBRUSH)GetStockObject(LTGRAY_BRUSH));
|
||||||
|
|
||||||
/* pad left margin to the left edge */
|
/* pad left margin to the left edge */
|
||||||
#if 0
|
|
||||||
RECT leftMargin;
|
RECT leftMargin;
|
||||||
leftMargin.top = trackTop;
|
leftMargin.top = trackTop;
|
||||||
leftMargin.bottom = rcTracks.bottom;
|
leftMargin.bottom = rcTracks.bottom;
|
||||||
leftMargin.left = 0;
|
leftMargin.left = 0;
|
||||||
leftMargin.right = leftMarginWidth;
|
leftMargin.right = leftMarginWidth;
|
||||||
FillRect( hdc, &leftMargin, (HBRUSH)GetStockObject(LTGRAY_BRUSH));
|
DrawEdge(hdc, &leftMargin, BDR_SUNKENINNER | BDR_RAISEDOUTER, BF_ADJUST | BF_RIGHT);
|
||||||
#endif
|
FillRect(hdc, &leftMargin, (HBRUSH)GetStockObject(GRAY_BRUSH));
|
||||||
|
|
||||||
/* right margin */
|
/* right margin */
|
||||||
RECT rightMargin;
|
RECT rightMargin;
|
||||||
@ -179,7 +179,7 @@ void TrackView::paintTracks(HDC hdc, RECT rcTracks)
|
|||||||
rightMargin.bottom = rcTracks.bottom;
|
rightMargin.bottom = rcTracks.bottom;
|
||||||
rightMargin.left = trackLeft;
|
rightMargin.left = trackLeft;
|
||||||
rightMargin.right = rcTracks.right;
|
rightMargin.right = rcTracks.right;
|
||||||
// DrawEdge(hdc, &rightMargin, BDR_SUNKENINNER | BDR_RAISEDOUTER, BF_ADJUST | BF_LEFT);
|
DrawEdge(hdc, &rightMargin, BDR_SUNKENINNER | BDR_RAISEDOUTER, BF_ADJUST | BF_LEFT);
|
||||||
FillRect( hdc, &rightMargin, (HBRUSH)GetStockObject(LTGRAY_BRUSH));
|
FillRect( hdc, &rightMargin, (HBRUSH)GetStockObject(LTGRAY_BRUSH));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -214,7 +214,7 @@ void TrackView::setScrollPos(HWND hwnd, int newScrollPosX, int newScrollPosY)
|
|||||||
scrollPosX = max(scrollPosX, 0);
|
scrollPosX = max(scrollPosX, 0);
|
||||||
scrollPosY = max(scrollPosY, 0);
|
scrollPosY = max(scrollPosY, 0);
|
||||||
|
|
||||||
scrollPosY = min(scrollPosY, (lines - 1) - windowLines);
|
scrollPosY = min(scrollPosY, (lines) - windowLines);
|
||||||
|
|
||||||
if (oldScrollPosX != scrollPosX || oldScrollPosY != scrollPosY)
|
if (oldScrollPosX != scrollPosX || oldScrollPosY != scrollPosY)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user