Class: Wx::IconBundle

Inherits:
GDIObject show all
Defined in:
lib/wx/doc/gen/icon.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

This class contains multiple copies of an icon in different sizes.

It is typically used in Dialog#set_icons and TopLevelWindow#set_icons.

Category: Graphics Device Interface (GDI) Predefined objects/pointers: NULL_ICON_BUNDLE

Constant Summary collapse

FALLBACK_NONE =

Return invalid icon if exact size is not found.

0
FALLBACK_SYSTEM =

Return the icon of the system icon size if exact size is not found.

1
FALLBACK_NEAREST_LARGER =

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.

2

Instance Method Summary collapse

Methods inherited from GDIObject

#clone, #dup

Methods inherited from Object

#clone, #dup, #is_same_as, #un_share

Constructor Details

#initializeWx::IconBundle #initialize(file, type = Wx::BitmapType::BITMAP_TYPE_ANY) ⇒ Wx::IconBundle #initialize(stream, type = Wx::BitmapType::BITMAP_TYPE_ANY) ⇒ Wx::IconBundle #initialize(icon) ⇒ Wx::IconBundle #initialize(resourceName, module_) ⇒ Wx::IconBundle #initialize(ic) ⇒ Wx::IconBundle

Returns a new instance of IconBundle.

Overloads:

  • #initializeWx::IconBundle

    Default ctor.

  • #initialize(file, type = Wx::BitmapType::BITMAP_TYPE_ANY) ⇒ Wx::IconBundle

    Initializes the bundle with the icon(s) found in the file.

    Parameters:

    • file (String)
    • type (Wx::BitmapType) (defaults to: Wx::BitmapType::BITMAP_TYPE_ANY)
  • #initialize(stream, type = Wx::BitmapType::BITMAP_TYPE_ANY) ⇒ Wx::IconBundle

    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.

    Parameters:

  • #initialize(icon) ⇒ Wx::IconBundle

    Initializes the bundle with a single icon.

    Parameters:

  • #initialize(resourceName, module_) ⇒ Wx::IconBundle

    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 WXMSW port.

    Parameters:

    • resourceName (String)
    • module_ (WXHINSTANCE)

    See Also:

    • wxString&
    • WXHINSTANCE)

    Requires:

    • WXMSW
  • #initialize(ic) ⇒ Wx::IconBundle

    Copy constructor.

    Parameters:



223
# File 'lib/wx/doc/gen/icon.rb', line 223

def initialize(*args) end

Instance Method Details

#add_icon(file, type = Wx::BitmapType::BITMAP_TYPE_ANY) ⇒ void #add_icon(stream, type = Wx::BitmapType::BITMAP_TYPE_ANY) ⇒ void #add_icon(resourceName, module_) ⇒ void #add_icon(icon) ⇒ void

Overloads:

  • #add_icon(file, type = Wx::BitmapType::BITMAP_TYPE_ANY) ⇒ void

    This method returns an undefined value.

    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.

    Parameters:

    • file (String)
    • type (Wx::BitmapType) (defaults to: Wx::BitmapType::BITMAP_TYPE_ANY)
  • #add_icon(stream, type = Wx::BitmapType::BITMAP_TYPE_ANY) ⇒ void

    This method returns an undefined value.

    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.

    Parameters:

  • #add_icon(resourceName, module_) ⇒ void

    This method returns an undefined value.

    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 WXMSW port.

    Parameters:

    • resourceName (String)
    • module_ (WXHINSTANCE)

    Requires:

    • WXMSW
  • #add_icon(icon) ⇒ void

    This method returns an undefined value.

    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.

    Parameters:



250
# File 'lib/wx/doc/gen/icon.rb', line 250

def add_icon(*args) end

#get_icon(size, flags = Wx::IconBundle::FALLBACK_SYSTEM) ⇒ Wx::Icon #get_icon(size = Wx::DEFAULT_COORD, flags = Wx::IconBundle::FALLBACK_SYSTEM) ⇒ Wx::Icon Also known as: icon

Overloads:

  • #get_icon(size, flags = Wx::IconBundle::FALLBACK_SYSTEM) ⇒ Wx::Icon

    Returns the icon with the given size.

    If size is DEFAULT_SIZE, it is interpreted as the standard system icon size, i.e. the size returned by SystemSettings.get_metric for SystemMetric::SYS_ICON_X and 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 FALLBACK_NONE is given, the function returns an invalid icon. If 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 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.

    Parameters:

    • size (Array(Integer, Integer), Wx::Size)
    • flags (Integer) (defaults to: Wx::IconBundle::FALLBACK_SYSTEM)

    Returns:

  • #get_icon(size = Wx::DEFAULT_COORD, flags = Wx::IconBundle::FALLBACK_SYSTEM) ⇒ Wx::Icon

    Same as.

    get_icon(Wx::Size.new(size,size))
    

    .

    Parameters:

    • size (Integer) (defaults to: Wx::DEFAULT_COORD)
    • flags (Integer) (defaults to: Wx::IconBundle::FALLBACK_SYSTEM)

    Returns:



271
# File 'lib/wx/doc/gen/icon.rb', line 271

def get_icon(*args) end

#get_icon_by_index(n) ⇒ Wx::Icon Also known as: icon_by_index

return the icon at index (must be < #get_icon_count)

Parameters:

  • n (Integer)

Returns:



288
# File 'lib/wx/doc/gen/icon.rb', line 288

def get_icon_by_index(n) end

#get_icon_countInteger Also known as: icon_count

return the number of available icons

Returns:

  • (Integer)


282
# File 'lib/wx/doc/gen/icon.rb', line 282

def get_icon_count; end

#get_icon_of_exact_size(size) ⇒ Wx::Icon Also known as: icon_of_exact_size

Returns the icon with exactly the given size or NULL_ICON if this size is not available.

Parameters:

  • size (Array(Integer, Integer), Wx::Size)

Returns:



277
# File 'lib/wx/doc/gen/icon.rb', line 277

def get_icon_of_exact_size(size) end

#is_emptyBoolean Also known as: empty?

Returns true if the bundle doesn’t contain any icons, false otherwise (in which case a call to #get_icon with default parameter should return a valid icon).

Returns:

  • (Boolean)


293
# File 'lib/wx/doc/gen/icon.rb', line 293

def is_empty; end