檢視原始碼 wxBitmapButton (wx v2.4.3)
點陣圖按鈕是一個包含點陣圖的控制項。
請注意,自 wxWidgets 2.9.1 起,基本 wxButton
類別本身已支援點陣圖顯示,使用此類別的唯一微小優勢是它允許在其建構函式中指定點陣圖,這與 wxButton
不同。有關 wxButton
中圖像支援的更多資訊,請參閱基本類別文件。
樣式
此類別支援以下樣式
wxBU_LEFT:將點陣圖標籤靠左對齊。
wxBU_TOP:將點陣圖標籤對齊到按鈕的頂部。
wxBU_RIGHT:將點陣圖標籤靠右對齊。
wxBU_BOTTOM:將點陣圖標籤對齊到按鈕的底部。請注意,
wxButton
支援的 wxBU_EXACTFIT 樣式不被此類別使用,因為點陣圖按鈕預設沒有任何最小標準尺寸。
請參閱: wxButton
此類別繼承自,並且可以使用下列類別的函式:
wxWidgets 文件: wxBitmapButton
事件
此類別發出的事件類型
摘要
類型
-type wxBitmapButton() :: wx:wx_object().
函式
-spec create(This, Parent, Id, Bitmap) -> boolean() when This :: wxBitmapButton(), Parent :: wxWindow:wxWindow(), Id :: integer(), Bitmap :: wxBitmap:wxBitmap().
-spec create(This, Parent, Id, Bitmap, [Option]) -> boolean() when This :: wxBitmapButton(), Parent :: wxWindow:wxWindow(), Id :: integer(), Bitmap :: wxBitmap:wxBitmap(), Option :: {pos, {X :: integer(), Y :: integer()}} | {size, {W :: integer(), H :: integer()}} | {style, integer()} | {validator, wx:wx_object()}.
用於兩步驟建立的按鈕建立函式。
更多詳細資訊,請參閱 new/4
。
-spec destroy(This :: wxBitmapButton()) -> ok.
銷毀物件
-spec new() -> wxBitmapButton().
預設建構子。
-spec new(Parent, Id, Bitmap) -> wxBitmapButton() when Parent :: wxWindow:wxWindow(), Id :: integer(), Bitmap :: wxBitmap:wxBitmap().
-spec new(Parent, Id, Bitmap, [Option]) -> wxBitmapButton() when Parent :: wxWindow:wxWindow(), Id :: integer(), Bitmap :: wxBitmap:wxBitmap(), Option :: {pos, {X :: integer(), Y :: integer()}} | {size, {W :: integer(), H :: integer()}} | {style, integer()} | {validator, wx:wx_object()}.
建構函式,建立並顯示按鈕。
備註:點陣圖參數通常是您唯一需要提供的點陣圖,並且 wxWidgets 會在不同的狀態下正確繪製按鈕。如果您想要更多控制權,請呼叫任何函式 SetBitmapPressed()
(在 wx 中未實作)、wxButton:setBitmapFocus/2
、wxButton:setBitmapDisabled/2
。
請參閱: create/5
-spec newCloseButton(Parent, Winid) -> wxBitmapButton() when Parent :: wxWindow:wxWindow(), Winid :: integer().
輔助函式,建立標準外觀的「關閉」按鈕。
為了獲得最佳結果,可能需要使用平台特定的程式碼來建立一個小型、類似標題列的「關閉」按鈕。提供此函式是為了避免需要測試目前的平台,並盡可能以原生外觀建立按鈕。
傳回:新的按鈕。
自:2.9.5