// ZoneOpts.cpp : implementation file // #include "stdafx.h" #include "ocrutil.h" #include "ZoneOpts.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CAutoZoneOptions dialog CAutoZoneOptions::CAutoZoneOptions(pAUTOZONEOPTS pZoneOpts, CWnd* pParent /*=NULL*/) : CDialog(CAutoZoneOptions::IDD, pParent) { //{{AFX_DATA_INIT(CAutoZoneOptions) m_bForceSingleColumn = FALSE; m_bShowGridLines = FALSE; //}}AFX_DATA_INIT m_pZoneOpts = pZoneOpts; } void CAutoZoneOptions::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAutoZoneOptions) DDX_Control(pDX, IDC_CHK_GRID_LINES, m_chkShowGrid); DDX_Control(pDX, IDC_CHK_FORCE_SINGLE_COL, m_chkForceCol); DDX_Control(pDX, IDC_CMB_PAGE_PARSER, m_cmbParser); DDX_Check(pDX, IDC_CHK_FORCE_SINGLE_COL, m_bForceSingleColumn); DDX_Check(pDX, IDC_CHK_GRID_LINES, m_bShowGridLines); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CAutoZoneOptions, CDialog) //{{AFX_MSG_MAP(CAutoZoneOptions) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CAutoZoneOptions message handlers BOOL CAutoZoneOptions::OnInitDialog() { CDialog::OnInitDialog(); m_cmbParser.AddString(TEXT("Auto")); m_cmbParser.AddString(TEXT("Legacy")); m_cmbParser.AddString(TEXT("Standard")); m_cmbParser.AddString(TEXT("Fast")); m_cmbParser.SetItemData(0, PARSE_AUTO); m_cmbParser.SetItemData(1, PARSE_LEGACY); m_cmbParser.SetItemData(2, PARSE_STANDARD); m_cmbParser.SetItemData(3, PARSE_FAST); m_cmbParser.SetCurSel((int)m_pZoneOpts->Parser); m_chkShowGrid.SetCheck(m_pZoneOpts->bVisibleGridLines); m_chkForceCol.SetCheck(m_pZoneOpts->bEnableForceSingleColumn); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CAutoZoneOptions::OnOK() { UpdateData(); m_pZoneOpts->Parser = (PAGEPARSER)m_cmbParser.GetItemData(m_cmbParser.GetCurSel()); m_pZoneOpts->bVisibleGridLines = m_bShowGridLines; m_pZoneOpts->bEnableForceSingleColumn = m_bForceSingleColumn; CDialog::OnOK(); }