X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f66b7050e0ccca3dc2f2c6d235651d2e5844faab..2845ddc25c401eab92825563a27aade46f7cfe3d:/src/generic/sashwin.cpp diff --git a/src/generic/sashwin.cpp b/src/generic/sashwin.cpp index 2b4c57472c..2553c9f700 100644 --- a/src/generic/sashwin.cpp +++ b/src/generic/sashwin.cpp @@ -96,10 +96,8 @@ void wxSashWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); -#if 0 - if ( m_borderSize > 0 ) - DrawBorders(dc); -#endif + // if ( m_borderSize > 0 ) + DrawBorders(dc); DrawSashes(dc); } @@ -115,13 +113,21 @@ void wxSashWindow::OnMouseEvent(wxMouseEvent& event) { if ( sashHit != wxSASH_NONE ) { - CaptureMouse(); + CaptureMouse(); // Required for X to specify that - // that we wish to draw on top of all windows - // - and we optimise by specifying the area - // for creating the overlap window. - wxScreenDC::StartDrawingOnTop(this); + // that we wish to draw on top of all windows + // - and we optimise by specifying the area + // for creating the overlap window. + // Find the first frame or dialog and use this to specify + // the area to draw on. + wxWindow* parent = this; + + while (parent && !parent->IsKindOf(CLASSINFO(wxDialog)) && + !parent->IsKindOf(CLASSINFO(wxFrame))) + parent = parent->GetParent(); + + wxScreenDC::StartDrawingOnTop(parent); // We don't say we're dragging yet; we leave that // decision for the Dragging() branch, to ensure @@ -527,9 +533,9 @@ void wxSashWindow::SizeWindows() int cw, ch; GetClientSize(&cw, &ch); - if (GetChildren()->Number() > 0) + if (GetChildren().Number() > 0) { - wxWindow* child = (wxWindow*) (GetChildren()->First()->Data()); + wxWindow* child = (wxWindow*) (GetChildren().First()->Data()); int x = 0; int y = 0;