From 8b4460c1048ae29e111e5b9aa122a4e1233107da Mon Sep 17 00:00:00 2001 From: Vulpovile Date: Wed, 10 Mar 2021 21:32:58 -0800 Subject: [PATCH] Adding properties --- Blocks3D.vcproj | 20 ++++++++++++++++++++ BoolProperty.h | 0 src/include/DataModelV2/Instance.h | 1 + src/include/Properties/BoolProperty.h | 13 +++++++++++++ src/include/Properties/Property.h | 19 +++++++++++++++++++ src/source/Properties/Property.cpp | 0 6 files changed, 53 insertions(+) create mode 100644 BoolProperty.h create mode 100644 src/include/Properties/BoolProperty.h create mode 100644 src/include/Properties/Property.h create mode 100644 src/source/Properties/Property.cpp diff --git a/Blocks3D.vcproj b/Blocks3D.vcproj index 24c36f3..f8a502f 100644 --- a/Blocks3D.vcproj +++ b/Blocks3D.vcproj @@ -616,6 +616,14 @@ + + + + + + @@ -821,6 +833,14 @@ > + + + + #include "propertyGrid.h" #include "map" +#include "Properties/BoolProperty.h" class Instance { diff --git a/src/include/Properties/BoolProperty.h b/src/include/Properties/BoolProperty.h new file mode 100644 index 0000000..ebdfe51 --- /dev/null +++ b/src/include/Properties/BoolProperty.h @@ -0,0 +1,13 @@ +#pragma once +#include "Property.h" +#pragma once +class BoolProperty : public Property +{ +public: + template + BoolProperty(std::string name, bool& value) + { + Property(name, (T)value); + } + ~BoolProperty(void); +}; diff --git a/src/include/Properties/Property.h b/src/include/Properties/Property.h new file mode 100644 index 0000000..1519818 --- /dev/null +++ b/src/include/Properties/Property.h @@ -0,0 +1,19 @@ +#pragma once +#include "propertyGrid.h" +template +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; +}; diff --git a/src/source/Properties/Property.cpp b/src/source/Properties/Property.cpp new file mode 100644 index 0000000..e69de29