Add wxDisplay::GetPPI() to use instead of wxGetDisplayPPI()

While this is not done for all the ports yet, the new API allows
returning different PPI values for different monitors, unlike the old
(and still existing, but implemented in terms of the new one) global
function.
This commit is contained in:
Vadim Zeitlin
2018-10-06 23:21:45 +02:00
parent e3e883bbd2
commit ded2894b78
24 changed files with 290 additions and 107 deletions

View File

@@ -12,8 +12,6 @@
@library{wxcore}
@category{cfg}
@see wxClientDisplayRect(), wxDisplaySize(), wxDisplaySizeMM()
*/
class wxDisplay
{
@@ -109,6 +107,19 @@ public:
*/
wxString GetName() const;
/**
Returns display resolution in pixels per inch.
Horizontal and vertical resolution are returned in @c x and @c y
components of the wxSize object respectively.
If the resolution information is not available, returns @code wxSize(0,
0) @endcode.
@since 3.1.2
*/
wxSize GetPPI() const;
/**
Returns @true if the display is the primary display. The primary
display is the one whose index is 0.

View File

@@ -1256,6 +1256,10 @@ wxRect wxGetClientDisplayRect();
The @c x component of the returned wxSize object contains the horizontal
resolution and the @c y one -- the vertical resolution.
@note Use of this function is not recommended in the new code as it only
works for the primary display. Use wxDisplay::GetPPI() to retrieve
the resolution of the appropriate display instead.
@header{wx/gdicmn.h}
@see wxDisplay

View File

@@ -15,8 +15,6 @@
@stdobjects
::wxDefaultVideoMode
@see wxClientDisplayRect(), wxDisplaySize(), wxDisplaySizeMM()
*/
struct wxVideoMode
{