Added properties to PhysicalInstance

This commit is contained in:
andreja6
2018-10-23 12:29:36 -07:00
parent 0f700aeda5
commit 6d1428ced9
4 changed files with 57 additions and 8 deletions

View File

@@ -17,6 +17,8 @@ Instance::Instance(const Instance &oinst)
className = oinst.className;
}
void Instance::render(RenderDevice* rd)
{
for(size_t i = 0; i < children.size(); i++)
@@ -25,6 +27,20 @@ void Instance::render(RenderDevice* rd)
}
}
PROPGRIDITEM Instance::createPGI(LPSTR catalog, LPSTR propName, LPSTR propDesc, LPARAM curVal, INT type)
{
PROPGRIDITEM pItem;
PropGrid_ItemInit(pItem);
pItem.lpszCatalog=catalog;
pItem.lpszPropName=propName;
pItem.lpszPropDesc=propDesc;
pItem.lpCurValue=curVal;
pItem.iItemType=type;
return pItem;
}
void Instance::PropUpdate(DWORD &addr, PROPGRIDITEM &pItem)
{
if((DWORD)&name == addr)
@@ -36,15 +52,15 @@ void Instance::PropUpdate(DWORD &addr, PROPGRIDITEM &pItem)
std::vector<Property> Instance::getProperties()
{
std::vector<Property> properties;
PROPGRIDITEM pItem;
PropGrid_ItemInit(pItem);
pItem.lpszCatalog="Properties";
pItem.lpszPropName="Name";
pItem.lpszPropDesc="The name of the current instance";
pItem.lpCurValue=(LPARAM)name.c_str();
pItem.iItemType=PIT_EDIT;
properties.push_back(Property(pItem, (DWORD)&name));
properties.push_back(Property(createPGI(
"Properties",
"Name",
"The name of this instance",
(LPARAM)name.c_str(),
PIT_EDIT
), (DWORD)&name));
return properties;
}