Code: Select all
<ExpressionDim value="Right - (Padding + ImageWidth)">
<UnifiedDim varName="Right" scale="1.0" type="RightEdge" />
<PropertyDim varName="Padding" name="PaddingRight" type="Width" />
<ImageDim varName="ImageWidth" imageset="xxx" image="xxx dimension="Width" />
</ExpressionDim>
Then I went through the code, thinking of how to implement this; it should be really easy and backwards compatible, the hardest part would be the expression parser and evaluator. Imaging my surprise when I saw that this has already been implemented and it's called "ExpressionDim"
The actual syntax is similar but uses functions instead of named variables. (Source)
Code: Select all
<ExpressionDim value="udim( 0.5, 0, Height ) + (fontdim( LineSpacing ) * 2)" />
What's the status of this feature? It doesn't seem to be available in my build (0.7.5). I saw somewhere that I have to enable it during build. Will it be on by default on 0.8?
Anyway, the reason I'm positing on this part of the forum is that I think the "fontdim" functions are missing one parameter. According to fal_element_ref.dox from Mercurial, the available fontdim signatures are:
- fontdim( widget, font, type, padding )
- fontdim( type, padding )
- fontdim( type )