Properties work

This commit is contained in:
andreja6
2018-10-22 22:59:41 -07:00
parent 268a0cd2ee
commit 0dcd054da3
2 changed files with 9 additions and 8 deletions

View File

@@ -34,13 +34,13 @@ void Update(PROPGRIDITEM)
void Instance::initProperties()
{
PROPGRIDITEM * pItem = new PROPGRIDITEM();
pItem->lpszCatalog="Test";
pItem->lpszPropName="Offset";
pItem->lpszzCmbItems="What";
pItem->lpszPropDesc="Description";
pItem->lpCurValue=(LPARAM)"0, 0, 0";
pItem->iItemType=PIT_EDIT;
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(new Property(pItem, Update));
}

View File

@@ -111,10 +111,11 @@ void PropertyWindow::_redraw()
void PropertyWindow::SetProperties(Instance * instance)
{
//PropGrid_ResetContent(_propGrid);
PropGrid_ResetContent(_propGrid);
for(size_t i = 0; i < instance->properties.size(); i++)
{
PropGrid_AddItem(_propGrid, instance->properties.at(i)->item);
::PROPGRIDITEM * item = instance->properties.at(i)->item;
PropGrid_AddItem(_propGrid, item);
}
SetWindowLongPtr(_propGrid,GWL_USERDATA,(LONG)this);
_redraw();