Move DPI handling from wxTopLevelWindow to wxNonOwnedWindow
This way, other windows (like wxPopupWindow) will also be able to handle DPI events. Override InheritAttributes() and use it to set the initial DPI values.
This commit is contained in:
@@ -27,11 +27,27 @@ protected:
|
||||
virtual bool DoSetRegionShape(const wxRegion& region) wxOVERRIDE;
|
||||
#if wxUSE_GRAPHICS_CONTEXT
|
||||
virtual bool DoSetPathShape(const wxGraphicsPath& path) wxOVERRIDE;
|
||||
#endif // wxUSE_GRAPHICS_CONTEXT
|
||||
|
||||
virtual WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE;
|
||||
virtual void InheritAttributes() wxOVERRIDE;
|
||||
|
||||
private:
|
||||
bool HandleDPIChange(const wxSize& newDPI, const wxRect& newRect);
|
||||
|
||||
#if wxUSE_GRAPHICS_CONTEXT
|
||||
wxNonOwnedWindowShapeImpl* m_shapeImpl;
|
||||
#endif // wxUSE_GRAPHICS_CONTEXT
|
||||
|
||||
// Keep track of the DPI used in this window. So when per-monitor dpi
|
||||
// awareness is enabled, both old and new DPI are known for
|
||||
// wxDPIChangedEvent and wxWindow::MSWUpdateOnDPIChange.
|
||||
wxSize m_activeDPI;
|
||||
|
||||
// This window supports handling per-monitor DPI awareness when the
|
||||
// application manifest contains <dpiAwareness>PerMonitorV2</dpiAwareness>.
|
||||
bool m_perMonitorDPIaware;
|
||||
|
||||
wxDECLARE_NO_COPY_CLASS(wxNonOwnedWindow);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user