a
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
// COption2DSettingDlg.cpp : 实现文件
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "GeoMative.h"
|
||||
#include "crossHole/COption2DSettingDlg.h"
|
||||
#include "afxdialogex.h"
|
||||
|
||||
|
||||
// COption2DSettingDlg 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(COption2DSettingDlg, CDialog)
|
||||
|
||||
COption2DSettingDlg::COption2DSettingDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog(COption2DSettingDlg::IDD, pParent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
COption2DSettingDlg::~COption2DSettingDlg()
|
||||
{
|
||||
}
|
||||
|
||||
void COption2DSettingDlg::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(COption2DSettingDlg, CDialog)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
COption2DSettingDlg* COption2DSettingDlg::GetInstance()
|
||||
{
|
||||
static COption2DSettingDlg optionSettingDlg;
|
||||
return &optionSettingDlg;
|
||||
}
|
||||
|
||||
// COption2DSettingDlg 消息处理程序
|
||||
BOOL COption2DSettingDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
if (LANG_ZHCN == g_iUILanguage)
|
||||
{
|
||||
m_comMediumType.AddString(_T("跨孔"));
|
||||
m_comMediumType.AddString(_T("井地井"));
|
||||
//m_comMediumType.AddString(_T("自定义"));
|
||||
}
|
||||
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.SetItemData(0, AR_CROSS_HOLE_GEOMATIVE);
|
||||
m_comMediumType.SetItemData(1, AR_CROSS_HOLE_GEOMATIVE);
|
||||
//m_comMediumType.SetItemData(2, AR_CUSTOM_2D_TYPE);
|
||||
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 COption2DSettingDlg::GetMediumType() //获取选中的装置类型
|
||||
{
|
||||
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 COption2DSettingDlg::GetScriptName()
|
||||
{
|
||||
CString strScriptName;
|
||||
m_editScriptName.GetWindowTextA(strScriptName);
|
||||
return strScriptName;
|
||||
}
|
||||
|
||||
|
||||
CString COption2DSettingDlg::GetTimeInterval()
|
||||
{
|
||||
CString strTimeInterval;
|
||||
m_editTimeInterval.GetWindowTextA(strTimeInterval);
|
||||
return strTimeInterval;
|
||||
}
|
||||
|
||||
//获取操作员
|
||||
CString COption2DSettingDlg::GetOperator()
|
||||
{
|
||||
CString strOperator;
|
||||
m_editOperator.GetWindowTextA(strOperator);
|
||||
return strOperator;
|
||||
}
|
||||
|
||||
//获取备注
|
||||
CString COption2DSettingDlg::GetNote()
|
||||
{
|
||||
CString strNote;
|
||||
m_editNote.GetWindowTextA(strNote);
|
||||
return strNote;
|
||||
}
|
||||
Reference in New Issue
Block a user