// AllOptions.cpp : implementation file // #include "stdafx.h" #include "AllOptions.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CAllOptions IMPLEMENT_DYNAMIC(CAllOptions, CPropertySheet) CAllOptions::CAllOptions(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage) :CPropertySheet(nIDCaption, pParentWnd, iSelectPage) { } CAllOptions::CAllOptions(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage) :CPropertySheet(pszCaption, pParentWnd, iSelectPage) { AddPage(&m_MRCCompPage); AddPage(&m_PDFCompPage); AddPage(&m_SegmentationPage); AddPage(&m_CombinePage); AddPage(&m_ColorsPage); } CAllOptions::~CAllOptions() { } BEGIN_MESSAGE_MAP(CAllOptions, CPropertySheet) //{{AFX_MSG_MAP(CAllOptions) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CAllOptions message handlers BOOL CAllOptions::OnInitDialog() { BOOL bResult = CPropertySheet::OnInitDialog(); // TODO: Add your specialized code here return bResult; } ///////////////////////////////////////////////////////////////////////////// // PDFCompDPIOptionsDlg dialog PDFCompDPIOptionsDlg::PDFCompDPIOptionsDlg(CWnd* pParent /*=NULL*/) : CDialog(PDFCompDPIOptionsDlg::IDD, pParent) { //{{AFX_DATA_INIT(PDFCompDPIOptionsDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_Resolution.cx = 0 ; m_Resolution.cy = 0 ; } void PDFCompDPIOptionsDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(PDFCompDPIOptionsDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(PDFCompDPIOptionsDlg, CDialog) //{{AFX_MSG_MAP(PDFCompDPIOptionsDlg) // NOTE: the ClassWizard will add message map macros here //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // PDFCompDPIOptionsDlg message handlers void PDFCompDPIOptionsDlg::SetDPIResolution ( CSize resolution ) { m_Resolution = resolution ; } CSize PDFCompDPIOptionsDlg::GetDPIResolution ( ) { return m_Resolution ; } void PDFCompDPIOptionsDlg::OnOK() { CString str ; int nTemp = 0 ; GetDlgItem ( IDC_EDT_HORIZONTAL )->GetWindowText ( str ) ; nTemp =_ttoi ( str.GetBuffer ( str.GetLength ( ) ) ) ; if ( ( nTemp > 1000 ) || ( nTemp < 10 ) ) { MessageBox ( _T ( "Resolution should be between (10-1000)" ), _T ( "Error" ) ) ; str.Format ( _T ( "%d" ), m_Resolution.cx ) ; GetDlgItem ( IDC_EDT_HORIZONTAL )->SetWindowText ( str ) ; GetDlgItem ( IDC_EDT_HORIZONTAL )->SetFocus ( ) ; return ; } else { m_Resolution.cx = nTemp ; } str.ReleaseBuffer ( ) ; GetDlgItem ( IDC_EDT_VERTICAL )->GetWindowText ( str ) ; nTemp = _ttoi ( str.GetBuffer ( str.GetLength ( ) ) ) ; if ( ( nTemp > 1000 ) || ( nTemp < 10 ) ) { MessageBox ( _T ( "Resolution should be between (10-1000)" ), _T ( "Error" ) ) ; str.Format ( _T ( "%d" ), m_Resolution.cy ) ; GetDlgItem ( IDC_EDT_VERTICAL )->SetWindowText ( str ) ; GetDlgItem ( IDC_EDT_VERTICAL )->SetFocus ( ) ; return ; } else { m_Resolution.cy = nTemp ; } str.ReleaseBuffer ( ) ; CDialog::OnOK(); } BOOL PDFCompDPIOptionsDlg::OnInitDialog() { CDialog::OnInitDialog(); CString str ; str.Format ( _T ( "%d" ), m_Resolution.cx ) ; GetDlgItem ( IDC_EDT_HORIZONTAL )->SetWindowText ( str ) ; str.ReleaseBuffer ( ) ; str.Format ( _T ( "%d" ), m_Resolution.cy ) ; GetDlgItem ( IDC_EDT_VERTICAL )->SetWindowText ( str ) ; str.ReleaseBuffer ( ) ; CenterWindow ( ) ; return TRUE; }