// COption3DSettingDlg.cpp : 实现文件 // #include "stdafx.h" #include "GeoMative.h" #include "crossHole/COption3DSettingDlg.h" #include "afxdialogex.h" // COption3DSettingDlg 对话框 IMPLEMENT_DYNAMIC(COption3DSettingDlg, CDialog) COption3DSettingDlg::COption3DSettingDlg(CWnd* pParent /*=NULL*/) : CDialog(COption3DSettingDlg::IDD, pParent) { } COption3DSettingDlg::~COption3DSettingDlg() { } void COption3DSettingDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_COMBO_MEDIUM_TYPE, m_comMediumType); DDX_Control(pDX, IDC_EDIT_SCRIPT_NAME, m_editScriptName); DDX_Control(pDX, IDC_EDIT_TIME_INTERVAL, m_editTimeInterval); DDX_Control(pDX, IDC_EDIT_OPERATOR, m_editOperator); DDX_Control(pDX, IDC_EDIT_NOTE, m_editNote); } BEGIN_MESSAGE_MAP(COption3DSettingDlg, CDialog) END_MESSAGE_MAP() COption3DSettingDlg* COption3DSettingDlg::GetInstance() { static COption3DSettingDlg optionSettingDlg; return &optionSettingDlg; } // COption3DSettingDlg 消息处理程序 BOOL COption3DSettingDlg::OnInitDialog() { CDialog::OnInitDialog(); if (LANG_ZHCN == g_iUILanguage) { m_comMediumType.AddString(_T("跨孔")); m_comMediumType.AddString(_T("井地井")); //m_comMediumType.AddString(_T("自定义")); m_comMediumType.AddString(_T("AM排列")); } else { SetDlgItemText(IDC_STATIC_SCRIPT_NAME, _T("*Script Name")); SetDlgItemText(IDC_STATIC_MEDIUM_TYPE, _T("*Medium Type")); SetDlgItemText(IDC_STATIC_TIME_INTERVAL, _T("Time Interval")); SetDlgItemText(IDC_STATIC_OPERATOR, _T("Operator")); SetDlgItemText(IDC_STATIC_NOTE, _T("Note:")); m_comMediumType.AddString(_T("Cross Hole")); m_comMediumType.AddString(_T("Bipole Hole")); //m_comMediumType.AddString(_T("Custom")); m_comMediumType.AddString(_T("Pole-Pole AM")); } m_comMediumType.SetItemData(0, AR_CROSS_HOLE_GEOMATIVE); m_comMediumType.SetItemData(1, AR_CROSS_HOLE_GEOMATIVE); //m_comMediumType.SetItemData(2, AR_CUSTOM_2D_TYPE); m_comMediumType.SetItemData(2, AR_CROSS_HOLE_GEOMATIVE_AM); m_comMediumType.SetCurSel(-1); m_editTimeInterval.SetWindowTextA(_T("1000")); // TODO: 在此添加额外的初始化 ((CEdit*)GetDlgItem(IDC_EDIT_SCRIPT_NAME))->SetLimitText(20); ((CEdit*)GetDlgItem(IDC_EDIT_OPERATOR))->SetLimitText(20); ((CEdit*)GetDlgItem(IDC_EDIT_NOTE))->SetLimitText(50); return TRUE; // return TRUE unless you set the focus to a control // 异常: OCX 属性页应返回 FALSE } int COption3DSettingDlg::GetMediumType() //获取选中的装置类型 { UpdateData(TRUE); int iCurSel = m_comMediumType.GetCurSel(); if (-1 == iCurSel) { if (LANG_ZHCN == g_iUILanguage) AfxMessageBox(_T("请选择装置类型")); else MessageBoxEx(NULL, _T("Please select medium type"), STRING_MESSAGEBOXEX_TITLE, MB_OK, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US)); return 0; } return iCurSel;//m_comMediumType.GetItemData(iCurSel); } CString COption3DSettingDlg::GetScriptName() { CString strScriptName; m_editScriptName.GetWindowTextA(strScriptName); return strScriptName; } CString COption3DSettingDlg::GetTimeInterval() { CString strTimeInterval; m_editTimeInterval.GetWindowTextA(strTimeInterval); return strTimeInterval; } //获取操作员 CString COption3DSettingDlg::GetOperator() { CString strOperator; m_editOperator.GetWindowTextA(strOperator); return strOperator; } //获取备注 CString COption3DSettingDlg::GetNote() { CString strNote; m_editNote.GetWindowTextA(strNote); return strNote; }