P
Paic Citron
Hi,
I'm currently working on an scenegraph editor. I have a treeview, and
when I select a node, it shows its properties in a propertygrid. Each
node has a link to the scenegraph node, and I override the property
accessors to modify the scenegraph node when the user change something
in the propertygrid. For example :
// this is a custom 3 dimensional vector object.
[TypeConverterAttribute(ExpandableObjectConverter::typeid)]
public ref struct CVector3
{
CVector3(void) { x = 0.0f; y = 0.0f; z = 0.0f; }
CVector3(float X, float Y, float Z) { x =X; y = Y; z = Z; }
property float x;
property float y;
property float z;
virtual String ^ ToString(void) override
{
return("" + x + "; " + y + "; " + z);
}
};
Now, in the treeviewnode, I have something like :
property CVector3 ^ Position
{
void set(CVector3 ^ value)
{
// when the Position property is modified, I want
// to send the new position to the scenegraph node.
m_pNode->SetPosition(value->x, value->y, value->z);
}
CVector3 ^ get(void)
{
// I always get the position from the scengraph node.
return(gcnew CVector3(m_pNode->GetPositionX(),
m_pNode->GetPositionY(),
m_pNode->GetPositionZ());
}
}
where m_pNode is a pointer to the associated scenegraph node.
Now, the problem is that when I expand the Position property, and modify
the x component, the CTreeViewNode:
osition::set() method is not
called. I overrided the x, y and z accessors in the CVector3, and they
are correctly called, but I need to "notify" my CTreeViewNode that its
Position property changed, and I really don't know how to do that :/
If anyone know how to do this, I would really appreciate a little help ^^
And I apologize for my english :/ If you didn't understand my problem,
tell me, I'll try to be a little clearer ^^
Have a good day.
Damien
I'm currently working on an scenegraph editor. I have a treeview, and
when I select a node, it shows its properties in a propertygrid. Each
node has a link to the scenegraph node, and I override the property
accessors to modify the scenegraph node when the user change something
in the propertygrid. For example :
// this is a custom 3 dimensional vector object.
[TypeConverterAttribute(ExpandableObjectConverter::typeid)]
public ref struct CVector3
{
CVector3(void) { x = 0.0f; y = 0.0f; z = 0.0f; }
CVector3(float X, float Y, float Z) { x =X; y = Y; z = Z; }
property float x;
property float y;
property float z;
virtual String ^ ToString(void) override
{
return("" + x + "; " + y + "; " + z);
}
};
Now, in the treeviewnode, I have something like :
property CVector3 ^ Position
{
void set(CVector3 ^ value)
{
// when the Position property is modified, I want
// to send the new position to the scenegraph node.
m_pNode->SetPosition(value->x, value->y, value->z);
}
CVector3 ^ get(void)
{
// I always get the position from the scengraph node.
return(gcnew CVector3(m_pNode->GetPositionX(),
m_pNode->GetPositionY(),
m_pNode->GetPositionZ());
}
}
where m_pNode is a pointer to the associated scenegraph node.
Now, the problem is that when I expand the Position property, and modify
the x component, the CTreeViewNode:

called. I overrided the x, y and z accessors in the CVector3, and they
are correctly called, but I need to "notify" my CTreeViewNode that its
Position property changed, and I really don't know how to do that :/
If anyone know how to do this, I would really appreciate a little help ^^
And I apologize for my english :/ If you didn't understand my problem,
tell me, I'll try to be a little clearer ^^
Have a good day.
Damien