Tried something, it kinda works
This commit is contained in:
@@ -11,6 +11,7 @@ ButtonListener* listener = NULL;
|
||||
BaseButtonInstance::BaseButtonInstance(void)
|
||||
{
|
||||
listener = NULL;
|
||||
initProperties();
|
||||
}
|
||||
|
||||
void BaseButtonInstance::render(RenderDevice* rd)
|
||||
|
||||
@@ -14,6 +14,7 @@ DataModelInstance::DataModelInstance(void)
|
||||
mousey = 0;
|
||||
mouseButton1Down = false;
|
||||
showMessage = false;
|
||||
initProperties();
|
||||
}
|
||||
|
||||
DataModelInstance::~DataModelInstance(void)
|
||||
|
||||
@@ -21,6 +21,7 @@ ImageButtonInstance::ImageButtonInstance(G3D::TextureRef newImage, G3D::TextureR
|
||||
floatRight = false;
|
||||
disabled = false;
|
||||
className = "ImageButton";
|
||||
initProperties();
|
||||
}
|
||||
|
||||
ImageButtonInstance::~ImageButtonInstance(void)
|
||||
|
||||
19
Instance.cpp
19
Instance.cpp
@@ -15,6 +15,7 @@ Instance::Instance(const Instance &oinst)
|
||||
setParent(oinst.parent);
|
||||
name = oinst.name;
|
||||
className = oinst.className;
|
||||
initProperties();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
for(size_t i = 0; i < children.size(); i++)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
class Instance
|
||||
{
|
||||
public:
|
||||
std::vector<Property> properties;
|
||||
Instance(void);
|
||||
Instance(const Instance&);
|
||||
virtual ~Instance(void);
|
||||
@@ -23,4 +24,5 @@ public:
|
||||
protected:
|
||||
std::string className;
|
||||
Instance* parent; // Another pointer.
|
||||
void initProperties();
|
||||
};
|
||||
|
||||
@@ -19,6 +19,7 @@ PhysicalInstance::PhysicalInstance(void)
|
||||
back = Smooth;
|
||||
left = Smooth;
|
||||
bottom = Smooth;
|
||||
initProperties();
|
||||
}
|
||||
|
||||
PhysicalInstance::PhysicalInstance(const PhysicalInstance &oinst)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#define _WINSOCKAPI_
|
||||
#include <windows.h>
|
||||
#include "WindowFunctions.h"
|
||||
#include "propertyGrid.h"
|
||||
#include "Property.h"
|
||||
#include "resource.h"
|
||||
#include "PropertyWindow.h"
|
||||
|
||||
@@ -111,4 +111,11 @@ void PropertyWindow::_redraw()
|
||||
|
||||
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;
|
||||
className = "TextButton";
|
||||
disabled = false;
|
||||
initProperties();
|
||||
}
|
||||
|
||||
bool TextButtonInstance::mouseInButton(float mousex, float mousey, RenderDevice* rd)
|
||||
|
||||
@@ -6,6 +6,7 @@ WorkspaceInstance::WorkspaceInstance(void)
|
||||
className = "Workspace";
|
||||
timer = 60.0F;
|
||||
score = 0;
|
||||
initProperties();
|
||||
}
|
||||
|
||||
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)
|
||||
selectedInstances.erase(selectedInstances.begin());
|
||||
selectedInstances.push_back(test);
|
||||
_propWindow->SetProperties(test);
|
||||
//message = "Dragging = true.";
|
||||
//messageTime = System::time();
|
||||
//dragging = true;
|
||||
|
||||
Reference in New Issue
Block a user