Formatting and removed ini-file from the vs08 project.
This commit is contained in:
parent
bd4c5d31b3
commit
e8f1727b4c
@ -183,10 +183,6 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath=".\inifile.cpp"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
|
||||||
RelativePath="..\sync\network.cpp"
|
RelativePath="..\sync\network.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
|||||||
@ -13,11 +13,11 @@
|
|||||||
|
|
||||||
// Windows XP look and feel. Seems to enable Vista look as well.
|
// Windows XP look and feel. Seems to enable Vista look as well.
|
||||||
#pragma comment(linker, \
|
#pragma comment(linker, \
|
||||||
"\"/manifestdependency:type='Win32' "\
|
"\"/manifestdependency:type='Win32' " \
|
||||||
"name='Microsoft.Windows.Common-Controls' "\
|
"name='Microsoft.Windows.Common-Controls' " \
|
||||||
"version='6.0.0.0' "\
|
"version='6.0.0.0' " \
|
||||||
"processorArchitecture='*' "\
|
"processorArchitecture='*' " \
|
||||||
"publicKeyToken='6595b64144ccf1df' "\
|
"publicKeyToken='6595b64144ccf1df' " \
|
||||||
"language='*'\"")
|
"language='*'\"")
|
||||||
|
|
||||||
#include "trackview.h"
|
#include "trackview.h"
|
||||||
@ -167,7 +167,7 @@ std::string fileName;
|
|||||||
|
|
||||||
void fileNew()
|
void fileNew()
|
||||||
{
|
{
|
||||||
/* document.purgeUnusedTracks(); */
|
// document.purgeUnusedTracks();
|
||||||
for (size_t i = 0; i < document.getTrackCount(); ++i)
|
for (size_t i = 0; i < document.getTrackCount(); ++i)
|
||||||
{
|
{
|
||||||
document.getTrack(i).truncate();
|
document.getTrack(i).truncate();
|
||||||
@ -428,7 +428,7 @@ static LRESULT CALLBACK mainWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
|
|||||||
SendMessage(statusBarWin, SB_SETTEXT, 1, (LPARAM)temp);
|
SendMessage(statusBarWin, SB_SETTEXT, 1, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_TRACKCHANGED:
|
case WM_TRACKCHANGED:
|
||||||
{
|
{
|
||||||
TCHAR temp[256];
|
TCHAR temp[256];
|
||||||
@ -436,7 +436,7 @@ static LRESULT CALLBACK mainWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
|
|||||||
SendMessage(statusBarWin, SB_SETTEXT, 2, (LPARAM)temp);
|
SendMessage(statusBarWin, SB_SETTEXT, 2, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_CURRVALDIRTY:
|
case WM_CURRVALDIRTY:
|
||||||
{
|
{
|
||||||
TCHAR temp[256];
|
TCHAR temp[256];
|
||||||
|
|||||||
@ -29,26 +29,6 @@ static int getMaxCharacterWidthFromString(HDC hdc, TCHAR *chars)
|
|||||||
return getMaxCharacterWidth(hdc, chars, _tcslen(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()
|
TrackView::TrackView()
|
||||||
{
|
{
|
||||||
scrollPosX = 0;
|
scrollPosX = 0;
|
||||||
@ -72,7 +52,7 @@ TrackView::TrackView()
|
|||||||
|
|
||||||
rowPen = CreatePen(PS_SOLID, 1, darken(GetSysColor(COLOR_WINDOW), 0.7f));
|
rowPen = CreatePen(PS_SOLID, 1, darken(GetSysColor(COLOR_WINDOW), 0.7f));
|
||||||
rowSelectPen = CreatePen(PS_SOLID, 1, darken(GetSysColor(COLOR_HIGHLIGHT), 0.7f));
|
rowSelectPen = CreatePen(PS_SOLID, 1, darken(GetSysColor(COLOR_HIGHLIGHT), 0.7f));
|
||||||
|
|
||||||
lerpPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
|
lerpPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0));
|
||||||
cosinePen = CreatePen(PS_SOLID, 2, RGB(0, 255, 0));
|
cosinePen = CreatePen(PS_SOLID, 2, RGB(0, 255, 0));
|
||||||
rampPen = CreatePen(PS_SOLID, 2, RGB(0, 0, 255));
|
rampPen = CreatePen(PS_SOLID, 2, RGB(0, 0, 255));
|
||||||
@ -97,6 +77,25 @@ TrackView::~TrackView()
|
|||||||
DeleteObject(rowSelectPen);
|
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
|
int TrackView::getScreenY(int row) const
|
||||||
{
|
{
|
||||||
return topMarginHeight + (row * rowHeight) - scrollPosY;
|
return topMarginHeight + (row * rowHeight) - scrollPosY;
|
||||||
@ -200,7 +199,7 @@ void TrackView::paintTracks(HDC hdc, RECT rcTracks)
|
|||||||
{
|
{
|
||||||
const SyncDocument *doc = getDocument();
|
const SyncDocument *doc = getDocument();
|
||||||
if (NULL == doc) return;
|
if (NULL == doc) return;
|
||||||
|
|
||||||
TCHAR temp[256];
|
TCHAR temp[256];
|
||||||
|
|
||||||
int firstRow = editRow - windowRows / 2 - 1;
|
int firstRow = editRow - windowRows / 2 - 1;
|
||||||
@ -841,7 +840,7 @@ void TrackView::editDelete()
|
|||||||
{
|
{
|
||||||
SyncDocument *doc = getDocument();
|
SyncDocument *doc = getDocument();
|
||||||
if (NULL == doc) return;
|
if (NULL == doc) return;
|
||||||
|
|
||||||
int selectLeft = min(selectStartTrack, selectStopTrack);
|
int selectLeft = min(selectStartTrack, selectStopTrack);
|
||||||
int selectRight = max(selectStartTrack, selectStopTrack);
|
int selectRight = max(selectStartTrack, selectStopTrack);
|
||||||
int selectTop = min(selectStartRow, selectStopRow);
|
int selectTop = min(selectStartRow, selectStopRow);
|
||||||
@ -889,7 +888,7 @@ void TrackView::editBiasValue(float amount)
|
|||||||
int selectRight = max(selectStartTrack, selectStopTrack);
|
int selectRight = max(selectStartTrack, selectStopTrack);
|
||||||
int selectTop = min(selectStartRow, selectStopRow);
|
int selectTop = min(selectStartRow, selectStopRow);
|
||||||
int selectBottom = max(selectStartRow, selectStopRow);
|
int selectBottom = max(selectStartRow, selectStopRow);
|
||||||
|
|
||||||
if (0 == getTrackCount())
|
if (0 == getTrackCount())
|
||||||
{
|
{
|
||||||
MessageBeep(-1);
|
MessageBeep(-1);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user