// GoalLayerDlg.cpp :implementation file #include "stdafx.h" #include "GoalLayerDlg.h" #include "Resource.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif // 创建层名为csCurLayer的新图层 void CreateLayer(const CString &csCurLayer); // 获得层表管理器的记录,add xly 100617 void GetLayerDes(CStringArray &curLayerNameAry, CStringArray &layerCon); CGoalLayerDlg::CGoalLayerDlg(CWnd* pParent /*=NULL*/) : GlwCAcUiDialog(CGoalLayerDlg::IDD, pParent) { //{{AFX_DATA_INIT(CGoalLayerDlg) //}}AFX_DATA_INIT } CGoalLayerDlg::~CGoalLayerDlg() { } void CGoalLayerDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CGoalLayerDlg) DDX_Text(pDX, IDC_EDT_GOALLAY, m_csGoaleLayer); DDX_Control(pDX, IDC_LST_ALLLAYER, m_wndLstLayerAll); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CGoalLayerDlg, GlwCAcUiDialog) ON_BN_CLICKED(IDC_OK, OnOK) ON_NOTIFY(NM_CLICK, IDC_LST_ALLLAYER, OnClickListLayer) END_MESSAGE_MAP() BOOL CGoalLayerDlg::OnInitDialog() { CDialog::OnInitDialog(); // 获得本图中的所有图层名称以及描述 GetAllLayerNames(); // 初始化表格数据 CRect rect; m_wndLstLayerAll.GetWindowRect(rect); m_wndLstLayerAll.InsertColumn(0, _T("层名"), LVCFMT_LEFT, rect.Width()/2); m_wndLstLayerAll.InsertColumn(1, _T("描述"), LVCFMT_LEFT, rect.Width()*3/8); // 初始化列表框 int nSize1 = (int)m_csAryLayerAll.GetSize(), nSize2 = (int)m_csAryDec.GetSize(); for (int i = 0; i< nSize1; i++) { // 添加第一列层名 m_wndLstLayerAll.InsertItem(i, m_csAryLayerAll[i]); // 查找该层名是否有图层描述 for (int j = 0; jiItem; CString csCurSel = m_wndLstLayerAll.GetItemText(iItem, 0); // 设置编辑框中的内容 m_csGoaleLayer = csCurSel; UpdateData(false); *pResult = 0; }