Hi,
I'm currently playing with property grid, and I have the following piece of code :
[TypeConverterAttribute(ExpandableObjectConverter::typeid)]
public ref struct CVector3
{
CVector3(void)
{
x = 0.1f;
y = 0.2f;
z = 0.3f;
}
property float x;
property float y;
property float z;
virtual String ^ ToString(void) override
{
return(L"" + x + L"; " + y + L"; " + z);
}
};
public ref class CDefaultNodeOptions : public System::Object
{
public:
CDefaultNodeOptions()
{
customVector3Property = gcnew CVector3;
}
~CDefaultNodeOptions() { }
public:
property bool boolProperty;
property int intProperty;
property float floatProperty;
property Point pointProperty;
property CVector3 ^ customVector3Property;
};
I've set the SelectedObject of my propertyGrid to a CDefaultNodeOptions, and I works fine. But when I expande the customVector3Property, and edit one of the x, y or z property, I need to collapse it to update the displayed value.
Do I need to capture and event when I change x, y or z to update the value of customVector3Property ? If so, how I do this ?
The second question now : I'm trying to find a good place with informations on propertygrids, and how to modify them.
For example, I'd like to have a custom property of type int, but which is modified via a slider bar. I already found a tutorial to do that, but it display the slider in a dropdown. I'd like the slider to be always displayed on the right part of the property.
I've foundsome articles onGetPaintValueSupported() and PaintValue(). But I don't really know how to use those to display a slider (I can use them to draw rectangles, and stuff, but I can't get ride of the rectangle outline, and I can't place what I want to draw on the right of the value. Nor can I draw a slider.)
Well, that's all for now ^^
If you know a good place to learn how to customize propertyGrids and displayed element, or if you have an answer to my questions ... thx in advance ^^