screenDC.SetBrush(wxNullBrush);
}
+void wxSplitterWindow::AdjustSashPosition(int &sashPos)
+{
+ int w, h;
+ GetClientSize(&w, &h);
+ int window_size = (m_splitMode == wxSPLIT_VERTICAL) ? w : h;
+ wxWindow *win;
+
+ if ( sashPos < m_minimumPaneSize )
+ sashPos = m_minimumPaneSize;
+ else if ( sashPos > window_size - m_minimumPaneSize )
+ sashPos = window_size - m_minimumPaneSize;
+
+ win = GetWindow1();
+ if ( win )
+ {
+ int minSize = (m_splitMode == wxSPLIT_VERTICAL) ?
+ win->GetMinWidth() : win->GetMinHeight();
+ if ( minSize != -1 && sashPos < minSize + GetBorderSize() )
+ sashPos = minSize + GetBorderSize();
+ }
+
+ win = GetWindow2();
+ if ( win )
+ {
+ int minSize = (m_splitMode == wxSPLIT_VERTICAL) ?
+ win->GetMinWidth() : win->GetMinHeight();
+ if ( minSize != -1 && sashPos > window_size - minSize - GetBorderSize() )
+ sashPos = window_size - minSize - GetBorderSize();
+ }
+}
+
// Position and size subwindows.
// Note that the border size applies to each subwindow, not
// including the edges next to the sash.
m_sashPosition = w + sashPosition; // It's negative so adding is subtracting
else // default
m_sashPosition = w/2;
+
+ AdjustSashPosition(m_sashPosition);
SizeWindows();
else // default
m_sashPosition = h/2;
+ AdjustSashPosition(m_sashPosition);
+
SizeWindows();
return TRUE;
void wxSplitterWindow::SetSashPosition(int position, bool redraw)
{
m_sashPosition = position;
+ AdjustSashPosition(m_sashPosition);
if ( redraw )
{
// Shadow colours
#ifndef __WIN16__
- wxColour faceColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
+ wxColour faceColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
m_facePen = new wxPen(faceColour, 1, wxSOLID);
m_faceBrush = new wxBrush(faceColour, wxSOLID);
- wxColour mediumShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW));
+ wxColour mediumShadowColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW));
m_mediumShadowPen = new wxPen(mediumShadowColour, 1, wxSOLID);
- wxColour darkShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DDKSHADOW));
+ wxColour darkShadowColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DDKSHADOW));
m_darkShadowPen = new wxPen(darkShadowColour, 1, wxSOLID);
- wxColour lightShadowColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT));
+ wxColour lightShadowColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT));
m_lightShadowPen = new wxPen(lightShadowColour, 1, wxSOLID);
- wxColour hilightColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DHILIGHT));
+ wxColour hilightColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DHILIGHT));
m_hilightPen = new wxPen(hilightColour, 1, wxSOLID);
#else
m_facePen = new wxPen("LIGHT GREY", 1, wxSOLID);
if ( !unsplit_scenario )
{
// If resultant pane would be too small, enlarge it
- if ( newSashPosition < m_minimumPaneSize )
- newSashPosition = m_minimumPaneSize;
- if ( newSashPosition > window_size - m_minimumPaneSize )
- newSashPosition = window_size - m_minimumPaneSize;
+ AdjustSashPosition(newSashPosition);
}
// If the result is out of bounds it means minimum size is too big,