// Associates the given window with window 2, drawing the appropriate sash // and changing the split mode. // Does nothing and returns false if the window is already split. bool wxSplitterWindow::DoSplit(wxSplitMode mode, wxWindow *window1, wxWindow *window2, int sashPosition) { if ( IsSplit() ) return false; wxCHECK_MSG( window1 && window2, false, wxT("cannot split with NULL window(s)") ); wxCHECK_MSG( window1->GetParent() == this && window2->GetParent() == this, false, wxT("windows in the splitter should have it as parent!") ); if (! window1->IsShown()) window1->Show(); if (! window2->IsShown()) window2->Show(); m_splitMode = mode; m_windowOne = window1; m_windowTwo = window2; SetSashPosition(sashPosition, true); return true; }
// Size event handler void ExtSplitterWindow::OnSize(wxSizeEvent& e) { TDEBUG_ENTER("ExtSplitterWindow::OnSize"); if (m_RightSashPos >= 0) { SetSashPosition(e.GetSize().GetHeight() - m_RightSashPos); } e.Skip(); }
void OnExpandEvent(wxCommandEvent& event){ if(resizing) return; int h = GetSashSize() + expando->GetMinSize().GetHeight(); //printf("Expando Event resize: %d\n", h); //printf("MaxHeight: %d\tMaxSize.Height: %d\n", expando->GetMaxHeight(), expando->GetMaxSize().GetHeight()); //printf("MinHeight: %d\tMinSize.Height: %d\n\n", expando->GetMinHeight(), expando->GetMinSize().GetHeight()); SetSashPosition(GetSize().GetHeight() - h); //SetSashPosition(GetSize().GetHeight() - GetSashSize() - expando->GetMinSize().GetHeight()); }
void CViewBase::PostUpdateSelection() { m_pTaskPane->UpdateControls(); Layout(); // Adjust the width of the task pane so that it can be fully displayed. // if (IsSplit()) { wxSize sz = m_pTaskPane->GetVirtualSize(); SetSashPosition(sz.GetWidth(), true); } }
void wxSplitterWindow::SetMinimumPaneSize(int min) { m_minimumPaneSize = min; int pos = m_requestedSashPosition != INT_MAX ? m_requestedSashPosition : m_sashPosition; SetSashPosition(pos); // re-check limits }
// Set right sash position void ExtSplitterWindow::SetRightSashPosition(int position, const bool redraw) { SetSashPosition(GetWindowSize() - position, redraw); m_RightSashPos = position; }