Right-to-left panel layout
I have a situation in which I want to lay out panels in a horizontal arrangement starting from the right end. For simplicity let's consider the case of just two child panels contained in a parent panel. The right-hand panel has some desired width, there's a small gap between panels, and the left-hand panel gets whatever space is left over. So we have:
WP = width in pixels of parent panel
WL = width in pixels of left-hand panel
WR = width in pixels of right-hand panel
WG = width in pixels of gap
So far this looks easy: WL = WP - WR - WG. The catch is that I don't know the value (in pixels) of WP. If I could express WR and WG as fractions of WP (call them FR and FG), then I could set FL = 1.0 - FR - FG. But that doesn't work either because I want WR to scale with the size of the entire UI, not the size of the parent panel. So I can't calculate FR without knowing WP.
If this were a left-to-right layout, I could do it with a Horizontal arrangement in the parent panel, and just specify a size of 1.0 for the leftovers. But there doesn't seem to be an easy way to do it the other way round, i.e. putting the leftovers on the left (so to speak).
Any ideas? Am I missing something obvious for getting the value of WP?
__________________
-- Greg
|