Add a SetDoubleBuffered method for wxMSW (XP+)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@53929 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -429,6 +429,10 @@ public:
|
|||||||
// check if a native double-buffering applies for this window
|
// check if a native double-buffering applies for this window
|
||||||
virtual bool IsDoubleBuffered() const;
|
virtual bool IsDoubleBuffered() const;
|
||||||
|
|
||||||
|
#if wxABI_VERSION >= 20808
|
||||||
|
void SetDoubleBuffered(bool on);
|
||||||
|
#endif
|
||||||
|
|
||||||
// synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false
|
// synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false
|
||||||
void GenerateMouseLeave();
|
void GenerateMouseLeave();
|
||||||
|
|
||||||
|
@@ -4176,17 +4176,32 @@ bool wxWindowMSW::HandlePower(WXWPARAM WXUNUSED_IN_WINCE(wParam),
|
|||||||
|
|
||||||
bool wxWindowMSW::IsDoubleBuffered() const
|
bool wxWindowMSW::IsDoubleBuffered() const
|
||||||
{
|
{
|
||||||
for ( const wxWindowMSW *wnd = this;
|
const wxWindowMSW *wnd = this;
|
||||||
wnd && !wnd->IsTopLevel(); wnd =
|
do {
|
||||||
wnd->GetParent() )
|
long style = ::GetWindowLong(GetHwndOf(wnd), GWL_EXSTYLE);
|
||||||
{
|
if ( (style & WS_EX_COMPOSITED) != 0 )
|
||||||
if ( ::GetWindowLong(GetHwndOf(wnd), GWL_EXSTYLE) & WS_EX_COMPOSITED )
|
|
||||||
return true;
|
return true;
|
||||||
}
|
wnd = wnd->GetParent();
|
||||||
|
} while ( wnd && !wnd->IsTopLevel() );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowMSW::SetDoubleBuffered(bool on)
|
||||||
|
{
|
||||||
|
// Get the current extended style bits
|
||||||
|
long exstyle = ::GetWindowLong(GetHwnd(), GWL_EXSTYLE);
|
||||||
|
|
||||||
|
// Twiddle the bit as needed
|
||||||
|
if ( on )
|
||||||
|
exstyle |= WS_EX_COMPOSITED;
|
||||||
|
else
|
||||||
|
exstyle &= ~WS_EX_COMPOSITED;
|
||||||
|
|
||||||
|
// put it back
|
||||||
|
::SetWindowLong(GetHwnd(), GWL_EXSTYLE, exstyle);
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
// owner drawn stuff
|
// owner drawn stuff
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user