diff --git a/Instance.cpp b/Instance.cpp index 1f31df5..71b1125 100644 --- a/Instance.cpp +++ b/Instance.cpp @@ -106,3 +106,6 @@ Instance* Instance::findFirstChild(std::string name) } return child; } + + + diff --git a/Instance.h b/Instance.h index 7041b32..dc039aa 100644 --- a/Instance.h +++ b/Instance.h @@ -1,11 +1,10 @@ + +#pragma once #include #include "Property.h" -#pragma once - class Instance { public: - Property *properties; Instance(void); Instance(const Instance&); virtual ~Instance(void); diff --git a/Property.cpp b/Property.cpp index fdaa479..c1c5dd3 100644 --- a/Property.cpp +++ b/Property.cpp @@ -1,25 +1,19 @@ #include "Property.h" -Property::Property(std::string title, std::string propName, void * prop, void *(*getFunc)(void), void(*setFunc)(void *)) +Property::Property(PROPGRIDITEM item, void(*onPropUpdate)(PROPGRIDITEM)) { - this->title = title; - this->propName = propName; - this->prop = prop; - this->getFunc = getFunc; - this->setFunc = setFunc; + this->callbackFuncOnChange = onPropUpdate; + this->item = item; } Property::~Property(void) { } - -void Property::setProperty(void * newprop) +void Property::updateProperty(PROPGRIDITEM item) { - this->setFunc(newprop); + callbackFuncOnChange(item); } -void * Property::getProperty() -{ - return this->getFunc(); -} \ No newline at end of file + + diff --git a/Property.h b/Property.h index 161e66f..a06738a 100644 --- a/Property.h +++ b/Property.h @@ -1,15 +1,12 @@ #pragma once -#include +#include +#include "propertyGrid.h" class Property { public: - std::string title; - std::string propName; - void * prop; - void *(*getFunc)(void); - void(*setFunc)(void *); - void setProperty(void*); - void * getProperty(); - Property(std::string title, std::string propName, void * prop, void *(*getFunc)(void), void(*setFunc)(void *)); + void(*callbackFuncOnChange)(PROPGRIDITEM); + PROPGRIDITEM item; + Property(PROPGRIDITEM item, void(*onPropUpdate)(PROPGRIDITEM)); ~Property(void); + void updateProperty(PROPGRIDITEM); }; diff --git a/PropertyWindow.cpp b/PropertyWindow.cpp index 34ebfa7..7f1be4e 100644 --- a/PropertyWindow.cpp +++ b/PropertyWindow.cpp @@ -1,3 +1,4 @@ +#define _WINSOCKAPI_ #include #include "WindowFunctions.h" #include "propertyGrid.h" @@ -107,3 +108,7 @@ void PropertyWindow::_redraw() GetClientRect(_hwndProp,&rect); SetWindowPos(_propGrid, NULL, 0, 20, rect.right, rect.bottom-20, SWP_NOZORDER | SWP_NOACTIVATE); } + +void PropertyWindow::SetProperties(Instance * instance) +{ +} \ No newline at end of file diff --git a/PropertyWindow.h b/PropertyWindow.h index 3c3e54f..48005db 100644 --- a/PropertyWindow.h +++ b/PropertyWindow.h @@ -1,9 +1,10 @@ #pragma once - +#include "Instance.h" class PropertyWindow { public: PropertyWindow(int x, int y, int sx, int sy, HMODULE hThisInstance); bool onCreate(int x, int y, int sx, int sy, HMODULE hThisInstance); + void SetProperties(Instance *); void onResize(); private: HWND _propGrid;