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.

55 lines
1.8 KiB
C++

#include "StdAfx.h"
#include "ModuleExample.h"
#include "Propertie.h"
#include "PropertieMgr.h"
#include "AuthorityMgr.h"
CModuleExample *gModuleExample = new CModuleExample;
CModuleExample::CModuleExample(void)
{
}
CModuleExample::~CModuleExample(void)
{
}
CMFCPropertyGridProperty *CModuleExample::CreatGridProperty()
{
CString PropertyName;//属性名称
CString Description;//描述
CString Path = GetParDirName();//存储路径
CString Name;
CString GroupName;
CString ModuleName;
//-------------------------------------------------------------------------------//
PropertyName = _T("语言");
GroupName = PropertyName;
CMFCPropertyGridProperty* pGroup = new CMFCPropertyGridProperty(PropertyName);
//-------------------------------------------------------------------------------//
if(gAuthorityMgr->CheckAuthority(_Authority_Factory))
{
{
//添加属性变量映射
Name = _T("m_bEnglishMode");//变量名字
CPropertie *pPropertie = new CPropertie;
pPropertie->SetpVal((void*)&m_bEnglishMode);
pPropertie->SetType(_PROP_TYPE_BOOL);
pPropertie->SetpModule(this);
pPropertie->SetPath(Path);
pPropertie->SetName(Name);
pPropertie->WriteRead(true);//读取保存的属性
//添加属性显示
PropertyName = _T("英文模式");
Description = _T("英文模式");
pPropertie->SetGroupName(GroupName);
pPropertie->SetShowName(PropertyName);
CMFCPropertyGridProperty* p1 = new CMFCPropertyGridProperty(PropertyName, (_variant_t)m_bEnglishMode, Description);
pGroup->AddSubItem(p1);
gDevicePropertieMgr.Insert(p1, pPropertie);
}
}
return pGroup;
}