From c4658ec8f281341f9c795e10436e02c6a1c8d352 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 12 Feb 2024 22:27:25 +0100 Subject: [PATCH] Get rid of IsLive() helper in wxSplitterWindow code This was useful when we had AlwaysUsesLiveResize() and the related complications, but now that live resizing is governed solely by wxSP_LIVE_UPDATE again, it's not needed any longer. No real changes. --- src/generic/splitter.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index d741ddf1ce..c163993446 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -69,15 +69,6 @@ wxBEGIN_EVENT_TABLE(wxSplitterWindow, wxWindow) #endif // wxMSW wxEND_EVENT_TABLE() -static bool IsLive(wxSplitterWindow* wnd) -{ - // with wxSP_LIVE_UPDATE style the splitter windows are always resized - // following the mouse movement while it drags the sash, without it we only - // draw the sash at the new position but only resize the windows when the - // dragging is finished - return wnd->HasFlag(wxSP_LIVE_UPDATE); -} - static wxBitmap wxPaneCreateStippleBitmap() { // Notice that wxOverlay, under wxMSW, uses the wxBLACK colour i.e.(0,0,0) @@ -239,7 +230,11 @@ void wxSplitterWindow::OnMouseEvent(wxMouseEvent& event) return; } - bool isLive = IsLive(this); + // with wxSP_LIVE_UPDATE style the splitter windows are always resized + // following the mouse movement while it drags the sash, without it we only + // draw the sash at the new position but only resize the windows when the + // dragging is finished + const bool isLive = HasFlag(wxSP_LIVE_UPDATE); if (event.LeftDown()) { @@ -414,7 +409,7 @@ void wxSplitterWindow::OnMouseCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(even SetCursor(* wxSTANDARD_CURSOR); // Erase sash tracker - if ( !IsLive(this) ) + if ( HasFlag(wxSP_LIVE_UPDATE) ) { m_overlay.Reset(); }