// ABDlg.cpp : implementation file // #include "stdafx.h" #include "cldprn32.h" #include "ABDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CAnnotationBoxDlg dialog CAnnotationBoxDlg::CAnnotationBoxDlg(CAnnotationBox& AnnotationBox, CWnd* pParent /*=NULL*/) : CDialog(CAnnotationBoxDlg::IDD, pParent), m_AnnotationBox(AnnotationBox), m_TextStringChkBox(IDC_EDIT_TEXTSTRING) { //{{AFX_DATA_INIT(CAnnotationBoxDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CAnnotationBoxDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAnnotationBoxDlg) DDX_Control(pDX, IDC_CHECK_TEXTSTRING, m_TextStringChkBox); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CAnnotationBoxDlg, CDialog) //{{AFX_MSG_MAP(CAnnotationBoxDlg) ON_BN_CLICKED(IDC_BUTTON_UPDATE, OnButtonUpdate) //}}AFX_MSG_MAP END_MESSAGE_MAP() void CAnnotationBoxDlg::InitializeFields() { // Annotation Position SetDlgItemInt(IDC_EDIT_ANNOTATIONPOSITION, m_AnnotationBox.m_uAnnotationPosition, FALSE); // Text String SetDlgItemText(IDC_EDIT_TEXTSTRING, m_AnnotationBox.m_sTextString); } ///////////////////////////////////////////////////////////////////////////// // CAnnotationBoxDlg message handlers BOOL CAnnotationBoxDlg::OnInitDialog() { CDialog::OnInitDialog(); m_TextStringChkBox.m_bChecked = m_AnnotationBox.m_bTextStringChecked; m_TextStringChkBox.Initialize(); InitializeFields(); if (m_TextStringChkBox.m_bChecked) { GetDlgItem(IDC_EDIT_TEXTSTRING)->SetFocus(); return FALSE; } return TRUE; } void CAnnotationBoxDlg::OnButtonUpdate() { // Text String GetDlgItemText(IDC_EDIT_TEXTSTRING, m_AnnotationBox.m_sTextString); m_AnnotationBox.m_bTextStringChecked = m_TextStringChkBox.m_bChecked; CDialog::OnOK(); }