How to put text in ImageButton without using statictext ?[SO
Posted: Tue Sep 20, 2011 09:17
Hi everybody,
Do you know if is that possible to change ImageButton section in looknfeel file (from taharezlook) to be able to use "Text" property for this widget in layout file ?
I just tried to put a text component in ImageButton section in looknfeel file but it does not work (see below what I added to defaut taharezlook looknfeel file)...
I guess something is missing because my text is not displayed but I do not find what...
Thanks for your help.
Do you know if is that possible to change ImageButton section in looknfeel file (from taharezlook) to be able to use "Text" property for this widget in layout file ?
I just tried to put a text component in ImageButton section in looknfeel file but it does not work (see below what I added to defaut taharezlook looknfeel file)...
Code: Select all
***************************************************
TaharezLook/ImageButton
***************************************************
-->
<WidgetLook name="TaharezLook/ImageButton">
<PropertyDefinition name="NormalTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
<PropertyDefinition name="HoverTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
<PropertyDefinition name="PushedTextColour" initialValue="FFFFFFFF" redrawOnWrite="true" />
<PropertyDefinition name="DisabledTextColour" initialValue="FF7F7F7F" redrawOnWrite="true" />
<PropertyDefinition name="NormalImage" initialValue="imgBtnNormal" redrawOnWrite="true" />
<PropertyDefinition name="HoverImage" initialValue="imgBtnHoverl" redrawOnWrite="true" />
<PropertyDefinition name="PushedImage" initialValue="imgBtnPushed" redrawOnWrite="true" />
<PropertyDefinition name="DisabledImage" initialValue="imgBtnDisabled" redrawOnWrite="true" />
<PropertyDefinition name="VertImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
<PropertyDefinition name="HorzImageFormatting" initialValue="Stretched" redrawOnWrite="true" />
<ImagerySection name="label">
<TextComponent>
<Area>
<Dim type="LeftEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge"><AbsoluteDim value="0" /></Dim>
<Dim type="Width"><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height"><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<VertFormatProperty name="VertLabelFormatting" />
<HorzFormatProperty name="HorzLabelFormatting" />
</TextComponent>
</ImagerySection>
<ImagerySection name="normal">
<ImageryComponent>
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<ImageProperty name="NormalImage" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="hover">
<ImageryComponent>
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<ImageProperty name="HoverImage" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="pushed">
<ImageryComponent>
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<ImageProperty name="PushedImage" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<ImagerySection name="disabled">
<ImageryComponent>
<Area>
<Dim type="LeftEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="TopEdge" ><AbsoluteDim value="0" /></Dim>
<Dim type="Width" ><UnifiedDim scale="1" type="Width" /></Dim>
<Dim type="Height" ><UnifiedDim scale="1" type="Height" /></Dim>
</Area>
<ImageProperty name="DisabledImage" />
<VertFormatProperty name="VertImageFormatting" />
<HorzFormatProperty name="HorzImageFormatting" />
</ImageryComponent>
</ImagerySection>
<StateImagery name="Normal">
<Layer>
<Section section="normal" />
</Layer>
</StateImagery>
<StateImagery name="Hover">
<Layer>
<Section section="hover" />
</Layer>
</StateImagery>
<StateImagery name="Pushed">
<Layer>
<Section section="pushed" />
</Layer>
</StateImagery>
<StateImagery name="PushedOff">
<Layer>
<Section section="hover" />
</Layer>
</StateImagery>
<StateImagery name="Disabled">
<Layer>
<Section section="disabled" />
</Layer>
</StateImagery>
</WidgetLook>
I guess something is missing because my text is not displayed but I do not find what...
Thanks for your help.