OAMPAGERCTRL.CPP
上传用户:lvjun8202
上传日期:2013-04-30
资源大小:797k
文件大小:2k
- // OAMPagerCtrl.cpp : implementation file
- //
- #include "stdafx.h"
- #include "OAM.h"
- #include "OAMPagerCtrl.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // COAMPagerCtrl
- COAMPagerCtrl::COAMPagerCtrl()
- {
- static BOOL bInit = FALSE;
- if (!bInit) {
- INITCOMMONCONTROLSEX sex;
- sex.dwSize = sizeof(INITCOMMONCONTROLSEX);
- sex.dwICC = ICC_PAGESCROLLER_CLASS|ICC_BAR_CLASSES;
- ::InitCommonControlsEx(&sex);
- bInit = TRUE;
- }
- }
- COAMPagerCtrl::~COAMPagerCtrl()
- {
- }
- BEGIN_MESSAGE_MAP(COAMPagerCtrl, CWnd)
- //{{AFX_MSG_MAP(COAMPagerCtrl)
- ON_NOTIFY_REFLECT_EX(PGN_SCROLL, OnPagerScroll)
- ON_NOTIFY_REFLECT_EX(PGN_CALCSIZE, OnPagerCalcSize)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- BOOL COAMPagerCtrl::Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)
- {
- return CWnd::Create(WC_PAGESCROLLER, NULL,
- dwStyle, CRect(0,0,0,0), pParentWnd, nID);
- }
- /////////////////////////////////////////////////////////////////////////////
- // COAMPagerCtrl message handlers
- BOOL COAMPagerCtrl::OnPagerCalcSize(NMPGCALCSIZE* pNMPGCalcSize, LRESULT* pResult)
- {
- switch(pNMPGCalcSize->dwFlag)
- {
- case PGF_CALCWIDTH:
- pNMPGCalcSize->iWidth = m_nWidth;
- break;
-
- case PGF_CALCHEIGHT:
- pNMPGCalcSize->iHeight = m_nHeight;
- break;
- }
-
- *pResult = 0;
- return FALSE; // Let parent handle message
- }
- BOOL COAMPagerCtrl::OnPagerScroll(NMPGSCROLL* pNMPGScroll, LRESULT* pResult)
- {
- *pResult = 0;
- return FALSE; // Let parent handle message
- }