// SegmentInfo.cpp : implementation file // #include "stdafx.h" #include "segdemo.h" #include "SegmentInfoDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSegmentInfoDlg dialog CSegmentInfoDlg::CSegmentInfoDlg(CWnd* pParent /*=NULL*/) : CDialog(CSegmentInfoDlg::IDD, pParent) { //{{AFX_DATA_INIT(CSegmentInfoDlg) m_uBottom = 0; m_uLeft = 0; m_uRight = 0; m_uTop = 0; m_edtType = _T(""); //}}AFX_DATA_INIT } void CSegmentInfoDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSegmentInfoDlg) DDX_Text(pDX, IDC_BOTTOM, m_uBottom); DDX_Text(pDX, IDC_LEFT, m_uLeft); DDX_Text(pDX, IDC_RIGHT, m_uRight); DDX_Text(pDX, IDC_TOP, m_uTop); DDX_Text(pDX, IDC_SEGTYPE, m_edtType); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CSegmentInfoDlg, CDialog) //{{AFX_MSG_MAP(CSegmentInfoDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSegmentInfoDlg message handlers BOOL CSegmentInfoDlg::OnInitDialog() { CDialog::OnInitDialog(); if(!m_pSegInfo) return FALSE; UpdateData(TRUE); m_uBottom = m_pSegInfo->rcRect.bottom; m_uLeft = m_pSegInfo->rcRect.left; m_uRight = m_pSegInfo->rcRect.right; m_uTop = m_pSegInfo->rcRect.top; switch(m_pSegInfo->SegType) { case SEGTYPE_BACKGROUND: m_edtType = TEXT("Back Ground segment"); break; case SEGTYPE_ONE_COLORED: m_edtType = TEXT("One Color segment"); break; case SEGTYPE_TEXT_1BIT_BW: m_edtType = TEXT("Text segment 1-Bit(B & W)"); break; case SEGTYPE_TEXT_1BIT_COLORED: m_edtType = TEXT("Text segment 1-Bit(Colored)"); break; case SEGTYPE_TEXT_2BIT_BW: m_edtType = TEXT("Text segment 2-Bit(B & W)"); break; case SEGTYPE_TEXT_2BIT_COLORED: m_edtType = TEXT("Text segment 2-Bit(Colored)"); break; case SEGTYPE_GRAYSCALE_2BIT: m_edtType = TEXT("Grayscale 2-Bit segment"); break; case SEGTYPE_GRAYSCALE_8BIT: m_edtType = TEXT("Grayscale 8-Bit segment"); break; default: m_edtType = TEXT("Picture segment"); break; } UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CSegmentInfoDlg::OnOK() { UpdateData(TRUE); m_pSegInfo->rcRect.top = m_uTop; m_pSegInfo->rcRect.left = m_uLeft; m_pSegInfo->rcRect.bottom = m_uBottom; m_pSegInfo->rcRect.right = m_uRight; UpdateData(FALSE); CDialog::OnOK(); }