splitter doesn't change position when the window containing it is minimized and restored
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -352,8 +352,36 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxSplitterWindow::OnSize(wxSizeEvent& WXUNUSED(event))
|
void wxSplitterWindow::OnSize(wxSizeEvent& event)
|
||||||
{
|
{
|
||||||
|
// only process this message if we're not iconized - otherwise iconizing
|
||||||
|
// and restoring a window containing the splitter has a funny side effect
|
||||||
|
// of changing the splitter position!
|
||||||
|
wxWindow *parent = GetParent();
|
||||||
|
while ( parent && !parent->IsTopLevel() )
|
||||||
|
{
|
||||||
|
parent = parent->GetParent();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool iconized = false;
|
||||||
|
wxFrame *frame = wxDynamicCast(parent, wxFrame);
|
||||||
|
if ( frame )
|
||||||
|
iconized = frame->IsIconized();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
wxDialog *dialog = wxDynamicCast(parent, wxDialog);
|
||||||
|
if ( dialog )
|
||||||
|
iconized = dialog->IsIconized();
|
||||||
|
else
|
||||||
|
wxFAIL_MSG(_T("should have a top level frame or dialog parent!"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( iconized )
|
||||||
|
{
|
||||||
|
event.Skip();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
int cw, ch;
|
int cw, ch;
|
||||||
GetClientSize( &cw, &ch );
|
GetClientSize( &cw, &ch );
|
||||||
if ( m_windowTwo )
|
if ( m_windowTwo )
|
||||||
@@ -369,7 +397,9 @@ void wxSplitterWindow::OnSize(wxSizeEvent& WXUNUSED(event))
|
|||||||
m_sashPosition = wxMax(10, ch - 40);
|
m_sashPosition = wxMax(10, ch - 40);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SizeWindows();
|
SizeWindows();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool wxSplitterWindow::SashHitTest(int x, int y, int tolerance)
|
bool wxSplitterWindow::SashHitTest(int x, int y, int tolerance)
|
||||||
|
Reference in New Issue
Block a user