Class: Wx::Display

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/display.rb

Overview

Note:

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

Instance Method Summary collapse

Constructor Details

#initializeWx::Display #initialize(index) ⇒ Wx::Display #initialize(window) ⇒ Wx::Display

Returns a new instance of Display.

Overloads:

  • #initializeWx::Display

    Default constructor creating Wx::Display object representing the primary display.

  • #initialize(index) ⇒ Wx::Display

    Constructor, setting up a Wx::Display instance with the specified display.

    Parameters:

    • index (Integer)

      The index of the display to use. This must be non-negative and lower than the value returned by get_count.

  • #initialize(window) ⇒ Wx::Display

    Constructor creating the display object associated with the given window.

    This is the most convenient way of finding the display on which the given window is shown while falling back to the default display if it is not shown at all or positioned outside of any display.

    Parameters:

    • window (Wx::Window)

      A valid, i.e. non-null, window.

    See Also:



35
# File 'lib/wx/doc/gen/display.rb', line 35

def initialize(*args) end

Class Method Details

.get_countInteger

Returns the number of connected displays.

Returns:

  • (Integer)


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.

Parameters:

  • pt (Array(Integer, Integer), Wx::Point)

    The point to locate.

Returns:

  • (Integer)


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.

Parameters:

  • rect (Wx::Rect)

    The rectangle to check.

Returns:

  • (Integer)


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.

Parameters:

Returns:

  • (Integer)


147
# File 'lib/wx/doc/gen/display.rb', line 147

def self.get_from_window(win) end

.get_std_ppiWx::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.

Returns:



161
# File 'lib/wx/doc/gen/display.rb', line 161

def self.get_std_ppi; end

.get_std_ppi_valueInteger

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.

Returns:

  • (Integer)

See Also:



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.

Parameters:

Returns:

  • (Boolean)


42
# File 'lib/wx/doc/gen/display.rb', line 42

def change_mode(mode=Wx::DEFAULT_VIDEO_MODE) end

#get_client_areaWx::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.

Returns:



48
# File 'lib/wx/doc/gen/display.rb', line 48

def get_client_area; end

#get_current_modeWx::VideoMode Also known as: current_mode

Returns the current video mode that this display is in.

Returns:



53
# File 'lib/wx/doc/gen/display.rb', line 53

def get_current_mode; end

#get_depthInteger Also known as: depth

Returns display depth, i.e.

number of bits per pixel (0 if unknown)

Returns:

  • (Integer)


82
# File 'lib/wx/doc/gen/display.rb', line 82

def get_depth; end

#get_geometryWx::Rect Also known as: geometry

Returns the bounding rectangle of the display whose index was passed to the constructor.

Returns:

See Also:



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).

Parameters:

Returns:



68
# File 'lib/wx/doc/gen/display.rb', line 68

def get_modes(mode=Wx::DEFAULT_VIDEO_MODE) end

#get_nameString Also known as: name

Returns the display’s name.

The returned value is currently an empty string under all platforms except MSW.

Returns:

  • (String)


75
# File 'lib/wx/doc/gen/display.rb', line 75

def get_name; end

#get_ppiWx::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).

Returns:



90
# File 'lib/wx/doc/gen/display.rb', line 90

def get_ppi; end

#get_raw_ppiWx::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).

Returns:



98
# File 'lib/wx/doc/gen/display.rb', line 98

def get_raw_ppi; end

#get_scale_factorFloat 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_connectedBoolean 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.

Returns:

  • (Boolean)


115
# File 'lib/wx/doc/gen/display.rb', line 115

def is_connected; end

#is_primaryBoolean Also known as: primary?

Returns true if the display is the primary display.

The primary display is the one whose index is 0.

Returns:

  • (Boolean)


122
# File 'lib/wx/doc/gen/display.rb', line 122

def is_primary; end