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

View File

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

View File

@@ -1,9 +1,11 @@
#include <G3DAll.h>
#include "Property.h"
#pragma once
class Instance
{
public:
Property *properties;
Instance(void);
Instance(const Instance&);
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);
float moveRate = 0.5;
std::vector<Instance*> selectedInstances = std::vector<Instance*>();
static const std::string PlaceholderName = "Dynamica";
static const std::string PlaceholderName = "HyperCube";
Demo *usableApp = NULL;