zlistproperties.cpp

来自「sybain下的手机编程源码,类似windows下的资源管理器」· C++ 代码 · 共 81 行

CPP
81
字号
// zListProperties.cpp: implementation of the zListProperties class.
//
//////////////////////////////////////////////////////////////////////

#include "../stdafx.h"

#include "zListProperties.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

zListProperties::zListProperties()
{
}

zListProperties::~zListProperties()
{
}

int zListProperties::GetSize()
{
	return (int)vProperties.size();
}

void zListProperties::ResetProperties()
{
	vProperties.clear();
}

int zListProperties::DeleteProperties(int n)
{
	int size = (int)vProperties.size();
	if (n>=size) return -1;
	vProperties.erase(vProperties.begin()+n);
	return GetSize();
}

int zListProperties::AddProperties(int nType,TCHAR * pTitle,TCHAR * pName,long nParam)
{
	ITEMPROPERTIES ippts;
	ippts.nType = nType;
	_tcsncpy(ippts.szTitle,pTitle,sizeof(ippts.szTitle)/sizeof(TCHAR));
	if(_tcslen(pName)<=0)
	{
		zControl::GetTmpAttribName(ippts.szName,sizeof(ippts.szName)/sizeof(TCHAR));
	}else
		_tcsncpy(ippts.szName,pName,sizeof(ippts.szName)/sizeof(TCHAR));
	ippts.nParam = nParam;
	vProperties.push_back(ippts);
	return GetSize();
}

int zListProperties::GetType(int n)
{
	int size = (int)vProperties.size();
	if (n>=size) return -1;
	return vProperties[n].nType;
}

TCHAR *  zListProperties::GetTitle(int n)
{
	int size = (int)vProperties.size();
	if (n>=size) return NULL;
	return vProperties[n].szTitle;
}

TCHAR * zListProperties::GetName(int n)
{
	int size = (int)vProperties.size();
	if (n>=size) return NULL;
	return vProperties[n].szName;
}

long zListProperties::GetParam(int n)
{
	int size = (int)vProperties.size();
	if (n>=size) return -1;
	return vProperties[n].nParam;
}

⌨️ 快捷键说明

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