#DLGで始まるセクションです。
サブルーチンや関数、キーアサインで使用する、ユーザー定義ダイアログを記述します。
ダイアログは16384個まで定義可能です。それ以上定義した場合、コンパイルエラーになります。
定義の仕方は以下の通りです。
#DLG ダイアログ名([[VAR] 引数,[...]]) {
ダイアログパーツ記述文;
....
}
ダイアログ名はA-Z,0-9,_で構成される、60文字までの文字列です。ただし、先頭に数字は使用できません。また、以後に述べる判定式やシステム手続きと同じ名前は使用できません。
例)
#DLG TestDlg()
{
Dialog {
size : 100,100,200,150;
font : 'Terminal',10;
caption : 'Button Test';
};
Button {
size : 3,3,20,10;
caption : '&Yes';
value : 1;
};
}
#DLG WorkDlg(var $data)
{
Dialog {
size : 50,50,150,80;
font : 'Terminal',10;
caption : 'Edit Test';
};
Edit {
result: $data;
size : 10,10,130,15;
limit : 255;
mask : '';
Default : 'default string';
};
Button {
size : 65,50,20,10;
caption : '&Done';
value : 1;
};
};
ver 3.06以降、サブルーチンやユーザー定義関数と同様にFORWARDキーワードを使用することができます。
例)
#DLG TestDlg(); FORWARD;
#KEY A
{
...
TestDlg();
...
}
#DLG TestDlg()
{
...
}
ここで定義したダイアログはサブルーチンやキーアサイン定義内で使用できます。
例)
#DLG SelectCD(var #no)
{
Dialog {
};
RadioButton {
};
Button {
};
Button {
};
};
#SUB RadioTest()
{
var #no,$work;
SelectCD(#no);
IF (#_RESULT==-1) { ExitProc(); }; // Dialogがキャンセルされた
IntToStr($work,#no);
ShowMessage('You Choice No.'+$work,'test',0);
};
#DLGセクションでは、以下の「ダイアログパーツ記述文」のみ使用できます。
注意
「ダイアログパーツ記述文」で使用する数字は32bitで表せる範囲内の数字である必要が有ります。
Dialog {
size : 数字1,数字2,数字3,数字4;
clientsize : 数字1,数字2,数字3,数字4;
font : 文字列1,数字1;
caption : 文字列;
}
ダイアログ本体の設定をします。
Edit {
result : 文字列変数;
size : 数字1,数字2,数字3,数字4;
limit : 数字;
mask : 文字列;
default : 文字列;
ret : 数字;
filenamecomp : 数字;
curpos : 数字;
sellength : 数字;
autosel : 数字;
focus;
}
(1行)エディタの設定です。result 以外の項目は省略可能です。
| bit 0 | ファイル |
| bit 1 | フォルダ |
| bit 2 | 共有名 |
| bit 3 | サーバー名 |
ComboBox {
result : 文字列変数;
size : 数字1,数字2,数字3,数字4;
limit : 数字;
type : 数字;
default : 文字列;
history : 文字列;
ret : 数字;
autocomp : 数字;
filenamecomp : 数字;
focus;
}
コンボボックスの設定です。result 以外の項目は省略可能です。
| bit 0 | ファイル |
| bit 1 | フォルダ |
| bit 2 | 共有名 |
| bit 3 | サーバー名 |
Button {
size : 数字1,数字2,数字3,数字4;
caption : 文字列;
value : 数字;
focus;
elevation;
}
ボタンの設定です。result 以外の項目は省略可能です。
!!!注意!!!
ボタンは押されると必ずダイアログが閉じます。
RadioButton {
result : 変数;
size : 数字1,数字2,数字3,数字4;
caption : 文字列;
column : 数字;
items : 文字列;
default : 数字;
focus;
}
ラジオボタンの設定です。result 以外の項目は省略可能です。
CheckBox {
result : 変数;
size : 数字1,数字2,数字3,数字4;
caption : 文字列;
default : 数字;
focus;
}
チェックボックスを設定します。result 以外の項目は省略可能です。
Memo {
result : 文字列変数;
size : 数字1,数字2,数字3,数字4;
default : 文字列;
readonly : 数字;
focus;
}
メモを設定します。result 以外の項目は省略可能です。
Label {
size : 数字1,数字2,数字3,数字4;
caption : 文字列;
color : 数字;
align : 数字;
}
ラベルを設定します。全て省略可能です。
| 1 | 中央 |
| 2 | 右寄せ |
| その他 | 左寄せ(default) |
Bevel {
size : 数字1,数字2,数字3,数字4;
type : 数字;
}
枠を設定します。全て省略可能です。
| 1 | 箱型・盛り上がっている |
| 2 | 枠線・引っ込んでいる |
| 3 | 枠線・盛り上がっている |
| その他 | 箱型・引っ込んでいる(default) |
ListBox {
result : 文字列変数;
size : 数字1,数字2,数字3,数字4;
column : 数字;
items : 文字列;
multi : 数字;
ret : 数字;
focus;
onekey : 数字
}
リストボックスを設定します。result以外は省略可能です。
GroupBox {
size : 数字1,数字2,数字3,数字4;
caption : 文字列;
Dialog以外のダイアログパーツ;
}
グループボックスを設定します。全て省略可能です。