# :stopdoc: # This file is automatically generated by the WXRuby3 documentation # generator. Do not alter this file. # :startdoc: module Wx # ICON_SCREEN_DEPTH = -1 # An empty {Wx::Icon}. # NULL_ICON = nil # An empty {Wx::IconBundle}. # NULL_ICON_BUNDLE = nil # An icon is a small rectangular bitmap usually used for denoting a minimized application. # It differs from a {Wx::Bitmap} in always having a mask associated with it for transparent drawing. On some platforms, icons and bitmaps are implemented identically, since there is no real distinction between a {Wx::Bitmap} with a mask and an icon; and there is no specific icon format on some platforms (X-based applications usually standardize on XPMs for small bitmaps and icons). However, some platforms (such as Windows) make the distinction, so a separate class is provided. # It is usually desirable to associate a pertinent icon with a frame. Icons can also be used for other purposes, for example with {Wx::TreeCtrl} and {Wx::ListCtrl}. Icons have different formats on different platforms therefore separate icons will usually be created for the different environments. Platform-specific methods for creating a {Wx::Icon} structure are catered for, and this is an occasion where conditional compilation will probably be required. Note that a new icon must be created for every time the icon is to be used for a new window. In Windows, the icon will not be reloaded if it has already been used. An icon allocated to a frame will be deleted when the frame is deleted. For more information please see Bitmaps and Icons. # # === # # Category: Graphics Device Interface (GDI) # Predefined objects/pointers: {Wx::NULL_ICON} # @see Bitmaps and Icons # @see Supported Bitmap File Formats # @see Wx::IconBundle # @see Wx::DC#draw_icon # @see Wx::Cursor # # class Icon < GDIObject # @overload initialize() # Default ctor. # Constructs an icon object with no data; an assignment or another member function such as {Wx::Icon#load_file} must be called subsequently. # @return [Icon] # @overload initialize(icon) # Copy ctor. # @param icon [Wx::Icon] # @return [Icon] # @overload initialize(name, type=Wx::ICON_DEFAULT_TYPE, desiredWidth=-1, desiredHeight=-1) # Loads an icon from a file or resource. # # @see Wx::Icon#load_file # @param name [String] This can refer to a resource name or a filename under MS Windows and X. Its meaning is determined by the type parameter. # @param type [BitmapType] May be one of the {Wx::BitmapType} values and indicates which type of bitmap should be loaded. See the note in the class detailed description. Note that the {Wx::ICON_DEFAULT_TYPE} constant has different value under different wxWidgets ports. See the {Wx::icon.h} header for the value it takes for a specific port. # @param desiredWidth [Integer] Specifies the desired width of the icon. This parameter only has an effect in Windows where icon resources can contain several icons of different sizes. # @param desiredHeight [Integer] Specifies the desired height of the icon. This parameter only has an effect in Windows where icon resources can contain several icons of different sizes. # @return [Icon] # @overload initialize(loc) # Loads an icon from the specified location. # @param loc [Wx::IconLocation] # @return [Icon] def initialize(*args) end # Attach a Windows icon handle. # This {Wx::MSW}-specific method allows assigning a native Windows HICON (which must be cast to WXHICON opaque handle type) to {Wx::Icon}. Notice that this means that the HICON will be destroyed by {Wx::Icon} when it is destroyed. # true if successful. # # Availability: only available for the {Wx::MSW} port. {Wx::msw} # @param icon [WXHICON] # @return [true,false] def create_from_hicon(icon) end # Copies bmp bitmap to this icon. # Under MS Windows the bitmap must have mask colour set. # @see Wx::Icon#load_file # @param bmp [Wx::Bitmap] # @return [void] def copy_from_bitmap(bmp) end # Gets the colour depth of the icon. # A value of 1 indicates a monochrome icon. # @return [Integer] def get_depth; end alias_method :depth, :get_depth # Gets the height of the icon in physical pixels. # # @see Wx::Icon#get_width # @see Wx::Icon#get_logical_height # @return [Integer] def get_height; end alias_method :height, :get_height # Gets the height of the icon in logical pixels. # See {Wx::Bitmap#get_logical_height}. # @return [Float] def get_logical_height; end alias_method :logical_height, :get_logical_height # Gets the size of the icon in logical pixels. # See {Wx::Bitmap#get_logical_size}. # @return [Wx::Size] def get_logical_size; end alias_method :logical_size, :get_logical_size # Gets the width of the icon in logical pixels. # See {Wx::Bitmap#get_logical_width}. # @return [Float] def get_logical_width; end alias_method :logical_width, :get_logical_width # Gets the scale factor of this icon. # See {Wx::Bitmap#get_scale_factor}. # @return [Float] def get_scale_factor; end alias_method :scale_factor, :get_scale_factor # Gets the size of the icon in physical pixels. # # @see Wx::Icon#get_logical_size # @return [Wx::Size] def get_size; end alias_method :size, :get_size # Gets the width of the icon in physical pixels. # # @see Wx::Icon#get_height # @see Wx::Icon#get_logical_width # @return [Integer] def get_width; end alias_method :width, :get_width # Returns true if icon data is present. # @return [true,false] def is_ok; end alias_method :ok?, :is_ok # Loads an icon from a file or resource. # true if the operation succeeded, false otherwise. # @param name [String] Either a filename or a Windows resource name. The meaning of name is determined by the type parameter. # @param type [BitmapType] One of the {Wx::BitmapType} values; see the note in the class detailed description. Note that the {Wx::ICON_DEFAULT_TYPE} constant has different value under different wxWidgets ports. See the {Wx::icon.h} header for the value it takes for a specific port. # @param desiredWidth [Integer] Specifies the desired width of the icon. This parameter only has an effect in Windows where icon resources can contain several icons of different sizes. # @param desiredHeight [Integer] Specifies the desired height of the icon. This parameter only has an effect in Windows where icon resources can contain several icons of different sizes. # @return [true,false] def load_file(name, type=Wx::ICON_DEFAULT_TYPE, desiredWidth=-1, desiredHeight=-1) end end # Icon # This class contains multiple copies of an icon in different sizes. # It is typically used in {Wx::Dialog#set_icons} and {Wx::TopLevelWindow#set_icons}. # === # # Category: Graphics Device Interface (GDI) # Predefined objects/pointers: {Wx::NULL_ICON_BUNDLE} # class IconBundle < GDIObject # Return invalid icon if exact size is not found. # FALLBACK_NONE = 0 # Return the icon of the system icon size if exact size is not found. # FALLBACK_SYSTEM = 1 # Return the icon of closest larger size or, if there is no icon of larger size in the bundle, the closest icon of smaller size. # FALLBACK_NEAREST_LARGER = 2 # @overload initialize() # Default ctor. # @return [IconBundle] # @overload initialize(file, type=Wx::BitmapType::BITMAP_TYPE_ANY) # Initializes the bundle with the icon(s) found in the file. # @param file [String] # @param type [BitmapType] # @return [IconBundle] # @overload initialize(stream, type=Wx::BitmapType::BITMAP_TYPE_ANY) # Initializes the bundle with the icon(s) found in the stream. # Notice that the stream must be seekable, at least if it contains more than one icon. The stream pointer is positioned after the last icon read from the stream when this function returns. # @param stream [IO,Wx::InputStream] # @param type [BitmapType] # @return [IconBundle] # @overload initialize(icon) # Initializes the bundle with a single icon. # @param icon [Wx::Icon] # @return [IconBundle] # @overload initialize(resourceName, module_) # Initializes the bundle with all sizes of a group icon with resourceName stored as an MS Windows resource in module. # When module is 0, the current instance is used. # # Availability: only available for the {Wx::MSW} port. {Wx::msw} # @see AddIcon(const wxString& # @see WXHINSTANCE) # @param resourceName [String] # @param module_ [WXHINSTANCE] # @return [IconBundle] # @overload initialize(ic) # Copy constructor. # @param ic [Wx::IconBundle] # @return [IconBundle] def initialize(*args) end # @overload add_icon(file, type=Wx::BitmapType::BITMAP_TYPE_ANY) # Adds all the icons contained in the file to the bundle; if the collection already contains icons with the same width and height, they are replaced by the new ones. # @param file [String] # @param type [BitmapType] # @return [void] # @overload add_icon(stream, type=Wx::BitmapType::BITMAP_TYPE_ANY) # Adds all the icons contained in the stream to the bundle; if the collection already contains icons with the same width and height, they are replaced by the new ones. # Notice that, as well as in the constructor loading the icon bundle from stream, the stream must be seekable, at least if more than one icon is to be loaded from it. # @param stream [IO,Wx::InputStream] # @param type [BitmapType] # @return [void] # @overload add_icon(resourceName, module_) # Loads all sizes of a group icon with resourceName stored as an MS Windows resource in module. # When module is 0, the current instance is used. # Availability: only available for the {Wx::MSW} port. {Wx::msw} # @param resourceName [String] # @param module_ [WXHINSTANCE] # @return [void] # @overload add_icon(icon) # Adds the icon to the collection; if the collection already contains an icon with the same width and height, it is replaced by the new one. # @param icon [Wx::Icon] # @return [void] def add_icon(*args) end # @overload get_icon(size, flags=Wx::IconBundle::FALLBACK_SYSTEM) # Returns the icon with the given size. # If size is {Wx::DEFAULT_SIZE}, it is interpreted as the standard system icon size, i.e. the size returned by {Wx::SystemSettings.get_metric} for {Wx::SystemMetric::SYS_ICON_X} and {Wx::SystemMetric::SYS_ICON_Y}. # If the bundle contains an icon with exactly the requested size, it's always returned. Otherwise, the behaviour depends on the flags. If only {Wx::IconBundle::FALLBACK_NONE} is given, the function returns an invalid icon. If {Wx::IconBundle::FALLBACK_SYSTEM} is given, it tries to find the icon of standard system size, regardless of the size passed as parameter. Otherwise, or if the icon system size is not found either, but {Wx::IconBundle::FALLBACK_NEAREST_LARGER} flag is specified, the function returns the smallest icon of the size larger than the requested one or, if this fails too, just the icon closest to the specified size. # The flags parameter is available only since wxWidgets 2.9.4. # @param size [Array(Integer, Integer), Wx::Size] # @param flags [Integer] # @return [Wx::Icon] # @overload get_icon(size=Wx::DEFAULT_COORD, flags=Wx::IconBundle::FALLBACK_SYSTEM) # Same as. # GetIcon( wxSize( size, size ) ) # . # @param size [Integer] # @param flags [Integer] # @return [Wx::Icon] def get_icon(*args) end alias_method :icon, :get_icon # Returns the icon with exactly the given size or {Wx::NULL_ICON} if this size is not available. # @param size [Array(Integer, Integer), Wx::Size] # @return [Wx::Icon] def get_icon_of_exact_size(size) end alias_method :icon_of_exact_size, :get_icon_of_exact_size # return the number of available icons # @return [Integer] def get_icon_count; end alias_method :icon_count, :get_icon_count # return the icon at index (must be < {Wx::IconBundle#get_icon_count}) # @param n [Integer] # @return [Wx::Icon] def get_icon_by_index(n) end alias_method :icon_by_index, :get_icon_by_index # Returns true if the bundle doesn't contain any icons, false otherwise (in which case a call to {Wx::IconBundle#get_icon} with default parameter should return a valid icon). # @return [true,false] def is_empty; end alias_method :empty?, :is_empty end # IconBundle end