wxIconBundle — wx v2.4.2

Search documentation of wx

# View Source wxIconBundle (wx v2.4.2)

Functions for wxIconBundle class

This class contains multiple copies of an icon in different sizes. It is typically used in `wxDialog::SetIcons` (not implemented in wx) and `wxTopLevelWindow:setIcons/2`.

Predefined objects (include wx.hrl): ?wxNullIconBundle

wxWidgets docs: wxIconBundle

# Summary

## Types

wxIconBundle()

## Functions

addIcon/2

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.

addIcon(This, File, Type)
destroy(This)

Destructor.

getIcon(This)
getIcon/2

Same as.

getIcon/3

Returns the icon with the given size.

new()

Default ctor.

new/1

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

new(File, Type)

# Types

Link to this type

# wxIconBundle()

View Source

    -type wxIconBundle() :: wx:wx_object().

# Functions

Link to this function

# addIcon/2

View Source

    -spec addIcon(This, File) -> ok when This :: wxIconBundle(), File :: unicode:chardata();
                 (This, Icon) -> ok when This :: wxIconBundle(), Icon :: wxIcon:wxIcon().

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.

Link to this function

# addIcon(This, File, Type)

View Source

    -spec addIcon(This, File, Type) -> ok
                     when This :: wxIconBundle(), File :: unicode:chardata(), Type :: wx:wx_enum().

Link to this function

# destroy(This)

View Source

    -spec destroy(This :: wxIconBundle()) -> ok.

Destructor.

Link to this function

# getIcon(This)

View Source

    -spec getIcon(This) -> wxIcon:wxIcon() when This :: wxIconBundle().

Link to this function

# getIcon/2

View Source

    -spec getIcon(This, Size) -> wxIcon:wxIcon()
                     when This :: wxIconBundle(), Size :: {W :: integer(), H :: integer()};
                 (This, [Option]) -> wxIcon:wxIcon()
                     when This :: wxIconBundle(), Option :: {size, integer()} | {flags, integer()}.

Same as.

.

Link to this function

# getIcon/3

View Source

    -spec getIcon(This, Size, [Option]) -> wxIcon:wxIcon()
                     when
                         This :: wxIconBundle(),
                         Size :: {W :: integer(), H :: integer()},
                         Option :: {flags, integer()}.

Returns the icon with the given size.

If `size` is ?wxDefaultSize, it is interpreted as the standard system icon size, i.e. the size returned by `wxSystemSettings:getMetric/2` for `wxSYS_ICON_X` and `wxSYS_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 `wxIconBundle::FALLBACK_NONE` (not implemented in wx) is given, the function returns an invalid icon. If `wxIconBundle::FALLBACK_SYSTEM` (not implemented in wx) 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 neither, but `wxIconBundle::FALLBACK_NEAREST_LARGER` (not implemented in wx) 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.

Link to this function

# new()

View Source

    -spec new() -> wxIconBundle().

Default ctor.

Link to this function

# new/1

View Source

    -spec new(Ic) -> wxIconBundle() when Ic :: wxIconBundle:wxIconBundle() | wxIcon:wxIcon();
             (File) -> wxIconBundle() when File :: unicode:chardata().

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

Link to this function

# new(File, Type)

View Source

    -spec new(File, Type) -> wxIconBundle() when File :: unicode:chardata(), Type :: wx:wx_enum().