Rely on native double buffering by default in wxPropertyGrid
If the platform has native double-buffering, instruct wxPropertyGrid to rely on it by default. Closes #16978.
This commit is contained in:
@@ -37,6 +37,8 @@
|
|||||||
#include "wx/intl.h"
|
#include "wx/intl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/dcbuffer.h" // for wxALWAYS_NATIVE_DOUBLE_BUFFER
|
||||||
|
|
||||||
// This define is necessary to prevent macro clearing
|
// This define is necessary to prevent macro clearing
|
||||||
#define __wxPG_SOURCE_FILE__
|
#define __wxPG_SOURCE_FILE__
|
||||||
|
|
||||||
@@ -587,7 +589,12 @@ void wxPropertyGridManager::Init2( int style )
|
|||||||
|
|
||||||
m_pState = m_pPropGrid->m_pState;
|
m_pState = m_pPropGrid->m_pState;
|
||||||
|
|
||||||
|
// Rely on native double-buffering by default.
|
||||||
|
#if wxALWAYS_NATIVE_DOUBLE_BUFFER
|
||||||
|
m_pPropGrid->SetExtraStyle(wxPG_EX_INIT_NOCAT | wxPG_EX_NATIVE_DOUBLE_BUFFERING);
|
||||||
|
#else
|
||||||
m_pPropGrid->SetExtraStyle(wxPG_EX_INIT_NOCAT);
|
m_pPropGrid->SetExtraStyle(wxPG_EX_INIT_NOCAT);
|
||||||
|
#endif // wxALWAYS_NATIVE_DOUBLE_BUFFER/!wxALWAYS_NATIVE_DOUBLE_BUFFER
|
||||||
|
|
||||||
// Connect to property grid onselect event.
|
// Connect to property grid onselect event.
|
||||||
// NB: Even if wxID_ANY is used, this doesn't connect properly in wxPython
|
// NB: Even if wxID_ANY is used, this doesn't connect properly in wxPython
|
||||||
|
@@ -484,6 +484,11 @@ void wxPropertyGrid::Init2()
|
|||||||
// This helps with flicker
|
// This helps with flicker
|
||||||
SetBackgroundStyle( wxBG_STYLE_CUSTOM );
|
SetBackgroundStyle( wxBG_STYLE_CUSTOM );
|
||||||
|
|
||||||
|
// Rely on native double-buffering by default.
|
||||||
|
#if wxALWAYS_NATIVE_DOUBLE_BUFFER
|
||||||
|
SetExtraStyle(GetExtraStyle() | wxPG_EX_NATIVE_DOUBLE_BUFFERING);
|
||||||
|
#endif // wxALWAYS_NATIVE_DOUBLE_BUFFER
|
||||||
|
|
||||||
// Hook the top-level parent
|
// Hook the top-level parent
|
||||||
m_tlpClosed = NULL;
|
m_tlpClosed = NULL;
|
||||||
m_tlpClosedTime = 0;
|
m_tlpClosedTime = 0;
|
||||||
@@ -1153,26 +1158,9 @@ void wxPropertyGrid::SetExtraStyle( long exStyle )
|
|||||||
|
|
||||||
if ( exStyle & wxPG_EX_NATIVE_DOUBLE_BUFFERING )
|
if ( exStyle & wxPG_EX_NATIVE_DOUBLE_BUFFERING )
|
||||||
{
|
{
|
||||||
#if defined(__WXMSW__)
|
|
||||||
|
|
||||||
/*
|
|
||||||
// Don't use WS_EX_COMPOSITED just now.
|
|
||||||
HWND hWnd;
|
|
||||||
|
|
||||||
if ( m_iFlags & wxPG_FL_IN_MANAGER )
|
|
||||||
hWnd = (HWND)GetParent()->GetHWND();
|
|
||||||
else
|
|
||||||
hWnd = (HWND)GetHWND();
|
|
||||||
|
|
||||||
::SetWindowLong( hWnd, GWL_EXSTYLE,
|
|
||||||
::GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_COMPOSITED );
|
|
||||||
*/
|
|
||||||
|
|
||||||
//#elif defined(__WXGTK20__)
|
|
||||||
#endif
|
|
||||||
// Only apply wxPG_EX_NATIVE_DOUBLE_BUFFERING if the window
|
// Only apply wxPG_EX_NATIVE_DOUBLE_BUFFERING if the window
|
||||||
// truly was double-buffered.
|
// truly was double-buffered.
|
||||||
if ( !this->IsDoubleBuffered() )
|
if ( !IsDoubleBuffered() )
|
||||||
{
|
{
|
||||||
exStyle &= ~(wxPG_EX_NATIVE_DOUBLE_BUFFERING);
|
exStyle &= ~(wxPG_EX_NATIVE_DOUBLE_BUFFERING);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user