Custom PropertyGridView Tab Order

30 views
Skip to first unread message

vorp

unread,
Feb 19, 2015, 7:49:35 PM2/19/15
to authoring-to...@googlegroups.com
I'm trying to figure out how to control tab order in a property grid.
We use a bunch of BoundedFloatTupleEditors for colors, vectors, etc.
Currently, hitting tab moves to the next property rather than the next component of the tuple.
This annoys the pants off a lot of users.
As far as I can tell the critical code is the ProcessDialogKey of the PropertyGridView class.
On tab it does:
 
Property property = GetNextProperty(SelectedProperty);
...
StartPropertyEdit(property);


Which doesn't move through the Tuple's components but rather to the next property.
A basic solution would be to check whether the current property has more than one component and move to the next one of those, if it exists.
It seems ideal if I could tag properties with meta data telling the PropertyGrid whether a tab should move to the next component OR a different property AND which property/component.
For example, we have other properties for which it would be nice to go to the first tuple component of the next property on tab and THEN jump back to the 2nd tuple component of the previous property and finally the 2nd component of the 2nd property (e.g. Min/Max type fields).

I don't suppose there's any way to achieve this with ATF in its current form?

Thanks for any ideas.

-Len


Ron2

unread,
Feb 23, 2015, 1:27:20 PM2/23/15
to authoring-to...@googlegroups.com
Hi Len,

Did you find a solution? I took a look at our DOM Property Editor sample app and it has good tab-key behavior in the properties that use NumericMatrixControl and NumericTupleControl. The idea is that the child Control that has focus can use its ProcessDialogKey() method to handle the Tab key to set focus on the next sibling Control and then return 'true'. If there are no more sibling Controls, then it should call the base Control's ProcessDialogKey() which will then give the parent Control, PropertyGridView, a chance to handle the tab key in its ProcessDialogKey(), which is the place you found.

Is BoundedFloatTupleEditor a class you created? Maybe you can adapt the implementation of NumericTupleControl's ProcessDialogKey() to your BoundedFloatTupleEditor?

--Ron

vorp

unread,
Feb 23, 2015, 1:30:45 PM2/23/15
to authoring-to...@googlegroups.com
Ah! That's a good lead. I didn't even realize that control was custom! I'll dig into it. Thanks.

vorp

unread,
Feb 24, 2015, 1:43:07 PM2/24/15
to authoring-to...@googlegroups.com
Yeah, that worked. Thanks.
I was able to add a ProcessDialogKey to our custom UI class and it's working well now.
Reply all
Reply to author
Forward
0 new messages