www.pudn.com > vc+mapx+gpx.zip > SelDlg.cpp


// SelDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "MapDemo.h" 
#include "SelDlg.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_strLayer = _T(""); 
	//}}AFX_DATA_INIT 
	m_pMapX=NULL; 
} 
CSelLayerDlg::CSelLayerDlg(CMapX* pMapX,CWnd* pParent /*=NULL*/) 
	: CDialog(CSelLayerDlg::IDD, pParent) 
{ 
 
	m_strListBox = _T(""); 
	m_strLayer = _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_strLayer); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CSelLayerDlg, CDialog) 
	//{{AFX_MSG_MAP(CSelLayerDlg) 
	ON_LBN_SELCHANGE(IDC_LIST_LAYERDLG, OnSelchangeListLayerdlg) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CSelLayerDlg message handlers 
 
BOOL CSelLayerDlg::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	if(m_pMapX==NULL) return TRUE; 
    CMapXLayers layers=m_pMapX->GetLayers(); 
    int nIndex=-1; 
	for(int i=0;iGetLayers(); 
		CMapXLayer layer=layers.Item(m_strLayer); 
		if(layer.GetEditable()) 
			layer.SetEditable(TRUE);  
	 
    } 
		 
	CDialog::OnOK(); 
}