Changed how properties work
This commit is contained in:
@@ -106,3 +106,6 @@ Instance* Instance::findFirstChild(std::string name)
|
||||
}
|
||||
return child;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
#pragma once
|
||||
#include <G3DAll.h>
|
||||
#include "Property.h"
|
||||
#pragma once
|
||||
|
||||
class Instance
|
||||
{
|
||||
public:
|
||||
Property *properties;
|
||||
Instance(void);
|
||||
Instance(const Instance&);
|
||||
virtual ~Instance(void);
|
||||
|
||||
20
Property.cpp
20
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
15
Property.h
15
Property.h
@@ -1,15 +1,12 @@
|
||||
#pragma once
|
||||
#include <G3DAll.h>
|
||||
#include <windows.h>
|
||||
#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);
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#define _WINSOCKAPI_
|
||||
#include <windows.h>
|
||||
#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)
|
||||
{
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user