Property.cpp
上传用户:yongqian
上传日期:2007-01-02
资源大小:74k
文件大小:3k
- // Property.cpp : implementation file
- //
- #include "stdafx.h"
- #include "propinprop.h"
- #include "PropertySheet1.h"
- #include "PropertySubSheet1.h"
- #include "Page1.h"
- #include "Page2.h"
- #include "Page3.h"
- #include "Property.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CProperty dialog
- CPropertyDlg::CPropertyDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CPropertyDlg::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CPropertyDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
- CPropertyDlg::~CPropertyDlg()
- {
- if(m_pPage1)
- delete m_pPage1;
-
- if(m_pPage2)
- delete m_pPage2;
- if(m_pPage3)
- delete m_pPage3;
- if(m_pSheet)
- delete m_pSheet;
- }
- void CPropertyDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CProperty)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
- BOOL CPropertyDlg::PreTranslateMessage(MSG* pMsg)
- {
- if( pMsg->message == WM_SYSKEYDOWN && pMsg->wParam > 32 )
- {
-
- if(m_pSheet->CheckKey(pMsg->wParam))
- {
- return TRUE;
- }
- else
- if(m_pPage1->m_pSubSheet1->CheckKey(pMsg->wParam))
- {
- return TRUE;
- }
- else
- if(m_pPage2->m_pSubSheet2)
- {
- m_pPage2->m_pSubSheet2->CheckKey(pMsg->wParam);
- return TRUE;
- }
- }
- return CDialog::PreTranslateMessage(pMsg);
-
- }
- BOOL CPropertyDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- m_pPage1 = new Page1;
- m_pPage2 = new Page2;
- m_pPage3 = new Page3;
-
- m_pSheet = new PropertySheet1;
- m_pSheet->AddPage(m_pPage1);
- m_pSheet->AddPage(m_pPage2);
- m_pSheet->AddPage(m_pPage3);
- m_pSheet->Create(this, WS_CHILD | WS_VISIBLE, 0);
- m_pSheet->ModifyStyleEx (0, WS_EX_CONTROLPARENT);
- m_pSheet->ModifyStyle( 0, WS_TABSTOP );
-
- CRect rcSheet;
-
- GetDlgItem( IDC_PLACEHOLDER )->GetWindowRect( &rcSheet );
- ScreenToClient( &rcSheet );
-
- m_pSheet->SetWindowPos( NULL, rcSheet.left-7, rcSheet.top-7, 0,0,
- SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE );
-
- return TRUE;
- }
- BEGIN_MESSAGE_MAP(CPropertyDlg, CDialog)
- //{{AFX_MSG_MAP(CPropertyDlg)
- // NOTE: the ClassWizard will add message map macros here
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CPropertyDlg message handlers