From 37402ae2a2e382d0776054821b9e2dd09cfe2680 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Thu, 22 Nov 2007 21:44:18 +0000 Subject: [PATCH] paddin' --- synctracker2.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/synctracker2.cpp b/synctracker2.cpp index cbce712..33122e9 100644 --- a/synctracker2.cpp +++ b/synctracker2.cpp @@ -80,7 +80,7 @@ void paintTracks(HDC hdc, RECT rcTracks) int lastLine = scrollPosY + ((rcTracks.bottom - topMarginHeight) + (fontHeight - 1)) / fontHeight; int trackLeft = -scrollPosX; - for (int x = 0; x < 10; ++x) + for (int x = 0; x < 16; ++x) { int trackWidth = fontWidth * 5; @@ -97,7 +97,7 @@ void paintTracks(HDC hdc, RECT rcTracks) _snprintf_s(temp, 256, "track %d", x); SetBkMode(hdc, TRANSPARENT); TextOut(hdc, - trackLeft, 0, + topMargin.left, 0, temp, int(strlen(temp)) ); ExcludeClipRect(hdc, topMargin.left, topMargin.top, topMargin.right, topMargin.bottom); @@ -126,6 +126,24 @@ void paintTracks(HDC hdc, RECT rcTracks) } trackLeft += trackWidth; } + + /* pad top margin to the left edge */ + RECT topMargin; + topMargin.top = 0; + topMargin.bottom = topMarginHeight; + topMargin.left = trackLeft; + topMargin.right = rcTracks.right; + FillRect( hdc, &topMargin, (HBRUSH)GetStockObject(LTGRAY_BRUSH)); + + /* right margin */ + RECT rightMargin; + topMargin.top = topMarginHeight; + topMargin.bottom = rcTracks.bottom; + topMargin.left = trackLeft; + topMargin.right = rcTracks.right; + FillRect( hdc, &topMargin, (HBRUSH)GetStockObject(LTGRAY_BRUSH)); + + } void paintWindow(HWND hwnd)