Cleaned up window painting and fixed colours.

Signed-off-by: Xiaomao Chen <xiaomao5@live.com>
This commit is contained in:
Quantum 2013-06-14 19:30:29 -04:00
parent 01ac5a541f
commit d971915275
2 changed files with 2 additions and 21 deletions

View file

@ -18,8 +18,6 @@ protected:
LRESULT OnCreate();
LRESULT OnDestroy();
bool Play(WPARAM wCode, LPARAM lParam, bool down);
void OnPaint();
void PaintContent(PAINTSTRUCT *pps);
BOOL WinRegisterClass(WNDCLASS *pwc);
WORD GetQWERTYKeyCode(WORD wKeyCode);
WORD GetRealKeyCode(WORD wQWERTYCode);

View file

@ -58,6 +58,7 @@ int dnslen(LPWSTR dns)
BOOL MainWindow::WinRegisterClass(WNDCLASS *pwc)
{
pwc->style = CS_HREDRAW | CS_VREDRAW;
pwc->hbrBackground = (HBRUSH) (COLOR_3DFACE + 1);
return __super::WinRegisterClass(pwc);
}
@ -127,10 +128,7 @@ LRESULT MainWindow::OnCreate()
MessageBox(m_hwnd, L"Failed to open MIDI device!", L"Fatal Error", MB_ICONERROR);
this->piano = PianoControl::Create(NULL, m_hwnd, WS_VISIBLE | WS_CHILD, 0, 0, 0, 0);
this->piano->SetBackground(
(HBRUSH) DefWindowProc(m_hwnd, WM_CTLCOLORSTATIC,
(WPARAM) GetDC(m_volumeLabel),
(LPARAM) m_volumeLabel));
this->piano->SetBackground(GetSysColorBrush(COLOR_3DFACE));
{
keymap[VK_OEM_3] = 54; // `~ key
@ -204,18 +202,6 @@ HICON MainWindow::GetIcon()
return LoadIcon(GetInstance(), MAKEINTRESOURCE(RID_ICON));
}
void MainWindow::PaintContent(PAINTSTRUCT *pps)
{
}
void MainWindow::OnPaint()
{
PAINTSTRUCT ps;
BeginPaint(m_hwnd, &ps);
PaintContent(&ps);
EndPaint(m_hwnd, &ps);
}
WORD MainWindow::GetQWERTYKeyCode(WORD wKeyCode)
{
if (isQWERTY)
@ -304,9 +290,6 @@ LRESULT MainWindow::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_NCDESTROY:
PostQuitMessage(0);
break;
case WM_PAINT:
OnPaint();
return 0;
case WM_SIZE: {
RECT client;
HDWP hdwp;