X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/25102676bc62ae5fb4bf3e71665bbe4276de6b81..43c5b6e808f083617eb42cb48e77366844f8fb5c:/src/generic/splitter.cpp diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 257939be07..411595f88f 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -39,10 +39,10 @@ #include -wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, wxSplitterEvent ) -wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, wxSplitterEvent ) -wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, wxSplitterEvent ) -wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_UNSPLIT, wxSplitterEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, wxSplitterEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, wxSplitterEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, wxSplitterEvent ); +wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_UNSPLIT, wxSplitterEvent ); IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow) @@ -614,7 +614,7 @@ int wxSplitterWindow::AdjustSashPosition(int sashPos) const minSize = m_minimumPaneSize; int maxSize = GetWindowSize() - minSize - GetBorderSize() - GetSashSize(); - if ( maxSize > 0 && sashPos > maxSize ) + if ( maxSize > 0 && sashPos > maxSize && maxSize >= m_minimumPaneSize) sashPos = maxSize; } @@ -924,9 +924,12 @@ wxSize wxSplitterWindow::DoGetBestSize() const pSash = &sizeBest.y; } - // account for the border and the sash + // account for the sash if the window is actually split + if ( m_windowOne && m_windowTwo ) + *pSash += GetSashSize(); + + // account for the border too int border = 2*GetBorderSize(); - *pSash += GetSashSize(); sizeBest.x += border; sizeBest.y += border;