Revert "Document WS_EX_COMPOSITED impact on wxClientDC"

This reverts commit b0ed71658d.
This commit is contained in:
Vadim Zeitlin
2025-09-18 13:53:05 +02:00
parent 4f994199a4
commit 08f62de2c9
2 changed files with 5 additions and 38 deletions
+5 -5
View File
@@ -47,11 +47,11 @@ public:
@note While wxClientDC may also be used for drawing on the client area of a
window from outside an EVT_PAINT() handler in some ports, this does @em not
work on most of the platforms: neither wxOSX nor wxGTK with GTK 3 Wayland
backend support this at all, so drawing using wxClientDC simply doesn't
have any effect there. CanBeUsedForDrawing() can be used to determine
whether wxClientDC can be used for drawing in the current environment, but
it is recommended to only draw on the window using wxPaintDC, as this is
work on all platforms: neither wxOSX nor wxGTK with GTK 3 Wayland backend
support this at all, so drawing using wxClientDC simply doesn't have any
effect there. CanBeUsedForDrawing() can be used to determine whether
wxClientDC can be used for drawing in the current environment, but it is
recommended to only draw on the window using wxPaintDC, as this is
guaranteed to work everywhere. To redraw a small part of the window, use
wxWindow::RefreshRect() to invalidate just this part and check
wxWindow::GetUpdateRegion() in the paint event handler to redraw this part
-33
View File
@@ -4315,39 +4315,6 @@ public:
///@}
/**
Disable the use native double buffering in wxMSW.
This MSW-specific function can be used to disable the use of
`WS_EX_COMPOSITED` for this window and all of its parents and so allow
using wxClientDC with it.
`WS_EX_COMPOSITED` style is turned on by default when creating the
windows and it is strongly recommended @e not to use this functions to
remove it, but to instead change the drawing code to avoid using
wxClientDC.
If you do need to use it, please note that this function doesn't exist
in the other ports and has to be explicitly bracketed by the checks for
wxMSW, e.g.
@code
MyFrame::MyFrame(...)
{
auto p = new wxPanel(this);
#ifdef __WXMSW__
p->MSWDisableComposited();
#endif
// Using wxClientDC will work now with this panel in wxMSW --
// although it still won't with wxOSX nor wxGTK under Wayland.
}
@endcode
@see wxClientDC
@since 3.3.0
*/
void MSWDisableComposited();
protected: