ButtonPanel


概要 - Abstract

このライブラリ gui.ButtonPanel は、GUI部品として、ボタンが並ぶパネル ―― ボタンパネル ―― を提供します。

VCSSLの標準ライブラリ「 GUI 」では、GUI部品をint型のIDで扱いますが、このモジュールで提供されるGUI部品は、ButtonPanel 構造体として扱います。

ButtonPanel 構造体は、内部にリソースのID等を保持していますが、
生成・破棄のための関数が提供されるため、その中身を特に意識する必要はありません( むしろメンバへの直接的なアクセスは推奨されません )。
具体的には、 newButtonPanel 関数で生成し、 deleteComponent 関数で破棄します。

またこのモジュールでは、ButtonPanel 構造体を標準ライブラリ「 GUI 」とほぼ同様の感覚でそのまま扱えるように、標準GUIライブラリ関数のオーバーロードも提供されます。
例えば、 mountComponent 関数や、setComponentSize 関数、 setComponentLocation 関数などが提供されます。


目次 - Index

struct ButtonPanel
ボタンパネルの構造体です。
ButtonPanel newButtonPanel(int x, int y, int width, int height, string labelText[ ])
ボタンパネルを生成します。
void deleteComponent(ButtonPanel &panelInstance)
ボタンパネルを破棄します。
void paintComponent(ButtonPanel &panelInstance)
ボタンパネルを再描画します。
void mountComponent(ButtonPanel &panelInstance, int componentID)
ボタンパネルを、別のGUIコンポーネント上に配置します。
void demountComponent(ButtonPanel &panelInstance, int componentID)
ボタンパネルを、別のGUIコンポーネントから配置解除します。
int getPanel(ButtonPanel &panelInstance)
パネルのコンポーネントIDを返します。
int getButton(ButtonPanel &panelInstance, string labelText)
指定されたラベルに対応するボタンを取得します。
int getButton(ButtonPanel &panelInstance, int index)
指定されたインデックスのボタンを取得します。
int[ ] getComponentSize(ButtonPanel &panelInstance)
パネルのサイズを返します。
void setComponentSize(ButtonPanel &panelInstance, int width, int height)
パネルのサイズを設定します。
void setComponentSize(ButtonPanel &panelInstance)
パネルの現在のサイズに合わせて、内部コンポーネントのサイズを自動設定します。パネルのサイズを外部から変更した際に使用します。
int[ ] getComponentLocation(ButtonPanel &panelInstance)
パネルの位置を返します。
void setComponentLocation(ButtonPanel &panelInstance, int x, int y)
パネルの位置を設定します。

構造体 - Structs

定義
- Signature
struct ButtonPanel
詳細
- Details
ボタンパネルの構造体です。

変数 - Variables

- なし - None -


関数 - Functions

定義
- Signature
ButtonPanel newButtonPanel(int x, int y, int width, int height, string labelText[ ])
詳細
- Details
ボタンパネルを生成します。
引数
- Arguments
x : パネルのX座標
y : パネルのY座標
width : パネルの幅
height : パネルの高さ
labelText : ラベル文字列を格納する配列
buttonWidth : ボタンの幅
buttonText : ボタンの文字列を格納する配列
戻り値
- Return
生成したボタンパネル構造体
定義
- Signature
void deleteComponent(ButtonPanel &panelInstance)
詳細
- Details
ボタンパネルを破棄します。
引数
- Arguments
panelInstance : 破棄するボタンパネル
定義
- Signature
void paintComponent(ButtonPanel &panelInstance)
詳細
- Details
ボタンパネルを再描画します。
引数
- Arguments
panelInstance : 再描画するボタンパネル
定義
- Signature
void mountComponent(ButtonPanel &panelInstance, int componentID)
詳細
- Details
ボタンパネルを、別のGUIコンポーネント上に配置します。
引数
- Arguments
panelInstance : 配置するボタンパネル
componentID : 配置先GUIコンポーネントID
定義
- Signature
void demountComponent(ButtonPanel &panelInstance, int componentID)
詳細
- Details
ボタンパネルを、別のGUIコンポーネントから配置解除します。
引数
- Arguments
panelInstance : 配置解除するボタンパネル
componentID : 配置先GUIコンポーネントID
定義
- Signature
int getPanel(ButtonPanel &panelInstance)
詳細
- Details
パネルのコンポーネントIDを返します。
引数
- Arguments
panelInstance : 取得対象のボタンパネル
戻り値
- Return
パネルのGUIコンポーネントID
定義
- Signature
int getButton(ButtonPanel &panelInstance, string labelText)
詳細
- Details
指定されたラベルに対応するボタンを取得します。
引数
- Arguments
panelInstance : 対象のボタンパネル
labelText : 取得対象のボタンに対応するラベル文字列
戻り値
- Return
ボタンのGUIコンポーネントID
定義
- Signature
int getButton(ButtonPanel &panelInstance, int index)
詳細
- Details
指定されたインデックスのボタンを取得します。
引数
- Arguments
panelInstance : 対象のボタンパネル
index : ボタンのインデックス
戻り値
- Return
ボタンのGUIコンポーネントID
定義
- Signature
int[ ] getComponentSize(ButtonPanel &panelInstance)
詳細
- Details
パネルのサイズを返します。
引数
- Arguments
panelInstance : 対象のボタンパネル
戻り値
- Return
パネルのサイズを格納する配列
定義
- Signature
void setComponentSize(ButtonPanel &panelInstance, int width, int height)
詳細
- Details
パネルのサイズを設定します。
引数
- Arguments
panelInstance : 対象のボタンパネル
width : パネルの幅
height : パネルの高さ
定義
- Signature
void setComponentSize(ButtonPanel &panelInstance)
詳細
- Details
パネルの現在のサイズに合わせて、内部コンポーネントのサイズを自動設定します。パネルのサイズを外部から変更した際に使用します。
引数
- Arguments
panelInstance : 対象のボタンパネル
定義
- Signature
int[ ] getComponentLocation(ButtonPanel &panelInstance)
詳細
- Details
パネルの位置を返します。
引数
- Arguments
panelInstance : 対象のボタンパネル
戻り値
- Return
パネルの位置を格納する配列
定義
- Signature
void setComponentLocation(ButtonPanel &panelInstance, int x, int y)
詳細
- Details
パネルの位置を設定します。
引数
- Arguments
panelInstance : 対象のボタンパネル
x : ウィンドウのX座標
y : ウィンドウのY座標