Formatting and removed ini-file from the vs08 project.

This commit is contained in:
Erik Faye-Lund 2009-01-14 22:58:53 +00:00
parent bd4c5d31b3
commit e8f1727b4c
3 changed files with 31 additions and 36 deletions

View File

@ -183,10 +183,6 @@
>
</File>
<File
RelativePath=".\inifile.cpp"
>
</File>
<File
RelativePath="..\sync\network.cpp"
>
</File>

View File

@ -167,7 +167,7 @@ std::string fileName;
void fileNew()
{
/* document.purgeUnusedTracks(); */
// document.purgeUnusedTracks();
for (size_t i = 0; i < document.getTrackCount(); ++i)
{
document.getTrack(i).truncate();

View File

@ -29,26 +29,6 @@ static int getMaxCharacterWidthFromString(HDC hdc, TCHAR *chars)
return getMaxCharacterWidth(hdc, chars, _tcslen(chars));
}
void TrackView::setFont(HFONT font)
{
this->font = font;
assert(NULL != hwnd);
HDC hdc = GetDC(hwnd);
SelectObject(hdc, font);
TEXTMETRIC tm;
GetTextMetrics(hdc, &tm);
rowHeight = tm.tmHeight + tm.tmExternalLeading;
fontWidth = tm.tmAveCharWidth;
trackWidth = getMaxCharacterWidthFromString(hdc, _T("0123456789.")) * 16;
topMarginHeight = rowHeight + 4;
leftMarginWidth = getMaxCharacterWidthFromString(hdc, _T("0123456789abcdefh")) * 8;
}
TrackView::TrackView()
{
scrollPosX = 0;
@ -97,6 +77,25 @@ TrackView::~TrackView()
DeleteObject(rowSelectPen);
}
void TrackView::setFont(HFONT font)
{
this->font = font;
assert(NULL != hwnd);
HDC hdc = GetDC(hwnd);
SelectObject(hdc, font);
TEXTMETRIC tm;
GetTextMetrics(hdc, &tm);
rowHeight = tm.tmHeight + tm.tmExternalLeading;
fontWidth = tm.tmAveCharWidth;
trackWidth = getMaxCharacterWidthFromString(hdc, _T("0123456789.")) * 16;
topMarginHeight = rowHeight + 4;
leftMarginWidth = getMaxCharacterWidthFromString(hdc, _T("0123456789abcdefh")) * 8;
}
int TrackView::getScreenY(int row) const
{
return topMarginHeight + (row * rowHeight) - scrollPosY;