I'm building a layout for a console app and here's what I want to achieve. What I have so far is this. My main window is deriving from a wxFrame. I split the window using wxSplitterWindow into two windows : the one on the left - a wxTreeCtrl and the one on the right is a wxPanel. My question is how to achieve the following: a horizontal list (perhaps a grid?) that shows like records from a db, but with a scroll, so that only like 20-30 are shown, and a simple textarea below this table(grid?).
I tried to split the wxPanel, just like I did with the Frame, but it doesn't work. When I tried to change the Panel to a Frame it worked, but the Frame is opened in a new window. So now I'm asking what elements to use and how to position them so that I have a scrollable table, a horizontal line, and then a simple textarea. The horizontal line should be in the middle of the left panel. Here's my code for the right panel so far: package RightPanel;
use strict;
use base qw(Wx::Panel);
use Wx qw(:everything);
sub new {
my ($class, $parent_window) = @_;
my ($self) = $class->SUPER::new($parent_window);
return $self;
}
Create a BoxSizer with wxHORIZONTAL flag for the window.
In this BoxSizer, create a Panel (your left-side area) and another BoxSizer -- with wxVERTICAL flag -- as your right-side area. (the above wxHORIZONTAL flag will put these two side-by-side).
In the right-side BoxSizer, create a ScrolledWindow (top part) and a Panel (bottom part). The wxVERTICAL flag in the right-side BoxSizer will stack these on vertically.
Sizers are tricky to get your head around if you've never played with them before... this might help: Sizers and Layout