PropertySubSheet1.cpp
上传用户:yongqian
上传日期:2007-01-02
资源大小:74k
文件大小:2k
源码类别:
PropertySheet
开发平台:
Visual C++
- // PropertySubSheet1.cpp : implementation file
- //
- #include "stdafx.h"
- #include "propinprop.h"
- #include "PropertySubSheet1.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // PropertySubSheet1
- IMPLEMENT_DYNAMIC(PropertySubSheet1, CPropertySheet)
- PropertySubSheet1::PropertySubSheet1()
- {
- }
- PropertySubSheet1::~PropertySubSheet1()
- {
- }
- BOOL PropertySubSheet1::CheckKey(char cAccel)
- {
- CTabCtrl *pTab = GetTabControl();
- int n = pTab->GetItemCount();
- char buf[80], shortcut[3];
- TC_ITEM tcItem;
- tcItem.mask = TCIF_TEXT;
- tcItem.pszText = buf;
- shortcut[0] = _T('&');
- shortcut[2] = _T(' ');
- for( int i = 0; i < n; i++ ) {
- tcItem.cchTextMax = 79;
- pTab->GetItem( i, &tcItem );
- shortcut[1] = cAccel;
- // convert string characters into uppercase characters
- short nCount = 0;
- while( buf[nCount] != ' ' ) {
- buf[nCount] = toupper(buf[nCount]);
- ++nCount;
- }
- if( strstr( buf, shortcut ) )
- {
- SetActivePage( i );
- return TRUE;
- }
- }
- return FALSE;
- }
- BOOL PropertySubSheet1::PreTranslateMessage(MSG* pMsg)
- {
- if( pMsg->message == WM_SYSKEYDOWN && pMsg->wParam > 32 )
- {
- if(CheckKey(pMsg->wParam))
- return TRUE;
- return(GetParent()->GetParent()->PreTranslateMessage(pMsg));
- }
- return CPropertySheet::PreTranslateMessage(pMsg);
- }
- BEGIN_MESSAGE_MAP(PropertySubSheet1, CPropertySheet)
- //{{AFX_MSG_MAP(PropertySubSheet1)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // PropertySubSheet1 message handlers