Ember
Loading...
Searching...
No Matches
DPI.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <wx/display.h>
4
#include <wx/window.h>
5
6
namespace
EmberUI
{
8
namespace
DPI
{
9
11
inline
int
Scale
(wxWindow *win,
int
px) {
return
win->FromDIP(px); }
13
inline
wxSize
Scale
(wxWindow *win,
const
wxSize &size) {
return
win->FromDIP(size); }
14
16
inline
wxSize
GetScreenSize
() {
17
int
w, h;
18
wxDisplaySize(&w, &h);
19
return
wxSize(w, h);
20
}
21
23
inline
wxSize
GetScreenSize
(wxWindow *win) {
24
int
idx = wxDisplay::GetFromWindow(win);
25
if
(idx == wxNOT_FOUND)
26
idx = 0;
27
return
wxDisplay(idx).GetGeometry().GetSize();
28
}
29
30
}
// namespace DPI
31
}
// namespace EmberUI
EmberUI::DPI
DPI scaling and screen size utilities for wxWidgets windows.
Definition
DPI.h:8
EmberUI::DPI::GetScreenSize
wxSize GetScreenSize()
Returns the primary display size in pixels.
Definition
DPI.h:16
EmberUI::DPI::Scale
int Scale(wxWindow *win, int px)
Scales a pixel value from logical to physical units for the given window.
Definition
DPI.h:11
EmberUI
Definition
Panel.h:8
EmberUI
include
Utils
DPI.h
Generated by
Release_1_14_0