?? rxbutton.cpp
字號:
// RxButton.cpp : implementation file
//
#include "stdafx.h"
#include "gdzc.h"
#include "RxButton.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRxButton
CRxButton::CRxButton()
{
m_up.LoadBitmap(IDB_BIT_UP);
m_down.LoadBitmap(IDB_BIT_DOWN);
}
CRxButton::~CRxButton()
{
m_up.DeleteObject();
m_down.DeleteObject();
}
BEGIN_MESSAGE_MAP(CRxButton, CButton)
//{{AFX_MSG_MAP(CRxButton)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRxButton message handlers
void CRxButton::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
CString sCaption;
CDC *pDC,memDC;
pDC=CDC::FromHandle(lpDrawItemStruct->hDC);
CFont font;
UINT state=lpDrawItemStruct->itemState;
this->GetWindowText(sCaption);
memDC.CreateCompatibleDC(pDC);
CRect rect=lpDrawItemStruct->rcItem;
font.CreatePointFont(160,"黑體",pDC);
pDC->SelectObject(&font);
if(state&ODS_FOCUS)
{
pDC->SetTextColor(RGB(0,0,0));
memDC.SelectObject(&m_down);
}
else
{
pDC->SetTextColor(RGB(255,255,255));
memDC.SelectObject(&m_up);
}
if(state&ODS_DISABLED)
{
pDC->SetTextColor(RGB(0,0,0));
memDC.SelectObject(&m_down);
}
pDC->BitBlt(0,0,rect.Width(),rect.Height(),&memDC,0,0,SRCCOPY);
pDC->SetBkMode(TRANSPARENT);
pDC->DrawText(sCaption,rect,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
font.DeleteObject();
memDC.DeleteDC();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -