Class: Wx::SystemSettings
- Inherits:
-
Object
- Object
- Wx::SystemSettings
- Defined in:
- lib/wx/doc/gen/system_settings.rb,
lib/wx/doc/system_settings.rb
Overview
SystemSettings allows the application to ask for details about the system.
This can include settings such as standard colours, fonts, and user interface element sizes.
Category: Application and System configuration
Class Method Summary collapse
-
.get_colour(index) ⇒ Wx::Colour
Returns a system colour.
-
.get_font(index) ⇒ Wx::Font
Returns a system font.
-
.get_metric(index, win = nil) ⇒ Integer
Returns the value of a system metric, or -1 if the metric is not supported on the current system.
-
.get_screen_type ⇒ Wx::SystemScreenType
Returns the screen type.
-
.has_feature(index) ⇒ Boolean
Returns true if the port has certain feature.
-
.select_light_dark(colForLight, colForDark) ⇒ Wx::Colour
Select one of the two colours depending on whether light or dark mode is used.
Instance Method Summary collapse
-
#get_appearance_name ⇒ String
(also: #appearance_name)
Return the name of the current system appearance if available or empty string otherwise.
-
#initialize ⇒ Wx::SystemSettings
constructor
Default constructor.
-
#is_appearance_dark ⇒ Object
(also: #appearance_dark?)
Return true if the current system there is explicitly recognized as being a dark theme or if the default window background is dark.
-
#is_appearance_using_dark_background ⇒ Object
(also: #appearance_using_dark_background?)
Return true if the default window background is significantly darker than foreground.
Constructor Details
#initialize ⇒ Wx::SystemSettings
Default constructor.
You don’t need to create an instance of Wx::SystemSettings since all of its functions are static.
445 |
# File 'lib/wx/doc/gen/system_settings.rb', line 445 def initialize; end |
Class Method Details
.get_colour(index) ⇒ Wx::Colour
Returns a system colour.
The returned colour is always valid.
452 |
# File 'lib/wx/doc/gen/system_settings.rb', line 452 def self.get_colour(index) end |
.get_font(index) ⇒ Wx::Font
Returns a system font.
The returned font is always valid.
459 |
# File 'lib/wx/doc/gen/system_settings.rb', line 459 def self.get_font(index) end |
.get_metric(index, win = nil) ⇒ Integer
Returns the value of a system metric, or -1 if the metric is not supported on the current system.
The value of win determines if the metric returned is a global value or a Window based value, in which case it might determine the widget, the display the window is on, or something similar. The window given should be as close to the metric as possible (e.g. a TopLevelWindow in case of the Wx::SystemMetric::SYS_CAPTION_Y metric). index can be one of the Wx::SystemMetric enum values. win is a pointer to the window for which the metric is requested. Specifying the win parameter is encouraged, because some metrics on some ports are not supported without one, or they might be capable of reporting better values if given one. If a window does not make sense for a metric, one should still be given, as for example it might determine which displays cursor width is requested with Wx::SystemMetric::SYS_CURSOR_X.
469 |
# File 'lib/wx/doc/gen/system_settings.rb', line 469 def self.get_metric(index, win=nil) end |
.get_screen_type ⇒ Wx::SystemScreenType
Returns the screen type.
The return value is one of the Wx::SystemScreenType enum values.
475 |
# File 'lib/wx/doc/gen/system_settings.rb', line 475 def self.get_screen_type; end |
.has_feature(index) ⇒ Boolean
Returns true if the port has certain feature.
See the Wx::SystemFeature enum values.
482 |
# File 'lib/wx/doc/gen/system_settings.rb', line 482 def self.has_feature(index) end |
.select_light_dark(colForLight, colForDark) ⇒ Wx::Colour
Select one of the two colours depending on whether light or dark mode is used.
This is just a convenient helper using Wx::SystemAppearance#is_dark to select between the two colours.
490 |
# File 'lib/wx/doc/gen/system_settings.rb', line 490 def self.select_light_dark(colForLight, colForDark) end |
Instance Method Details
#get_appearance_name ⇒ String Also known as: appearance_name
Return the name of the current system appearance if available or empty string otherwise.
This is currently only implemented for macOS and returns a not necessarily user-readable string such as “NSAppearanceNameAqua” there and an empty string under all the other platforms.
17 |
# File 'lib/wx/doc/system_settings.rb', line 17 def get_appearance_name; end |
#is_appearance_dark ⇒ Object Also known as: appearance_dark?
Return true if the current system there is explicitly recognized as being a dark theme or if the default window background is dark.
This method should be used to check whether custom colours more appropriate for the default (light) or dark appearance should be used. return [true,false]
26 |
# File 'lib/wx/doc/system_settings.rb', line 26 def is_appearance_dark; end |
#is_appearance_using_dark_background ⇒ Object Also known as: appearance_using_dark_background?
Return true if the default window background is significantly darker than foreground.
This is used by #is_appearance_dark if there is no platform-specific way to determine whether a dark mode is being used and is generally not very useful to call directly. return [true,false]
34 |
# File 'lib/wx/doc/system_settings.rb', line 34 def is_appearance_using_dark_background; end |