Tried something, it kinda works
This commit is contained in:
@@ -11,6 +11,7 @@ ButtonListener* listener = NULL;
|
|||||||
BaseButtonInstance::BaseButtonInstance(void)
|
BaseButtonInstance::BaseButtonInstance(void)
|
||||||
{
|
{
|
||||||
listener = NULL;
|
listener = NULL;
|
||||||
|
initProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseButtonInstance::render(RenderDevice* rd)
|
void BaseButtonInstance::render(RenderDevice* rd)
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ DataModelInstance::DataModelInstance(void)
|
|||||||
mousey = 0;
|
mousey = 0;
|
||||||
mouseButton1Down = false;
|
mouseButton1Down = false;
|
||||||
showMessage = false;
|
showMessage = false;
|
||||||
|
initProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
DataModelInstance::~DataModelInstance(void)
|
DataModelInstance::~DataModelInstance(void)
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ ImageButtonInstance::ImageButtonInstance(G3D::TextureRef newImage, G3D::TextureR
|
|||||||
floatRight = false;
|
floatRight = false;
|
||||||
disabled = false;
|
disabled = false;
|
||||||
className = "ImageButton";
|
className = "ImageButton";
|
||||||
|
initProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButtonInstance::~ImageButtonInstance(void)
|
ImageButtonInstance::~ImageButtonInstance(void)
|
||||||
|
|||||||
19
Instance.cpp
19
Instance.cpp
@@ -15,6 +15,7 @@ Instance::Instance(const Instance &oinst)
|
|||||||
setParent(oinst.parent);
|
setParent(oinst.parent);
|
||||||
name = oinst.name;
|
name = oinst.name;
|
||||||
className = oinst.className;
|
className = oinst.className;
|
||||||
|
initProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Instance::render(RenderDevice* rd)
|
void Instance::render(RenderDevice* rd)
|
||||||
@@ -25,6 +26,24 @@ void Instance::render(RenderDevice* rd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Update(PROPGRIDITEM)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void Instance::initProperties()
|
||||||
|
{
|
||||||
|
::PROPGRIDITEM pItem;
|
||||||
|
pItem.lpszCatalog="Test";
|
||||||
|
pItem.lpszPropName="Offset";
|
||||||
|
pItem.lpszzCmbItems="What";
|
||||||
|
pItem.lpszPropDesc="Description";
|
||||||
|
pItem.lpCurValue=(LPARAM)"0, 0, 0";
|
||||||
|
properties.push_back(Property(pItem, Update));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Instance::~Instance(void)
|
Instance::~Instance(void)
|
||||||
{
|
{
|
||||||
for(size_t i = 0; i < children.size(); i++)
|
for(size_t i = 0; i < children.size(); i++)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
class Instance
|
class Instance
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
std::vector<Property> properties;
|
||||||
Instance(void);
|
Instance(void);
|
||||||
Instance(const Instance&);
|
Instance(const Instance&);
|
||||||
virtual ~Instance(void);
|
virtual ~Instance(void);
|
||||||
@@ -23,4 +24,5 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
std::string className;
|
std::string className;
|
||||||
Instance* parent; // Another pointer.
|
Instance* parent; // Another pointer.
|
||||||
|
void initProperties();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ PhysicalInstance::PhysicalInstance(void)
|
|||||||
back = Smooth;
|
back = Smooth;
|
||||||
left = Smooth;
|
left = Smooth;
|
||||||
bottom = Smooth;
|
bottom = Smooth;
|
||||||
|
initProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysicalInstance::PhysicalInstance(const PhysicalInstance &oinst)
|
PhysicalInstance::PhysicalInstance(const PhysicalInstance &oinst)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#define _WINSOCKAPI_
|
#define _WINSOCKAPI_
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include "WindowFunctions.h"
|
#include "WindowFunctions.h"
|
||||||
#include "propertyGrid.h"
|
#include "Property.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
#include "PropertyWindow.h"
|
#include "PropertyWindow.h"
|
||||||
|
|
||||||
@@ -111,4 +111,11 @@ void PropertyWindow::_redraw()
|
|||||||
|
|
||||||
void PropertyWindow::SetProperties(Instance * instance)
|
void PropertyWindow::SetProperties(Instance * instance)
|
||||||
{
|
{
|
||||||
|
PropGrid_ResetContent(_propGrid);
|
||||||
|
for(size_t i = 0; i < instance->properties.size(); i++)
|
||||||
|
{
|
||||||
|
PropGrid_AddItem(_propGrid, &instance->properties.at(i));
|
||||||
|
}
|
||||||
|
SetWindowLongPtr(_propGrid,GWL_USERDATA,(LONG)this);
|
||||||
|
_redraw();
|
||||||
}
|
}
|
||||||
@@ -20,6 +20,7 @@ TextButtonInstance::TextButtonInstance(void)
|
|||||||
visible = true;
|
visible = true;
|
||||||
className = "TextButton";
|
className = "TextButton";
|
||||||
disabled = false;
|
disabled = false;
|
||||||
|
initProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TextButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd)
|
bool TextButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ WorkspaceInstance::WorkspaceInstance(void)
|
|||||||
className = "Workspace";
|
className = "Workspace";
|
||||||
timer = 60.0F;
|
timer = 60.0F;
|
||||||
score = 0;
|
score = 0;
|
||||||
|
initProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkspaceInstance::~WorkspaceInstance(void)
|
WorkspaceInstance::~WorkspaceInstance(void)
|
||||||
|
|||||||
1
main.cpp
1
main.cpp
@@ -1269,6 +1269,7 @@ void Demo::onMouseLeftPressed(HWND hwnd,int x,int y)
|
|||||||
while(selectedInstances.size() > 0)
|
while(selectedInstances.size() > 0)
|
||||||
selectedInstances.erase(selectedInstances.begin());
|
selectedInstances.erase(selectedInstances.begin());
|
||||||
selectedInstances.push_back(test);
|
selectedInstances.push_back(test);
|
||||||
|
_propWindow->SetProperties(test);
|
||||||
//message = "Dragging = true.";
|
//message = "Dragging = true.";
|
||||||
//messageTime = System::time();
|
//messageTime = System::time();
|
||||||
//dragging = true;
|
//dragging = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user