CRect increaseTempRect(increaseButtonRect);
increaseTempRect += CRect(1, 1, 1, 1);
dc.Rectangle(&increaseTempRect);
dc.FillSolidRect(&increaseButtonRect, ::GetSysColor(COLOR_BTNFACE));
if (increaseButtonClicked){
dc.Draw3dRect(increaseButtonRect, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DLIGHT));
}else{
dc.Draw3dRect(increaseButtonRect, ::GetSysColor(COLOR_3DLIGHT), ::GetSysColor(COLOR_3DSHADOW));
}
dc.SetBkColor(::GetSysColor(COLOR_BTNFACE));
dc.SetTextColor(::GetSysColor(COLOR_BTNTEXT));
if (increaseButtonClicked){
CRect Rect = increaseButtonRect;
Rect += CRect(0, 0, 2, 2);
dc.DrawText(L"Increase", &Rect, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
}else{
dc.DrawText(L"Increase", &increaseButtonRect, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
}
CRect decreaseTempRect(decreaseButtonRect);
decreaseTempRect += CRect(1, 1, 1, 1);
dc.Rectangle(&decreaseTempRect);
dc.FillSolidRect(&decreaseButtonRect, ::GetSysColor(COLOR_BTNFACE));
if (decreaseButtonClicked){
dc.Draw3dRect(decreaseButtonRect, ::GetSysColor(COLOR_3DSHADOW), ::GetSysColor(COLOR_3DLIGHT));
}else{
dc.Draw3dRect(decreaseButtonRect, ::GetSysColor(COLOR_3DLIGHT), ::GetSysColor(COLOR_3DSHADOW));
}
dc.SetBkColor(::GetSysColor(COLOR_BTNFACE));
dc.SetTextColor(::GetSysColor(COLOR_BTNTEXT));
if (decreaseButtonClicked){
CRect Rect = decreaseButtonRect;
Rect += CRect(0, 0, 2, 2);
dc.DrawText(L"Decrease", &Rect, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
}else{
dc.DrawText(L"Decrease", &decreaseButtonRect, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
}
'old drawer > C, C++, MFC' 카테고리의 다른 글
[MFC] 실습3. Rect를 통해 버튼 그리기 & 비트맵 등록하기 예제 프로젝트 (0) | 2011.10.11 |
---|---|
[MFC] Bitmap 등록 후 화면에 그리기 (0) | 2011.10.11 |
[MFC] ListCtrl 구현 관련 사이트 모음 (3) | 2011.07.29 |
[MFC] error C2593: 'operator +='이(가) 모호합니다. (0) | 2011.07.25 |
[MFC] error C2664: 'CWnd::MessageBoxW' : 매개 변수 1을(를) 'CMainFrame *const '~'LPCTSTR'(으)로 변환할 수 없습니다. (1) | 2011.07.22 |