Ôàéë MyCtrlCtl.cpp - ÷àñòü 5
ETO_CLIPPED, rcBounds, strCaption, strCaption.GetLength(),NULL);
CString strTick;
strTick.Format("%d",m_tick);
pdc->ExtTextOut((rcBounds.left + rcBounds.right)/2,(rcBounds.top + tm.tmHeight),
ETO_CLIPPED, rcBounds, strTick, strTick.GetLength(),NULL);
pdc->RestoreDC(-1);
}
/////////////////////////////////////////////////////////////////////////////
// CMyCtrlCtrl::DoPropExchange - Persistence support
void CMyCtrlCtrl::DoPropExchange(CPropExchange* pPX)
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
PX_Short(pPX, _T("Shape"), m_nShape, 0);
PX_Long(pPX, _T("SelectColor"), (long&) m_selectColor, RGB(255,0,0));
PX_Long(pPX, _T("TextColor"), (long&) m_textColor, RGB(0,0,0));
PX_Long(pPX, _T("Sleep"), m_timeSleep, 1000);
}
/////////////////////////////////////////////////////////////////////////////
// CMyCtrlCtrl::OnResetState - Reset control to default state
void CMyCtrlCtrl::OnResetState()
{
COleControl::OnResetState(); // Resets defaults found in DoPropExchange
// TODO: Reset any other control state here.
}
/////////////////////////////////////////////////////////////////////////////
// CMyCtrlCtrl::AboutBox - Display an "About" box to the user
void CMyCtrlCtrl::AboutBox()
{
CDialog dlgAbout(IDD_ABOUTBOX_MYCTRL);
dlgAbout.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CMyCtrlCtrl message handlers
short CMyCtrlCtrl::GetShape()
{
return m_nShape;