Generate wxDPIChangedEvent when DPI changes
This commit is contained in:
@@ -3318,6 +3318,62 @@ public:
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@class wxDPIChangedEvent
|
||||
|
||||
Event sent when the resolution (measured in dots-per-inch, or DPI) of the
|
||||
monitor a window is on changes.
|
||||
|
||||
The event is sent to each wxTopLevelWindow affected by the change, and all
|
||||
its children recursively. For example, this event is sent to the window
|
||||
when it is moved, by the user, from a display using some DPI value to
|
||||
another display using a different DPI value. It also sent to all program
|
||||
windows on the given display if its DPI changes due to a change in the
|
||||
system settings.
|
||||
|
||||
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
|
||||
is marked as being "per-monitor DPI aware", i.e. contains a @c dpiAwareness
|
||||
tag with the value "PerMonitorV2" in its manifest (see Microsoft
|
||||
<a href="https://docs.microsoft.com/en-us/windows/desktop/sbscs/application-manifests">"Application Manifests" documentation</a>
|
||||
for more details).
|
||||
|
||||
@note Per-monitor DPI support is an experimental feature that is still in
|
||||
development. It might not work correctly for some controls.
|
||||
|
||||
@beginEventTable{wxDPIChangedEvent}
|
||||
@event{EVT_DPI_CHANGED(func)}
|
||||
Process a @c wxEVT_DPI_CHANGED event.
|
||||
@endEventTable
|
||||
|
||||
@since 3.1.3
|
||||
|
||||
@library{wxcore}
|
||||
@category{events}
|
||||
|
||||
@see @ref overview_events
|
||||
*/
|
||||
class wxDPIChangedEvent : public wxEvent
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Returns the old DPI.
|
||||
|
||||
@since 3.1.3
|
||||
*/
|
||||
wxSize GetOldDPI() const;
|
||||
|
||||
/**
|
||||
Returns the new DPI.
|
||||
|
||||
@since 3.1.3
|
||||
*/
|
||||
wxSize GetNewDPI() const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class wxPaletteChangedEvent : public wxEvent
|
||||
{
|
||||
public:
|
||||
|
Reference in New Issue
Block a user