このライブラリ gui.TextFieldPanel は、GUI部品として、テキストフィールドが並ぶパネル ―― テキストフィールドパネル ―― を提供します。
VCSSLの標準ライブラリ「 GUI 」では、GUI部品をint型のIDで扱いますが、このモジュールで提供されるGUI部品は、TextFieldPanel 構造体として扱います。
TextFieldPanel 構造体は、内部にリソースのID等を保持していますが、
生成・破棄のための関数が提供されるため、その中身を特に意識する必要はありません( むしろメンバへの直接的なアクセスは推奨されません )。
具体的には、 newTextFieldPanel 関数で生成し、 deleteComponent 関数で破棄します。
またこのモジュールでは、TextFieldPanel 構造体を標準ライブラリ「 GUI 」とほぼ同様の感覚でそのまま扱えるように、標準GUIライブラリ関数のオーバーロードも提供されます。
例えば、 mountComponent 関数や、setComponentSize 関数、 setComponentLocation 関数などが提供されます。
文法的定義 - Signature |
struct TextFieldPanel |
構造体名 - Name |
TextFieldPanel |
役割 - Role |
テキストフィールドパネルの構造体です。 |
- なし - None -
文法的定義 - Signature |
TextFieldPanel newTextFieldPanel(int x, int y, int width, int height, string labelText[ ], string defaultText[ ]) |
関数名 - Name |
newTextFieldPanel |
役割 - Role |
テキストフィールドパネルを生成します。 |
引数 - Arguments |
(int型) x : パネルのX座標 (int型) y : パネルのY座標 (int型) width : パネルの幅 (int型) height : パネルの高さ (string[]型) labelText : ラベル文字列を格納する配列 labelWidth : ラベル部分の幅 (string[]型) defaultText : テキストフィールドの初期値文字列を格納する配列 |
戻り値 - Return |
(TextFieldPanel型) 生成したテキストフィールドパネル構造体 |
文法的定義 - Signature |
void deleteComponent(TextFieldPanel &panelInstance) |
関数名 - Name |
deleteComponent |
役割 - Role |
テキストフィールドパネルを破棄します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 破棄するテキストフィールドパネル |
戻り値 - Return |
(void型) |
文法的定義 - Signature |
void paintComponent(TextFieldPanel &panelInstance) |
関数名 - Name |
paintComponent |
役割 - Role |
テキストフィールドパネルを再描画します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 再描画するテキストフィールドパネル |
戻り値 - Return |
(void型) |
文法的定義 - Signature |
void mountComponent(TextFieldPanel &panelInstance, int componentID) |
関数名 - Name |
mountComponent |
役割 - Role |
テキストフィールドパネルを、別のGUIコンポーネント上に配置します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 配置するテキストフィールドパネル (int型) componentID : 配置先GUIコンポーネントID |
戻り値 - Return |
(void型) |
文法的定義 - Signature |
void demountComponent(TextFieldPanel &panelInstance, int componentID) |
関数名 - Name |
demountComponent |
役割 - Role |
テキストパネルを、別のGUIコンポーネントから配置解除します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 配置解除するテキストフィールドパネル (int型) componentID : 配置先GUIコンポーネントID |
戻り値 - Return |
(void型) |
文法的定義 - Signature |
void setLabelWidth(TextFieldPanel &panelInstance, int labelWidth) |
関数名 - Name |
setLabelWidth |
役割 - Role |
(この関数は互換目的でサポートされています。getTextLabelWidth を使用して下さい。)ラベル部分の幅を設定します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 取得対象のテキストフィールドパネル (int型) labelWidth : ラベル部分の幅 |
戻り値 - Return |
(void型) |
文法的定義 - Signature |
void setTextLabelWidth(TextFieldPanel &panelInstance, int labelWidth) |
関数名 - Name |
setTextLabelWidth |
役割 - Role |
ラベル部分の幅を設定します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 取得対象のテキストフィールドパネル (int型) labelWidth : ラベル部分の幅 |
戻り値 - Return |
(void型) |
文法的定義 - Signature |
int getPanel(TextFieldPanel &panelInstance) |
関数名 - Name |
getPanel |
役割 - Role |
パネルのコンポーネントIDを返します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 取得対象のテキストフィールドパネル |
戻り値 - Return |
(int型) パネルのGUIコンポーネントID |
文法的定義 - Signature |
int getTextField(TextFieldPanel &panelInstance, string labelText) |
関数名 - Name |
getTextField |
役割 - Role |
指定されたラベルに対応するテキストフィールドを取得します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 対象のテキストフィールドパネル (string型) labelText : 取得対象のテキストフィールドに対応するラベル文字列 |
戻り値 - Return |
(int型) テキストフィールドのGUIコンポーネントID |
文法的定義 - Signature |
int getTextField(TextFieldPanel &panelInstance, int index) |
関数名 - Name |
getTextField |
役割 - Role |
指定されたインデックスのテキストフィールドを取得します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 対象のテキストフィールドパネル (int型) index : テキストフィールドのインデックス |
戻り値 - Return |
(int型) テキストフィールドのGUIコンポーネントID |
文法的定義 - Signature |
int[ ] getComponentSize(TextFieldPanel &panelInstance) |
関数名 - Name |
getComponentSize |
役割 - Role |
パネルのサイズを返します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 対象のテキストフィールドパネル |
戻り値 - Return |
(int[]型) パネルのサイズを格納する配列 |
文法的定義 - Signature |
void setComponentSize(TextFieldPanel &panelInstance, int width, int height) |
関数名 - Name |
setComponentSize |
役割 - Role |
パネルのサイズを設定します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 対象のテキストフィールドパネル (int型) width : パネルの幅 (int型) height : パネルの高さ |
戻り値 - Return |
(void型) |
文法的定義 - Signature |
void setComponentSize(TextFieldPanel &panelInstance) |
関数名 - Name |
setComponentSize |
役割 - Role |
パネルの現在のサイズに合わせて、内部コンポーネントのサイズを自動設定します。パネルのサイズを外部から変更した際に使用します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 対象のテキストフィールドパネル |
戻り値 - Return |
(void型) |
文法的定義 - Signature |
int[ ] getComponentLocation(TextFieldPanel &panelInstance) |
関数名 - Name |
getComponentLocation |
役割 - Role |
パネルの位置を返します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 対象のテキストフィールドパネル |
戻り値 - Return |
(int[]型) パネルの位置を格納する配列 |
文法的定義 - Signature |
void setComponentLocation(TextFieldPanel &panelInstance, int x, int y) |
関数名 - Name |
setComponentLocation |
役割 - Role |
パネルの位置を設定します。 |
引数 - Arguments |
(TextFieldPanel型) panelInstance : 対象のスライダーパネル (int型) x : ウィンドウのX座標 (int型) y : ウィンドウのY座標 |
戻り値 - Return |
(void型) |