Added properties

This commit is contained in:
andreja6
2018-10-22 18:20:28 -07:00
parent b18ebfb56f
commit b097cb15e4
6 changed files with 55 additions and 4 deletions

View File

@@ -74,7 +74,7 @@
/> />
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib" AdditionalDependencies="Advapi32.lib UxTheme.lib Comctl32.lib Comdlg32.lib Shell32.lib"
OutputFile="./G3DTest.exe" OutputFile="./G3DTest.exe"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="true" SuppressStartupBanner="true"
@@ -147,8 +147,8 @@
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS"
MinimalRebuild="false" MinimalRebuild="false"
BasicRuntimeChecks="0" BasicRuntimeChecks="0"
RuntimeLibrary="2" RuntimeLibrary="3"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="false"
PrecompiledHeaderFile=".\Debug/G3DTest.pch" PrecompiledHeaderFile=".\Debug/G3DTest.pch"
AssemblerListingLocation=".\Debug/" AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/" ObjectFile=".\Debug/"
@@ -290,6 +290,10 @@
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath=".\Property.cpp"
>
</File>
<File <File
RelativePath=".\propertyGrid.cpp" RelativePath=".\propertyGrid.cpp"
> >
@@ -403,6 +407,10 @@
RelativePath=".\PartType.h" RelativePath=".\PartType.h"
> >
</File> </File>
<File
RelativePath=".\Property.h"
>
</File>
<File <File
RelativePath=".\propertyGrid.h" RelativePath=".\propertyGrid.h"
> >

View File

@@ -1,4 +1,5 @@
//#include "WindowFunctions.h" //#include "WindowFunctions.h"
#pragma once
#include <mshtml.h> #include <mshtml.h>
#include <exdisp.h> #include <exdisp.h>
//#include <Mshtmhst.h> //#include <Mshtmhst.h>

View File

@@ -1,9 +1,11 @@
#include <G3DAll.h> #include <G3DAll.h>
#include "Property.h"
#pragma once #pragma once
class Instance class Instance
{ {
public: public:
Property *properties;
Instance(void); Instance(void);
Instance(const Instance&); Instance(const Instance&);
virtual ~Instance(void); virtual ~Instance(void);

25
Property.cpp Normal file
View File

@@ -0,0 +1,25 @@
#include "Property.h"
Property::Property(std::string title, std::string propName, void * prop, void *(*getFunc)(void), void(*setFunc)(void *))
{
this->title = title;
this->propName = propName;
this->prop = prop;
this->getFunc = getFunc;
this->setFunc = setFunc;
}
Property::~Property(void)
{
}
void Property::setProperty(void * newprop)
{
this->setFunc(newprop);
}
void * Property::getProperty()
{
return this->getFunc();
}

15
Property.h Normal file
View File

@@ -0,0 +1,15 @@
#pragma once
#include <G3DAll.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 *));
~Property(void);
};

View File

@@ -79,7 +79,7 @@ bool dragging = false;
Vector2 oldMouse = Vector2(0,0); Vector2 oldMouse = Vector2(0,0);
float moveRate = 0.5; float moveRate = 0.5;
std::vector<Instance*> selectedInstances = std::vector<Instance*>(); std::vector<Instance*> selectedInstances = std::vector<Instance*>();
static const std::string PlaceholderName = "Dynamica"; static const std::string PlaceholderName = "HyperCube";
Demo *usableApp = NULL; Demo *usableApp = NULL;