Adding properties

This commit is contained in:
Vulpovile
2021-03-10 21:32:58 -08:00
parent 7ca6b1e472
commit 8b4460c104
6 changed files with 53 additions and 0 deletions

View File

@@ -616,6 +616,14 @@
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Properties"
>
<File
RelativePath=".\src\source\Properties\Property.cpp"
>
</File>
</Filter>
</Filter>
<Filter
Name="Header Files"
@@ -633,6 +641,10 @@
RelativePath=".\src\include\ax.h"
>
</File>
<File
RelativePath=".\src\include\Properties\BoolProperty.h"
>
</File>
<File
RelativePath=".\src\include\BrowserCallHandler.h"
>
@@ -821,6 +833,14 @@
>
</File>
</Filter>
<Filter
Name="Properties"
>
<File
RelativePath=".\src\include\Properties\Property.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="Resource Files"

0
BoolProperty.h Normal file
View File

View File

@@ -2,6 +2,7 @@
#include <G3DAll.h>
#include "propertyGrid.h"
#include "map"
#include "Properties/BoolProperty.h"
class Instance
{

View File

@@ -0,0 +1,13 @@
#pragma once
#include "Property.h"
#pragma once
class BoolProperty : public Property<bool>
{
public:
template <typename T>
BoolProperty(std::string name, bool& value)
{
Property(name, (T)value);
}
~BoolProperty(void);
};

View File

@@ -0,0 +1,19 @@
#pragma once
#include "propertyGrid.h"
template <typename T>
class Property
{
public:
Property(std::string name, T& value)
{
value = t;
}
~Property(void);
T getValue();
void setValue(T);
PROPGRIDITEM getPropGridItem();
void setProperty(LPPROPGRIDITEM item);
protected:
std::string name;
T* value;
};

View File