It is now possible to create in a xml button group, controls with a dynamic icon attribute.
<!-- A custom control defining a combo box --> <control uid="menupluglist" type="buttonmenu" title="Choose a stent model" > <param subtype="icontext" icon="#612" check="yes" combo="yes" addon="isvp-sample" addonitemlist="Stent_1,Stent_2,Stent_3,Stent_4" /> </control> <!-- Use a dynamic icon attribute to show the icon of the selected item in the control menupluglist --> <control type="icon" icon="#button(%this%,menupluglist,selectedicon)" eol="yes" />
The function can be any evaluator giving either an icon ID or an icon filename.
In this sample, menupluglist is a a custom control of type buttonmenu. The evaluator is the Button() function, asking to the custom control for the icon ID of the selected item (using the selecteditem property).
You can see the complete sample sample-controls-combo box.buttongroup.