PropertyLinkDefinition: map or multimap?
Posted: Thu Feb 18, 2010 17:01
Hello,
NOTE I hope this issue hasn't come up before- I did a brief troll first.
I recently developed a custom CEGUI control that was a collection of child controls (similar to Combobox). As I understand the existing PropertyLinkDefinition allows a parent property to be map/linked to a child property. For example the color property of a the parent could be mapped to a child's color property.
In my case what I am interested in doing is mapping several parent color properties to multiple children controls. IE the color of the parent would get mapped/linked to multiple children.
The existing implementation of PropertySet uses a map which only allows one-to-one mapping. As soon as you try to add another property of the same name it throws an error. For my own purposes I have modified this to be a multi-map which allows one-to-many mapping (for PropertyLinkDefinitions only). I would like to see either my changes (need to be cleaned up a little and maybe a couple of behavioral questions answered) pushed back in to the code base or someone else implement something similar.
Thoughts?
PS My result looks something like the following in my looknfeel file:
NOTE I hope this issue hasn't come up before- I did a brief troll first.
I recently developed a custom CEGUI control that was a collection of child controls (similar to Combobox). As I understand the existing PropertyLinkDefinition allows a parent property to be map/linked to a child property. For example the color property of a the parent could be mapped to a child's color property.
In my case what I am interested in doing is mapping several parent color properties to multiple children controls. IE the color of the parent would get mapped/linked to multiple children.
The existing implementation of PropertySet uses a map which only allows one-to-one mapping. As soon as you try to add another property of the same name it throws an error. For my own purposes I have modified this to be a multi-map which allows one-to-many mapping (for PropertyLinkDefinitions only). I would like to see either my changes (need to be cleaned up a little and maybe a couple of behavioral questions answered) pushed back in to the code base or someone else implement something similar.
Thoughts?
PS My result looks something like the following in my looknfeel file:
Code: Select all
<WidgetLook name="ProcerusLook/SplitButton">
<PropertyLinkDefinition name="ButtonColor" widget="__auto_primary_button__" targetProperty="ButtonColor" initialValue="ff1e3cba" />
<PropertyLinkDefinition name="ButtonColor" widget="__auto_dd_button__" targetProperty="ButtonColor" initialValue="ff1e3cba" />
<PropertyLinkDefinition name="NormalHighlightColor" widget="__auto_primary_button__" targetProperty="NormalHighlightColor" initialValue="ff1e3cba" />
<PropertyLinkDefinition name="NormalHighlightColor" widget="__auto_dd_button__" targetProperty="NormalHighlightColor" initialValue="ff1e3cba" />
<PropertyLinkDefinition name="PushedHighlightColor" widget="__auto_primary_button__" targetProperty="PushedHighlightColor" initialValue="ff1e3cba" />
<PropertyLinkDefinition name="PushedHighlightColor" widget="__auto_dd_button__" targetProperty="PushedHighlightColor" initialValue="ff1e3cba" />
<PropertyLinkDefinition name="HoverHighlightColor" widget="__auto_primary_button__" targetProperty="HoverHighlightColor" initialValue="ff1e3cba" />
<PropertyLinkDefinition name="HoverHighlightColor" widget="__auto_dd_button__" targetProperty="HoverHighlightColor" initialValue="ff1e3cba" />
...
</WidgetLook>