From c98fa0ca98c59d6839b5c7d1b1332a797f6e82de Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 11 Nov 2017 11:47:56 +0100 Subject: [PATCH] Add wxWindowBase::SetDoubleBuffered() stub This method was already provided by wxGTK and wxMSW, but not wxOSX nor any other ports. Provide a stub for it in wxWindowBase to allow user code to call it on all platforms, there is no harm in that even if it doesn't (and can't) do anything under macOS. --- include/wx/gtk/window.h | 3 +-- include/wx/msw/window.h | 4 +--- include/wx/window.h | 3 +++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/wx/gtk/window.h b/include/wx/gtk/window.h index bdb117d5eb..0de679577a 100644 --- a/include/wx/gtk/window.h +++ b/include/wx/gtk/window.h @@ -122,8 +122,7 @@ public: virtual bool DoIsExposed( int x, int y ) const wxOVERRIDE; virtual bool DoIsExposed( int x, int y, int w, int h ) const wxOVERRIDE; - // currently wxGTK2-only - void SetDoubleBuffered(bool on); + virtual void SetDoubleBuffered(bool on) wxOVERRIDE; virtual bool IsDoubleBuffered() const wxOVERRIDE; // SetLabel(), which does nothing in wxWindow diff --git a/include/wx/msw/window.h b/include/wx/msw/window.h index a533d90c33..286d9855ad 100644 --- a/include/wx/msw/window.h +++ b/include/wx/msw/window.h @@ -532,11 +532,9 @@ public: // check if mouse is in the window bool IsMouseInWindow() const; - // check if a native double-buffering applies for this window + virtual void SetDoubleBuffered(bool on) wxOVERRIDE; virtual bool IsDoubleBuffered() const wxOVERRIDE; - void SetDoubleBuffered(bool on); - // synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false void GenerateMouseLeave(); diff --git a/include/wx/window.h b/include/wx/window.h index 36ef7126dc..440f097a21 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -1065,6 +1065,9 @@ public: // adjust DC for drawing on this window virtual void PrepareDC( wxDC & WXUNUSED(dc) ) { } + // enable or disable double buffering + virtual void SetDoubleBuffered(bool WXUNUSED(on)) { } + // return true if the window contents is double buffered by the system virtual bool IsDoubleBuffered() const { return false; }