www.pudn.com > Geotest.rar > SelLayerDlg.cpp
// SelLayerDlg.cpp : implementation file
//
#include "stdafx.h"
#include "geotest.h"
#include "SelLayerDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSelLayerDlg dialog
CSelLayerDlg::CSelLayerDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSelLayerDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSelLayerDlg)
m_strListBox = _T("");
m_layerName = _T("");
//}}AFX_DATA_INIT
m_pMapX=NULL;
}
CSelLayerDlg::CSelLayerDlg(CMapX* pMapX, CWnd* pParent /*=NULL*/)
: CDialog(CSelLayerDlg::IDD, pParent)
{
m_strListBox = _T("");
m_layerName = _T("");
m_pMapX=pMapX;
}
void CSelLayerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSelLayerDlg)
DDX_Control(pDX, IDC_LIST_LAYERDLG, m_listBox);
DDX_LBString(pDX, IDC_LIST_LAYERDLG, m_strListBox);
DDX_Text(pDX, IDC_STATIC_LAYERNAME, m_layerName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSelLayerDlg, CDialog)
//{{AFX_MSG_MAP(CSelLayerDlg)
ON_LBN_SELCHANGE(IDC_LIST_LAYERDLG, OnSelchangeListLayerdlg)
ON_BN_CLICKED(ID_OK, OnOk)
ON_BN_CLICKED(ID_CANCEL, OnCancel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSelLayerDlg message handlers
void CSelLayerDlg::OnSelchangeListLayerdlg()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
m_layerName=m_strListBox;
UpdateData(FALSE);
}
BOOL CSelLayerDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_layerName="选中的图层";
//设置列表项
if(m_pMapX==NULL) return FALSE;
CMapXLayers Layers = m_pMapX->GetLayers();
int nIndex =-1;
for(int i=0;iGetLayers();
CMapXLayer layer=layers.Item(GetEditLayerName());
if(!layer.GetEditable())
layer.SetEditable(TRUE); //设置成可编辑状态
}
CDialog::OnOK();
}
void CSelLayerDlg::OnCancel()
{
// TODO: Add your control notification handler code here
CDialog :: OnCancel();
}