Guys,
I have a bug which I can’t solve at the moment. I tried various
solutions, changing the sizers and lots of different ways, I still
couldn’t fix it.
In my code, I have basically two ListBox in the same panel, one above
the other.
When the upper ListBox has too many elements, I have a nice scroll bar,
and looks good. But When I resize my complete frame, it draws itself
over the bottom one, and I can’t see it anymore. And the scroll bar is
even gone, so I can’t even see all the elements.
Here is my code:
def initialize title, xml_h
super(nil, -1, title)
@xml_helper = xml_h
global_sizer = BoxSizer.new(VERTICAL)
@top_p = Panel.new(self)
@bottom_p = Panel.new(self)
global_sizer.add(@top_p, 3, GROW|ALL, 2)
global_sizer.add(@bottom_p, 1, GROW|ALL, 2)
top_sizer = BoxSizer.new(HORIZONTAL)
@m_list = ListBox.new(@top_p, -1, DEFAULT_POSITION, DEFAULT_SIZE,
@xml_helper.get_magicians, LB_SINGLE|LB_SORT|DOUBLE_BORDER)
evt_listbox @m_list, :on_magician_pressed
top_sizer.add(@m_list,1, GROW|ALL, 2)
@mc = MediaCtrl.new(@top_p)
evt_media_loaded @mc,:on_media_loaded
top_sizer.add(@mc, 3, GROW|ALL, 2)
right_sizer = GridSizer.new(2, 0, 2, 2)
right_p = Panel.new(@top_p)
right_p.fit
right_p.set_sizer right_sizer
@v_list = ListBox.new(right_p, -1, DEFAULT_POSITION, DEFAULT_SIZE, [],
LB_SINGLE)
evt_listbox @v_list, :on_video_pressed
right_sizer.add @v_list
@t_list = ListBox.new(right_p, -1, DEFAULT_POSITION, DEFAULT_SIZE, [],
LB_SINGLE)
evt_listbox @t_list, :on_trick_pressed
right_sizer.add @t_list
top_sizer.add(right_p, 1, ALIGN_RIGHT, 2)
@top_p.sizer = top_sizer
self.sizer = global_sizer
show
end
Note that the @bottom_p isn’t used, but will be later, once I have fixed
that.
So the problematic code lies with the right_sizer and the right_p (p for
Panel)
The @v_list is the upper ListBox and @t_list is the bottom one.
Appreciate the help,
Pierre