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

📄 dlglist.cpp

📁 具有地图的放大、缩小、漫游、属性查询、图层控制等功能。
💻 CPP
字号:
// DlgList.cpp : implementation file
//

#include "stdafx.h"
#include "FirstMap.h"
#include "DlgList.h"
#include "motabledesc.h"
#include "mofields.h"
#include "mofield.h"
//#include "FirstMapView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgList dialog


CDlgList::CDlgList(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgList::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgList)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CDlgList::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgList)
	DDX_Control(pDX, IDC_LIST_PRPPRETY, m_list);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgList, CDialog)
	//{{AFX_MSG_MAP(CDlgList)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgList message handlers

BOOL CDlgList::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CMoTableDesc tableDesc(	m_RecSet.GetTableDesc());
	CMoFields    ShapeFields(m_RecSet.GetFields());
	CMoField     ShapeField;
	CString value;
	CString name;
	DWORD style=m_list.GetExtendedStyle();
	m_list.SetExtendedStyle(style|LVS_EX_GRIDLINES);
	m_list.DeleteAllItems();
					
	m_list.InsertColumn(0,"Field",LVCFMT_CENTER,130);
	m_list.InsertColumn(1,"Value",LVCFMT_CENTER,100);
	
	int numField = tableDesc.GetFieldCount();
	for(int j=0;j<numField;j++)
	{
		m_list.InsertItem(j,"");
		name = tableDesc.GetFieldName(j);
		ShapeField = ShapeFields.Item(COleVariant(name));
		value = ShapeField.GetValueAsString();
		m_list.SetItemText(j,0,name);
		m_list.SetItemText(j,1,value);
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

⌨️ 快捷键说明

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