2012-08-30, 18:42
I have a bunch of textboxes in a skin that need to be sized conditionally on the visibility of some other controls. I wanted to make an include to work this out rather than duplicating the conditional everywhere, so I thought to do something like:
Which of course doesn't work, as conditional includes are only evaluated at startup.
But.. is there a nice way to do what I'm after?
Code:
<include name="PlotBox_Small">
<height>68</height>
<autoscroll time="4000" delay="12000" repeat="8000">Skin.HasSetting(AutoScroll)</autoscroll>
<font>METF_PlotTextSmall</font>
</include>
<include name="PlotBox_Large">
<height>135</height>
<autoscroll time="4000" delay="16000" repeat="8000">Skin.HasSetting(AutoScroll)</autoscroll>
<font>METF_PlotTextMedium</font>
</include>
<include name="PlotBox">
<posx>300</posx>
<posy>565</posy>
<width>750</width>
<textcolor>LowerText</textcolor>
<include condition="Control.IsVisible(9902) | Control.IsVisible(9905) | Control.IsVisible(9906)">PlotBox_Small</include>
<include condition="![Control.IsVisible(9902) | Control.IsVisible(9905) | Control.IsVisible(9906)]">PlotBox_Large</include>
</include>
Which of course doesn't work, as conditional includes are only evaluated at startup.
But.. is there a nice way to do what I'm after?