Improve documentation of the default wxEVT_DPI_CHANGED handler

Mention that the size may grow unexpectedly.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
This commit is contained in:
Vadim Zeitlin 2022-06-26 22:17:15 +02:00
parent f0ea00cd35
commit 2fa0bd5b1b

View File

@ -3432,11 +3432,12 @@ public:
their appearance when the DPI changes. However the default handler for the
top level window itself only sets the new window size, by scaling the
current size by the DPI ratio -- e.g. doubling it if the DPI has changed
from normal to "high", i.e. 200%, one. If your application prefers to use
some other logic than simply scaling the existing size, you should call
wxWindow::SetSize() in your handler of this event for the top level window
and @e not call @c event.Skip() to prevent the default handler from
resizing the window.
from normal to "high", i.e. 200%, one -- and also ensuring that the window
is still bigger than its best size, as returned by wxWindow::GetBestSize().
Note that in some cases this may cause the window size to grow unexpectedly
and you may prefer to call wxWindow::SetSize() in your handler of this
event for the top level window and @e not call @c event.Skip() to prevent
the default handler from resizing the window.
Currently this event is generated by wxMSW port if only and only if the
MSW application runs under Windows 10 Creators Update (v1703) or later and