I want a SashWindowLayout with 3 small panels (below each other) on the
left side and the big remaining area to the right. All walls movable.
The approach that I’ve used to get kind of the effect I wanted was to
first add the right-side area (right-aligned), then add 2 other
top-aligned panels. Which leaves the remaining area to the panel at the
bottom left.
I got a problem with this approach, though. When resizing the main
window, the wall between the left and right part moves as well
(=increasing/decreasing the width of all left-side panels). How do I get
it to not resize?
(=increasing/decreasing the width of all left-side panels). How do I get
it to not resize?
I think the easiest solution is to make the right-hand area the
‘remaining’ area, and have the others as panels. Have a look at
sample/bigdemo/wxSashWindow.rb which seems to do this kind of thing.
The wxWidgets documents describe a sophisticated mechanism using
CalculateLayoutEvent. I haven’t used this class so didn’t really get
what was going on. But I’ll try and add the LayoutEvent classes so
they’re at least available in wxRuby.
window, the wall between the left and right part moves as well
(=increasing/decreasing the width of all left-side panels). How do I get
it to not resize?
I think the easiest solution is to make the right-hand area the
‘remaining’ area, and have the others as panels. Have a look at
sample/bigdemo/wxSashWindow.rb which seems to do this kind of thing.
Actually, I used the bigdemo sample as my starting point, but I failed
to convert it to what i needed. Bigdemo adds the stacked panels
horizontally from the left, which then gives the remaining area to the
right. If I add instead panels from the top, the remaining area is at
the bottom, and if I don’t have anything at all on the right side, the
added panels will cover the whole horizontal space.
I’ll probably try to see if it works to put a SashWindowLayout within an
existing SashWindowLayout.
Actually, I used the bigdemo sample as my starting point, but I failed
to convert it to what i needed. Bigdemo adds the stacked panels
horizontally from the left, which then gives the remaining area to the
right. If I add instead panels from the top, the remaining area is at
the bottom, and if I don’t have anything at all on the right side, the
added panels will cover the whole horizontal space.
OK, I haven’t used SashLayoutWindow to know how to make it do that
specifically.
I’ll probably try to see if it works to put a SashWindowLayout within an
existing SashWindowLayout.
Sounds good. You might find that SplitterWindow is an easier alternative
for the main partition of the window into left and right. Use
SplitterWindow#set_sash_gravity to apply all the increase in size to the
“main” right window when the parent frame is resized.
alex
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.