檢視原始碼 wxStaticBox (wx v2.4.3)
靜態框是用來將其他視窗包圍起來的矩形,以表示項目的邏輯分組。
請注意,雖然先前的版本要求出現在靜態框內的視窗必須建立為其兄弟(即使用與靜態框本身相同的父視窗),但自 wxWidgets 2.9.1 起,也可以將它們建立為 wxStaticBox
本身的子視窗,如果與先前版本的相容性不重要,實際上建議您這樣做。
因此,建立靜態框的新建議方法是:
而相容但現在已不建議使用的方法是:
另請注意,有一個特殊的 wxSizer
類別 (wxStaticBoxSizer
) 可以用來更輕鬆地將項目打包到靜態框中。
請參閱
此類別繼承自下列類別,並可使用其函式:
wxWidgets 文件:wxStaticBox
摘要
類型
-type wxStaticBox() :: wx:wx_object().
函式
-spec create(This, Parent, Id, Label) -> boolean() when This :: wxStaticBox(), Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata().
-spec create(This, Parent, Id, Label, [Option]) -> boolean() when This :: wxStaticBox(), Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata(), Option :: {pos, {X :: integer(), Y :: integer()}} | {size, {W :: integer(), H :: integer()}} | {style, integer()}.
建立用於兩步驟建構的靜態框。
請參閱 new/4
以取得更多詳細資訊。
-spec destroy(This :: wxStaticBox()) -> ok.
銷毀物件
-spec new() -> wxStaticBox().
預設建構子。
-spec new(Parent, Id, Label) -> wxStaticBox() when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata().
-spec new(Parent, Id, Label, [Option]) -> wxStaticBox() when Parent :: wxWindow:wxWindow(), Id :: integer(), Label :: unicode:chardata(), Option :: {pos, {X :: integer(), Y :: integer()}} | {size, {W :: integer(), H :: integer()}} | {style, integer()}.
建構子,建立並顯示靜態框。
請參閱:create/5