// DialMeasuLoopTest.cpp : implementation file // #include "stdafx.h" #include "geomative.h" #include "DialMeasuLoopTest.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern int g_iUILanguage; ///////////////////////////////////////////////////////////////////////////// // CDialMeasuLoopTest dialog CDialMeasuLoopTest::CDialMeasuLoopTest(CWnd* pParent /*=NULL*/) : CDialog(CDialMeasuLoopTest::IDD, pParent) { //{{AFX_DATA_INIT(CDialMeasuLoopTest) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_iLoopCnt=1; } void CDialMeasuLoopTest::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDialMeasuLoopTest) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDialMeasuLoopTest, CDialog) //{{AFX_MSG_MAP(CDialMeasuLoopTest) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDialMeasuLoopTest message handlers void CDialMeasuLoopTest::OnOK() { // TODO: Add extra validation here CString strTxt = _T(""); GetDlgItem(IDC_EDIT_LOOP_CNT)->GetWindowText(strTxt); m_iLoopCnt = atoi(strTxt); if (m_iLoopCnt < 1 || m_iLoopCnt >999) { if (LANG_ZHCN == g_iUILanguage) AfxMessageBox(_T("The number of cycles must be between 1 and 999")); else MessageBoxEx(NULL, _T("Failed to view loop task information, data length error."), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); return; } CDialog::OnOK(); } BOOL CDialMeasuLoopTest::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here GetDlgItem(IDC_EDIT_LOOP_CNT)->SetWindowText(_T("1")); ((CEdit*)(GetDlgItem(IDC_EDIT_LOOP_CNT)))->SetLimitText(3); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }