⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 viewentiredlg.cpp

📁 mapx嵌入式插件
💻 CPP
字号:
// ViewEntireDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MapXMobileViewer.h"
#include "ViewEntireDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CViewEntireDlg dialog


CViewEntireDlg::CViewEntireDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CViewEntireDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CViewEntireDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_nSelectedLayer=0;
	m_pMap = NULL;
}


void CViewEntireDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CViewEntireDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CViewEntireDlg, CDialog)
	//{{AFX_MSG_MAP(CViewEntireDlg)
	ON_LBN_DBLCLK(IDC_LAYERS, OnDblclkLayers)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CViewEntireDlg message handlers

void CViewEntireDlg::OnDblclkLayers() 
{
	OnOK();	
}

BOOL CViewEntireDlg::OnInitDialog() 
{
	ASSERT(m_pMap);
	if (!m_pMap) {
		EndDialog(IDCANCEL);
		return FALSE;
	}

	TRY {
		CListBox *pList = (CListBox *)GetDlgItem(IDC_LAYERS);
		ASSERT(pList);
		CString str;
		str.LoadString(IDS_ALLLAYERS);
		pList->AddString(str);
		str.Empty();
		int n = m_pMap->GetLayers().GetCount();
		for (int i=1; i<=n;i++) {
			str = m_pMap->GetLayers().Item(i).GetName();
			pList->AddString(str);
		}
		pList->SetCurSel(0);
	}
	CATCH (COleDispatchException, e) {
		//e->Delete();
	}
	AND_CATCH (COleException, e) {
		//e->Delete();
	}
	END_CATCH
	CDialog::OnInitDialog();
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CViewEntireDlg::OnOK() 
{
	if (!UpdateData(TRUE)) {
		return;
	}
	m_nSelectedLayer = max(0, ((CListBox *)GetDlgItem(IDC_LAYERS))->GetCurSel());
	EndDialog(IDOK);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -