Adding toolTips to a Spark ButtonBar
This question came up today as to how to add toolTips to individual Buttons in your ButtonBar. No surprise here… the solution was to create a custom skin for ButtonBar. In the custom skin, I am adding a toolTip to the firstButton, middleButton and lastButton. I assume that people will want to display some text that is in their dataProvider as the toolTip. In my ButtonBar skin, everything is the same except for these component definitions of the Buttons:
<fx:Component id="firstButton">
<s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarFirstButtonSkin"
toolTip="{data.data}" />
</fx:Component>
<fx:Component id="middleButton" >
<s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarMiddleButtonSkin"
toolTip="{data.data}" />
</fx:Component>
<fx:Component id="lastButton" >
<s:ButtonBarButton skinClass="spark.skins.spark.ButtonBarLastButtonSkin"
toolTip="{data.data}" />
</fx:Component>
Run the Sample: ButtonBarExample.swf
Source Code: ButtonBarExample.mxml, ButtonBarToolTiipSkin.mxml
Advertisement
Like this:
Be the first to like this post.
~ by jlafferty on April 6, 2011.
Posted in ButtonBar, Spark Components


Thanks! This helped out. Not sure why they disabled toolTip in the dataprovider for Spark ButtonBars