wxsplitterwindow overview
classes: wxsplitterwindow
the following screenshot shows the appearance of a splitter window with a horizontal split.
the style wxsp_3d has been used to show a 3d border and 3d sash.
example
example
the following fragment shows how to create a splitter window, creating two
subwindows and hiding one of them.
splitter = new wxsplitterwindow(this, -1, wxpoint(0, 0), wxsize(400, 400), wxsp_3d);
leftwindow = new mywindow(splitter);
leftwindow->setscrollbars(20, 20, 50, 50);
rightwindow = new mywindow(splitter);
rightwindow->setscrollbars(20, 20, 50, 50);
rightwindow->show(false);
splitter->initialize(leftwindow);
// set this to prevent unsplitting
// splitter->setminimumpanesize(20);
the next fragment shows how the splitter window can be manipulated after creation.
void myframe::onsplitvertical(wxcommandevent& event)
{
if ( splitter->issplit() )
splitter->unsplit();
leftwindow->show(true);
rightwindow->show(true);
splitter->splitvertically( leftwindow, rightwindow );
}
void myframe::onsplithorizontal(wxcommandevent& event)
{
if ( splitter->issplit() )
splitter->unsplit();
leftwindow->show(true);
rightwindow->show(true);
splitter->splithorizontally( leftwindow, rightwindow );
}
void myframe::onunsplit(wxcommandevent& event)
{
if ( splitter->issplit() )
splitter->unsplit();
}
|