setting default values in editor

6 views
Skip to first unread message

Luca Vezzadini

unread,
Jan 29, 2013, 5:44:57 AM1/29/13
to dtEntity developers
Hi Martin,
I'm trying to setup an array property that is quite complex and I'd like it to show in the editor only the fields that the user should control. But I need to init the other values as well.
A simple example: each array entry is a group, which includes a unique ID (a string). I must init that ID internally.

Is there a way to trap when a new entry to the array is added from the editor, so to set things up? Os is some equivalent way in the array property to know when a new element is inserted?

Thanks,

   luca

--
_______________________________________________________________________
Luca Vezzadini R&D Team
Kairos3D Srl www.kairos3d.it

Luca Vezzadini

unread,
Feb 1, 2013, 3:04:26 AM2/1/13
to dtEntity developers
While still waiting for suggestions on this, I have another question about the editor.

A component I'm working on needs to assign a values from a list of possible ones to the OSG nodes found in the entity's mesh. This means I need a double list: the possible values to assign, and the list of possible target nodes. Both are dynamic: the input mesh is a propoerty on the StaticMesh component, so the node list changes with that)ì, and the possibel values are defined by the user in the related system.

What is the best way to create an editor for that? I don't think that just using property delegates would be enough, as the enum input seems to require a static, predefined list of possible values from the XML file. Any idea?

   luca


choco

unread,
Feb 6, 2013, 12:53:21 AM2/6/13
to dtenti...@googlegroups.com
Hi Luca,

there are currently no editor callbacks for handling property changes. You can only react to the property changes directly in the component or system.
But there is no good reason not to have something like that. Maybe some form of validation callback? Something like
class PropertyChangeListener {
virtual bool ChangeSubmitted(entityid, compoenttype, propertyname, value) = 0; // returns true if change is OK
}

I don't currently need something like that, but feel free to think something up.

choco

unread,
Feb 6, 2013, 12:58:05 AM2/6/13
to dtenti...@googlegroups.com
Maybe add a custom delegate? It's tricky because you can't synchronously read the node names from the OSG node as it may reside in another thread. Maybe you can add a special component that iterates through the node and fills an array property with the node names, then have an index pointing to the selected node name.

Cheers,
Martin

Luca Vezzadini

unread,
Feb 6, 2013, 5:04:50 AM2/6/13
to dtenti...@googlegroups.com
Hi Martin, thanks for the hints.

About the custom delegate, how would I do it? I'm not too clear aon how I can tell the editor about to use my special delegate rather than the standard one.

Also, another solution could be: create a dedicated widget, a simple dialog which would have two lists, one for the OSG nodes and the other with the possible values, plus buttons for the needed link actions. Is there a way in the editor to add custom widgets at the moment?

I will also look into your idea of the validation callback and let you know. For the moment anyway I've found a workaround so it's not that urgent.

Thanks,

   luca


--
You received this message because you are subscribed to the Google Groups "dtEntity developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dtentity-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Martin Scheffler

unread,
Feb 6, 2013, 5:13:31 AM2/6/13
to dtenti...@googlegroups.com

Hi,  there is currently no way to add panels to the editor.  The editor itself is pretty slim,  i would suggest copying the editor and doing your customizations in the copy

Reply all
Reply to author
Forward
0 new messages