檢視原始碼 wxIconBundle (wx v2.4.3)

這個類別包含多個不同尺寸的圖示副本。

它通常用於 wxDialog::SetIcons (wx 中未實作) 和 wxTopLevelWindow:setIcons/2

預定義物件 (包含 wx.hrl):?wxNullIconBundle

wxWidgets 文件:wxIconBundle

摘要

函式

將圖示新增至集合;如果集合中已包含具有相同寬度和高度的圖示,則會將其替換為新的圖示。

銷毀物件

與...相同。

傳回具有指定尺寸的圖示。

預設建構子。

使用在檔案中找到的圖示初始化捆綁包。

類型

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

函式

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

將圖示新增至集合;如果集合中已包含具有相同寬度和高度的圖示,則會將其替換為新的圖示。

連結至此函式

addIcon(This, File, Type)

檢視原始碼
-spec addIcon(This, File, Type) -> ok
                 when This :: wxIconBundle(), File :: unicode:chardata(), Type :: wx:wx_enum().
-spec destroy(This :: wxIconBundle()) -> ok.

銷毀物件

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

等同於 getIcon(This, [])

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

與...相同。

.

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

傳回具有指定尺寸的圖示。

如果 size 是 ?wxDefaultSize,則會將其解讀為標準系統圖示尺寸,即由 wxSystemSettings:getMetric/2 針對 wxSYS_ICON_XwxSYS_ICON_Y 傳回的尺寸。

如果捆綁包包含具有完全要求尺寸的圖示,則始終會傳回該圖示。否則,行為取決於旗標。如果僅給定 wxIconBundle::FALLBACK_NONE (wx 中未實作),則函式會傳回無效的圖示。如果給定 wxIconBundle::FALLBACK_SYSTEM (wx 中未實作),則它會嘗試找到標準系統尺寸的圖示,而不管作為參數傳遞的尺寸如何。否則,如果也找不到系統尺寸的圖示,但指定了 wxIconBundle::FALLBACK_NEAREST_LARGER (wx 中未實作) 旗標,則函式會傳回大於要求尺寸的最小圖示,或者,如果這也失敗,則僅返回最接近指定尺寸的圖示。

flags 參數僅自 wxWidgets 2.9.4 起可用。

-spec new() -> wxIconBundle().

預設建構子。

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

使用在檔案中找到的圖示初始化捆綁包。

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