Class: Wx::Display
- Inherits:
-
Object
- Object
- Wx::Display
- Defined in:
- lib/wx/doc/gen/display.rb
Overview
This class is untracked and should not be derived from nor instances extended!
Determines the sizes and locations of displays connected to the system.
Category: Application and System configuration
Class Method Summary collapse
-
.get_count ⇒ Integer
Returns the number of connected displays.
-
.get_from_point(pt) ⇒ Integer
Returns the index of the display on which the given point lies, or NOT_FOUND if the point is not on any connected display.
-
.get_from_rect(rect) ⇒ Integer
Returns the index of the display with biggest intersection with the given rectangle or NOT_FOUND if the rectangle doesn’t intersect any display.
-
.get_from_window(win) ⇒ Integer
Returns the index of the display on which the given window lies.
-
.get_std_ppi ⇒ Wx::Size
Returns default display resolution for the current platform as Size.
-
.get_std_ppi_value ⇒ Integer
Returns default display resolution for the current platform in pixels per inch.
Instance Method Summary collapse
-
#change_mode(mode = Wx::DEFAULT_VIDEO_MODE) ⇒ Boolean
Changes the video mode of this display to the mode specified in the mode parameter.
-
#get_client_area ⇒ Wx::Rect
(also: #client_area)
Returns the client area of the display.
-
#get_current_mode ⇒ Wx::VideoMode
(also: #current_mode)
Returns the current video mode that this display is in.
-
#get_depth ⇒ Integer
(also: #depth)
Returns display depth, i.e.
-
#get_geometry ⇒ Wx::Rect
(also: #geometry)
Returns the bounding rectangle of the display whose index was passed to the constructor.
-
#get_modes(mode = Wx::DEFAULT_VIDEO_MODE) ⇒ Array<Wx::VideoMode>
(also: #modes)
Fills and returns an array with all the video modes that are supported by this display, or video modes that are supported by this display and match the mode parameter (if mode is not DEFAULT_VIDEO_MODE).
-
#get_name ⇒ String
(also: #name)
Returns the display’s name.
-
#get_ppi ⇒ Wx::Size
(also: #ppi)
Returns display resolution in pixels per inch.
-
#get_raw_ppi ⇒ Wx::Size
(also: #raw_ppi)
Returns raw display resolution in pixels per inch, i.e.
-
#get_scale_factor ⇒ Float
(also: #scale_factor)
Returns scaling factor used by this display.
-
#initialize(*args) ⇒ Display
constructor
A new instance of Display.
-
#is_connected ⇒ Boolean
(also: #connected?)
Returns true if the display has not been unplugged yet.
-
#is_primary ⇒ Boolean
(also: #primary?)
Returns true if the display is the primary display.
Constructor Details
#initialize ⇒ Wx::Display #initialize(index) ⇒ Wx::Display #initialize(window) ⇒ Wx::Display
Returns a new instance of Display.
35 |
# File 'lib/wx/doc/gen/display.rb', line 35 def initialize(*args) end |
Class Method Details
.get_count ⇒ Integer
Returns the number of connected displays.
127 |
# File 'lib/wx/doc/gen/display.rb', line 127 def self.get_count; end |
.get_from_point(pt) ⇒ Integer
Returns the index of the display on which the given point lies, or NOT_FOUND if the point is not on any connected display.
132 |
# File 'lib/wx/doc/gen/display.rb', line 132 def self.get_from_point(pt) end |
.get_from_rect(rect) ⇒ Integer
Returns the index of the display with biggest intersection with the given rectangle or NOT_FOUND if the rectangle doesn’t intersect any display.
Note that usually the returned display will be the same display which contains the center of the rectangle, but this is not always the case, as rectangle might be partly visible even if its center is off screen, and in this case get_from_point would returns NOT_FOUND, but this function would return a valid display.
139 |
# File 'lib/wx/doc/gen/display.rb', line 139 def self.get_from_rect(rect) end |
.get_from_window(win) ⇒ Integer
Returns the index of the display on which the given window lies.
If the window is on more than one display it gets the display that overlaps the window the most. Returns NOT_FOUND if the window is not on any connected display.
147 |
# File 'lib/wx/doc/gen/display.rb', line 147 def self.get_from_window(win) end |
.get_std_ppi ⇒ Wx::Size
Returns default display resolution for the current platform as Size.
This function is equivalent to constructing Size object with both components set to get_std_ppi_value.
161 |
# File 'lib/wx/doc/gen/display.rb', line 161 def self.get_std_ppi; end |
.get_std_ppi_value ⇒ Integer
Returns default display resolution for the current platform in pixels per inch.
This function mostly used internally, use #get_ppi to get the actual display resolution. Currently the standard PPI is the same in both horizontal and vertical directions on all platforms and its value is 96 everywhere except under Apple devices (those running macOS, iOS, watchOS etc), where it is 72.
155 |
# File 'lib/wx/doc/gen/display.rb', line 155 def self.get_std_ppi_value; end |
Instance Method Details
#change_mode(mode = Wx::DEFAULT_VIDEO_MODE) ⇒ Boolean
Changes the video mode of this display to the mode specified in the mode parameter.
If Wx::DEFAULT_VIDEO_MODE is passed in as the mode parameter, the defined behaviour is that Wx::Display will reset the video mode to the default mode used by the display. On Windows, the behaviour is normal. However, there are differences on other platforms. On Unix variations using X11 extensions it should behave as defined, but some irregularities may occur.
42 |
# File 'lib/wx/doc/gen/display.rb', line 42 def change_mode(mode=Wx::DEFAULT_VIDEO_MODE) end |
#get_client_area ⇒ Wx::Rect Also known as: client_area
Returns the client area of the display.
The client area is the part of the display available for the normal (non full screen) windows, usually it is the same as #get_geometry but it could be less if there is a taskbar (or equivalent) on this display.
48 |
# File 'lib/wx/doc/gen/display.rb', line 48 def get_client_area; end |
#get_current_mode ⇒ Wx::VideoMode Also known as: current_mode
Returns the current video mode that this display is in.
53 |
# File 'lib/wx/doc/gen/display.rb', line 53 def get_current_mode; end |
#get_depth ⇒ Integer Also known as: depth
Returns display depth, i.e.
number of bits per pixel (0 if unknown)
82 |
# File 'lib/wx/doc/gen/display.rb', line 82 def get_depth; end |
#get_geometry ⇒ Wx::Rect Also known as: geometry
Returns the bounding rectangle of the display whose index was passed to the constructor.
62 |
# File 'lib/wx/doc/gen/display.rb', line 62 def get_geometry; end |
#get_modes(mode = Wx::DEFAULT_VIDEO_MODE) ⇒ Array<Wx::VideoMode> Also known as: modes
Fills and returns an array with all the video modes that are supported by this display, or video modes that are supported by this display and match the mode parameter (if mode is not Wx::DEFAULT_VIDEO_MODE).
68 |
# File 'lib/wx/doc/gen/display.rb', line 68 def get_modes(mode=Wx::DEFAULT_VIDEO_MODE) end |
#get_name ⇒ String Also known as: name
Returns the display’s name.
The returned value is currently an empty string under all platforms except MSW.
75 |
# File 'lib/wx/doc/gen/display.rb', line 75 def get_name; end |
#get_ppi ⇒ Wx::Size Also known as: ppi
Returns display resolution in pixels per inch.
Horizontal and vertical resolution are returned in x and y components of the Size object respectively. If the resolution information is not available, returns wxSize(0, 0).
90 |
# File 'lib/wx/doc/gen/display.rb', line 90 def get_ppi; end |
#get_raw_ppi ⇒ Wx::Size Also known as: raw_ppi
Returns raw display resolution in pixels per inch, i.e. without applying any scaling.
Horizontal and vertical resolution are returned in x and y components of the Size object respectively. If the resolution information is not available, returns wxSize(0, 0).
98 |
# File 'lib/wx/doc/gen/display.rb', line 98 def get_raw_ppi; end |
#get_scale_factor ⇒ Float Also known as: scale_factor
Returns scaling factor used by this display.
The scaling factor is the ratio between #get_ppi and get_std_ppi (it is implicitly assumed that this ratio is the same for both horizontal and vertical components).
107 |
# File 'lib/wx/doc/gen/display.rb', line 107 def get_scale_factor; end |
#is_connected ⇒ Boolean Also known as: connected?
Returns true if the display has not been unplugged yet.
This function can return false if the display configuration has changed since this Wx::Display object has been created and either this display is known not to be connected to the system any more (support for detecting this is currently only implemented in WXMSW) or the display status is now unknown (which happens in all the other ports detecting the display configuration changes, e.g. WXOSX). A disconnected object is still usable, but all accessor functions return invalid fallback values (e.g. 0 for the width and height) and so such objects are not really useful any more. It is recommended to recreate them when the display configuration changes, which can be done in EVT_DISPLAY_CHANGED handler of any top-level window.
115 |
# File 'lib/wx/doc/gen/display.rb', line 115 def is_connected; end |
#is_primary ⇒ Boolean Also known as: primary?
Returns true if the display is the primary display.
The primary display is the one whose index is 0.
122 |
# File 'lib/wx/doc/gen/display.rb', line 122 def is_primary; end |