Add framework for Per-Monitor DPI Awareness on Windows

React to the WM_DPICHANGED event and update the size of the  child windows and
the top-level window. Scale the minimum and maximum window size to the new DPI.

Only react to WM_DPICHANGED when DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 is
used.
This commit is contained in:
Maarten Bent
2016-10-05 21:04:13 +02:00
parent 70f8bf4c86
commit 137713e0c8
6 changed files with 141 additions and 1 deletions

View File

@@ -586,6 +586,10 @@ public:
// Should be overridden by all classes storing the "last focused" window.
virtual void WXDoUpdatePendingFocus(wxWindow* WXUNUSED(win)) {}
// Called from WM_DPICHANGED handler for all windows to let them update
// any sizes and fonts used internally when the DPI changes.
void MSWUpdateOnDPIChange(const wxSize& oldDPI, const wxSize& newDPI);
protected:
// this allows you to implement standard control borders without
// repeating the code in different classes that are not derived from