home *** CD-ROM | disk | FTP | other *** search
- // Pages.cpp : implementation file
- //
-
- #include "stdafx.h"
- #include "resource.h"
- #include "Pages.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- IMPLEMENT_DYNCREATE(CColorPage, CPropertyPage)
- IMPLEMENT_DYNCREATE(CComparePage, CPropertyPage)
- IMPLEMENT_DYNCREATE(CFontPage, CPropertyPage)
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CColorPage property page
-
- CColorPage::CColorPage() : CPropertyPage(CColorPage::IDD)
- {
- //{{AFX_DATA_INIT(CColorPage)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- }
-
- CColorPage::~CColorPage()
- {
- }
-
- void CColorPage::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CColorPage)
- // NOTE: the ClassWizard will add DDX and DDV calls here
- //}}AFX_DATA_MAP
- }
-
-
- BEGIN_MESSAGE_MAP(CColorPage, CPropertyPage)
- //{{AFX_MSG_MAP(CColorPage)
- // NOTE: the ClassWizard will add message map macros here
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CComparePage property page
-
- CComparePage::CComparePage() : CPropertyPage(CComparePage::IDD)
- {
- //{{AFX_DATA_INIT(CComparePage)
- m_bIgnoreCase = FALSE;
- m_bIgnoreWhiteSpace = FALSE;
- //}}AFX_DATA_INIT
- }
-
- CComparePage::~CComparePage()
- {
- }
-
- void CComparePage::DoDataExchange(CDataExchange* pDX)
- {
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CComparePage)
- DDX_Control(pDX, IDC_TRACKBAR1, m_Slider);
- DDX_Check(pDX, IDC_CHECK_IGNORE_CASE, m_bIgnoreCase);
- DDX_Check(pDX, IDC_CHECK_IGNORE_WHITE, m_bIgnoreWhiteSpace);
- //}}AFX_DATA_MAP
-
- if (pDX->m_bSaveAndValidate)
- {
- m_uReadAheadOptLevel = m_Slider.GetPos();
- }
- else
- {
- m_Slider.SetPos(m_uReadAheadOptLevel);
- }
- }
-
-
- BEGIN_MESSAGE_MAP(CComparePage, CPropertyPage)
- //{{AFX_MSG_MAP(CComparePage)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- BOOL CComparePage::OnInitDialog()
- {
- CPropertyPage::OnInitDialog();
-
- m_Slider.SetRange(0, 4);
-
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CFontPage property page
-
- CFontPage::CFontPage() : CPropertyPage(CFontPage::IDD)
- {
- //{{AFX_DATA_INIT(CFontPage)
- m_FontName = _T("");
- m_FontSize = _T("");
- //}}AFX_DATA_INIT
- }
-
- CFontPage::~CFontPage()
- {
- }
-
- void CFontPage::DoDataExchange(CDataExchange* pDX)
- {
- if (!pDX->m_bSaveAndValidate) //updating the controls
- {
- // Update FaceName and Size CString variables that
- // are assocated with statics on the page.
- m_FontName = m_CharacterFormat.szFaceName;
- wsprintf(m_FontSize.GetBufferSetLength(32), "%ld Points", m_CharacterFormat.yHeight/20);
- m_FontSize.ReleaseBuffer();
- }
- CPropertyPage::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CFontPage)
- DDX_Text(pDX, IDC_STATIC_FONT, m_FontName);
- DDX_Text(pDX, IDC_STATIC_SIZE, m_FontSize);
- //}}AFX_DATA_MAP
-
- }
-
-
- BEGIN_MESSAGE_MAP(CFontPage, CPropertyPage)
- //{{AFX_MSG_MAP(CFontPage)
- ON_BN_CLICKED(IDC_BUTTON_FONT, OnButtonFont)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
-
-
-
- void CFontPage::OnButtonFont()
- {
- CFontDialog dlg(m_CharacterFormat);
-
- if(dlg.DoModal() == IDOK)
- {
- dlg.GetCharFormat(m_CharacterFormat);
- UpdateData(FALSE);
- }
- }
-
- void CFontPage::SetCharacterFormat(CHARFORMAT& CharFormat)
- {
- m_CharacterFormat = CharFormat;
- }
-
-
- void CFontPage::GetCharacterFormat(CHARFORMAT& CharFormat) const
- {
- CharFormat = m_CharacterFormat;
- }
-