You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.3 KiB
C++
69 lines
1.3 KiB
C++
|
|
#include "stdafx.h"
|
|
#include "DlgObjList.h"
|
|
#include "afxdialogex.h"
|
|
#include "GlobalFunction.h"
|
|
|
|
IMPLEMENT_DYNAMIC(CDlgObjList, CDialogEx)
|
|
BEGIN_MESSAGE_MAP(CDlgObjList, CDialogEx)
|
|
END_MESSAGE_MAP()
|
|
|
|
CDlgObjList::CDlgObjList(CWnd* pParent /*=NULL*/)
|
|
{
|
|
|
|
}
|
|
|
|
CDlgObjList::~CDlgObjList()
|
|
{
|
|
}
|
|
|
|
void CDlgObjList::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CDialogEx::DoDataExchange(pDX);
|
|
DDX_Control(pDX, IDC_OBJ_LIST, m_List);
|
|
}
|
|
|
|
// CDlgStdMarkCtr 消息处理程序
|
|
BOOL CDlgObjList::OnInitDialog()
|
|
{
|
|
CDialogEx::OnInitDialog();
|
|
m_ObjContainer = NULL;//obj 对象容器
|
|
|
|
//初始化列表
|
|
IniList();
|
|
|
|
UpdateData(FALSE);
|
|
return TRUE;
|
|
}
|
|
//初始化列表
|
|
void CDlgObjList::IniList()
|
|
{
|
|
//设置风格
|
|
m_List.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);
|
|
//设置列
|
|
int idx = 0;
|
|
m_List.InsertColumn(idx,"序号",LVCFMT_CENTER,45,-1);
|
|
idx++;
|
|
m_List.InsertColumn(idx,"类型",LVCFMT_CENTER,100,-1);
|
|
idx++;
|
|
}
|
|
//刷新对象列表
|
|
void CDlgObjList::RefreshObjList()
|
|
{
|
|
if(NULL == m_ObjContainer)
|
|
return;
|
|
m_List.DeleteAllItems();
|
|
|
|
m_ObjContainer->InsertList(m_List);
|
|
UpdateData(FALSE);
|
|
}
|
|
//绑定obj 容器
|
|
void CDlgObjList::BindObjContainer(CObjContainer *p)
|
|
{
|
|
if(NULL == p)
|
|
return;
|
|
|
|
m_ObjContainer = p;
|
|
|
|
RefreshObjList();
|
|
} |