Code: Select all
// Main panel of the app
m_MainPanel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
// Creating top splitter window
m_TopSplitter = new wxSplitterWindow(m_MainPanel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_BORDER | wxSP_LIVE_UPDATE);
m_TopSplitter->SetMinimumPaneSize(200);
m_TopSplitter->SetSashGravity(0);
// Top half of TopSplitter window
m_TopPanel = new wxPanel(m_TopSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
// Bottom half of the TopSplitter window
m_BottomSplitter = new wxSplitterWindow(m_TopSplitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_BORDER | wxSP_LIVE_UPDATE);
m_BottomSplitter->SetMinimumPaneSize(300);
m_BottomSplitter->SetSashGravity(0.2);
.
.
.
// Set split direction
m_TopSplitter->SplitHorizontally(m_TopPanel, m_BottomSplitter);
m_BottomSplitter->SplitVertically(m_BottomLeftPanel, m_BottomRightPanel);
These are the 2 splitter window in photo above, I set the SashGravity(), but for some reason both splitters always open in middle of the application. I tried multiple values, from 0-0.1, to 0.9-1. I also tried setting the position manually by calling SetSashPosition() but it does not seem to work either. I want to always open the splitters sash on their minimum set size, i.e 200 for the top splitter and 300 for the bottom splitter.
Also the flag wxSP_BORDER, wxSP_NOBORDER, wxSP_3DBORDER, wxSP_3D no matter I use they all look same, I can't see a difference. I wanted to use wxSP_THIN_SASH as I want the splitter, the drag-able space to be thin.