3 controls side by side - stretching?

simed

27-03-2012 17:46:10

I have 3 h-scrollbars in a row, taking up full width of their container. Each is 133px wide and parent is 400px. When parent changes size I want the controls to scale so they continue taking up 1/3 width each... nothing I try can make this quite work right, they stretch but end up overlapping.
<Widget type="Widget" skin="PanelSkin" position="0 0 400 32" align="HStretch Top">
<Widget type="ScrollBar" skin="ScrollBarH" position="266 15 130 13" align="HStretch Top" name="sliderZoom">
<Property key="Range" value="1000"/>
<Property key="RangePosition" value="500"/>
<Property key="Alpha" value="1"/>
<Property key="Page" value="50"/>
</Widget>
<Widget type="ScrollBar" skin="ScrollBarH" position="2 15 133 13" align="HStretch Top" name="sliderMultiplane">
<Property key="Range" value="1000"/>
<Property key="RangePosition" value="500"/>
<Property key="Page" value="50"/>
</Widget>
<Widget type="ScrollBar" skin="ScrollBarH" position="133 15 133 13" align="HStretch Top" name="sliderTilt">
<Property key="Range" value="1000"/>
<Property key="RangePosition" value="500"/>
<Property key="Page" value="50"/>
</Widget>
</Widget>
Is this something I can do? It seems like I want to tell things to be both left/right/center AND stretch?

Altren

28-03-2012 12:17:43

You can't do that using aligns. You should use eventWindowChangeCoord for Window widget or something like that to catch resizing events and then manually set position and size.

simed

28-03-2012 14:08:09

Ah, OK. Thanks for clearing that up.