diff options
Diffstat (limited to 'Checklist/ExtraPage.cpp')
-rw-r--r-- | Checklist/ExtraPage.cpp | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/Checklist/ExtraPage.cpp b/Checklist/ExtraPage.cpp new file mode 100644 index 0000000..dccc325 --- /dev/null +++ b/Checklist/ExtraPage.cpp @@ -0,0 +1,70 @@ +// ExtraPage.cpp : implementation file +// + +#include "stdafx.h" +#include "ExtraPage.h" + +#include <mystring.h> + +///////////////////////////////////////////////////////////////////////////// +// CExtraPage property page + + +///////////////////////////////////////////////////////////////////////////// +// CExtraPage message handlers + +LRESULT CExtraPage::OnSetActive(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) +{ + ASSERT(m_pComponent != NULL); + m_pParentSheet->SetWizardButtons(PSWIZB_BACK | PSWIZB_NEXT); + return m_pComponent->IsEnabled() ? 0 : -1; +} + +LRESULT CExtraPage::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + // Set the Proppage Rectangle to the Place Holder + ::GetWindowRect(GetDlgItem(IDC_PROPHOLDER), &m_rcPropPage); + ScreenToClient(&m_rcPropPage); + + // Remove Place Holder Control + ::DestroyWindow(GetDlgItem(IDC_PROPHOLDER)); + + string sFormat; + GetDlgItemText(IDC_HEADERTEXT, sFormat.get_buffer(512), 512); + sFormat.release_buffer(); + + string sText; + sText.format(sFormat, (LPCTSTR)m_pComponent->GetName()); + + SetDlgItemText(IDC_HEADERTEXT, sText); + + m_pPropPage->Create(*this, m_rcPropPage, true); + SetWindowLong(GWL_EXSTYLE, GetWindowLong(GWL_EXSTYLE) & WS_EX_CONTROLPARENT); + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE +} + +LRESULT CExtraPage::OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) +{ + // If we have a PropPage then Save it + if(m_pPropPage != NULL) + m_pPropPage->Apply(); + + return FALSE; +} + +LRESULT CExtraPage::OnHelp(int idCtrl, LPNMHDR pnmh, BOOL& bHandled) +{ + WinHelp(NS_HELP_FILE, HELP_FINDER, 0); + return 1; +} + + +LRESULT CExtraPage::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + // If we have a PropPage then Close it + if(m_pPropPage != NULL) + m_pPropPage->Destroy(); + + return 0; +} |