home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 October
/
VPR9710A.ISO
/
Ffilly
/
TFYW111
/
MACSRV13.LZH
/
DLGTEST.MAC
next >
Wrap
Text File
|
1995-09-05
|
7KB
|
239 lines
// 秀まるおのマクロサーバ ダイアログサービスのテスト用のマクロです
// (当然のことながら秀丸エディタ用です)
//
run "macserv.exe";
ddeinitiate "HideMacroServer", "DlgService";
if( !result ) {
message "ddeinitiate failed";
endmacro;
}
//***** チェックボックスのテスト *****
ddepoke "newdialog", "40,チェックボックスのテスト";
ddepoke "newcontrol", "check,MyCheck1,チェックボックス1";
ddepoke "newcontrol", "check,MyCheck2,チェックボックス2";
ddepoke "newcontrol", "check,MyCheck3,チェックボックス3";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
message "チェック1の状態 = " + dderequest("getstate MyCheck1") + "\n" +
"チェック2の状態 = " + dderequest("getstate MyCheck2") + "\n" +
"チェック3の状態 = " + dderequest("getstate MyCheck3");
//***** リストボックスのテスト *****
ddepoke "newdialog", "40,リストボックスのテスト";
ddepoke "newcontrol", "list,MyListbox,";
ddepoke "item", "リストの項目1";
ddepoke "item", "リストの項目2";
ddepoke "item", "リストの項目3";
ddepoke "item", "リストの項目4";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
message dderequest("getstate MyListbox") + " 番目が選ばれました\n" +
"選ばれた項目の内容 = 「" + dderequest("getstring MyListBox") + "」";
//***** ラジオボタンのテスト *****
ddepoke "newdialog", "40,ラジオボタンのテスト";
ddepoke "newcontrol", "radio,MyRadio,グループ";
ddepoke "item", "ラジオボタン1";
ddepoke "item", "ラジオボタン2";
ddepoke "item", "ラジオボタン3";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
message dderequest("getstate MyRadio") + " 番目のボタンが選ばれました";
//***** エディットのテスト *****
ddepoke "newdialog", "40,エディットのテスト";
ddepoke "newcontrol", "edit,MyEdit,";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
message "数値が入力された場合 = " + dderequest("getstate MyEdit") + "\n" +
"数値か文字が入力された場合 = " + dderequest("getstring MyEdit");
//***** プッシュボタンのテスト *****
ddepoke "newdialog", "40,プッシュボタンのテスト";
ddepoke "newcontrol", "button,,ボタン1";
ddepoke "notify", "123";
ddepoke "newcontrol", "button,,ボタン2";
ddepoke "notify", "456";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
if( $$return == "0" ) {
message "キャンセルが押されました";
} else if( $$return == "1" ) {
message "OKが押されました";
} else if( $$return == "123" ) {
message "ボタン1が押されました";
} else if( $$return == "456" ) {
message "ボタン2が押されました";
}
//***** デフォルト値の設定のテスト *****
ddepoke "newdialog", "40,デフォルト値の設定のテスト";
ddepoke "newcontrol", "check,MyCheck,チェックボックス";
ddepoke "default", "1";
ddepoke "newcontrol", "list,MyListbox,";
ddepoke "item", "リストの項目1";
ddepoke "item", "リストの項目2";
ddepoke "item", "リストの項目3";
ddepoke "default", "3";
ddepoke "newcontrol", "radio,MyRadio,グループ";
ddepoke "item", "ラジオボタン1";
ddepoke "item", "ラジオボタン2";
ddepoke "item", "ラジオボタン3";
ddepoke "default", "2";
ddepoke "newcontrol", "edit,MyEdit,初期化文字";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
//***** ニーモニックのテスト *****
ddepoke "newdialog", "40,ニーモニックのテスト";
ddepoke "newcontrol", "check,MyCheck,チェックボックス(&C)";
ddepoke "newcontrol", "text,,リストボックス(&L)";
ddepoke "newcontrol", "list,MyListbox,";
ddepoke "item", "リストの項目1";
ddepoke "item", "リストの項目2";
ddepoke "item", "リストの項目3";
ddepoke "newcontrol", "radio,MyRadio1,グループ1(&G)";
ddepoke "item", "ラジオボタン1";
ddepoke "item", "ラジオボタン2";
ddepoke "item", "ラジオボタン3";
ddepoke "newcontrol", "radio,MyRadio2,グループ2";
ddepoke "item", "ラジオボタン1(&1)";
ddepoke "item", "ラジオボタン2(&2)";
ddepoke "item", "ラジオボタン3(&3)";
ddepoke "newcontrol", "text,,エディット(&E)";
ddepoke "newcontrol", "edit,MyEdit,";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
//***** heightのテスト *****
ddepoke "newdialog", "40,heightのテスト";
ddepoke "newcontrol", "text,,低いリストボックス";
ddepoke "newcontrol", "list,MyListbox1,";
ddepoke "item", "リストの項目1";
ddepoke "item", "リストの項目2";
ddepoke "item", "リストの項目3";
ddepoke "height", "2";
ddepoke "newcontrol", "text,,高いリストボックス";
ddepoke "newcontrol", "list,MyListbox2,";
ddepoke "item", "リストの項目1";
ddepoke "item", "リストの項目2";
ddepoke "item", "リストの項目3";
ddepoke "height", "8";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
//***** partのテスト *****
ddepoke "newdialog", "40,partのテスト";
ddepoke "newcontrol", "text,,エディット(&E):";
ddepoke "part", "16";
ddepoke "newcontrol", "edit,MyEdit,";
ddepoke "part", "10";
ddepoke "newcontrol", "text,,"; //(ダミー)
ddepoke "newcontrol", "radio,MyRadio,グループ1(&G)";
ddepoke "item", "ラジオ1";
ddepoke "item", "ラジオ2";
ddepoke "item", "ラジオ3";
ddepoke "part", "30";
ddepoke "newcontrol", "text,,"; //(ダミー)
ddepoke "newcontrol", "button,,左";
ddepoke "part", "13";
ddepoke "newcontrol", "button,,中";
ddepoke "part", "13";
ddepoke "newcontrol", "button,,右";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
//***** newcolumnのテスト *****
ddepoke "newdialog", "20,newcolumnのテスト";
ddepoke "newcontrol", "check,,チェック1(1行目)";
ddepoke "newcontrol", "check,,チェック2(1行目)";
ddepoke "newcontrol", "check,,チェック3(1行目)";
ddepoke "newcolumn", "30";
ddepoke "newcontrol", "button,,ボタン1(2行目)";
ddepoke "newcontrol", "button,,ボタン2(2行目)";
ddepoke "newcolumn", "30";
ddepoke "newcontrol", "radio,,3行目";
ddepoke "item", "ラジオ1";
ddepoke "item", "ラジオ2";
ddepoke "item", "ラジオ3";
ddepoke "item", "ラジオ4";
ddepoke "item", "ラジオ5";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
//***** newpageのテスト *****
ddepoke "newdialog", "20,newpageのテスト";
ddepoke "newcontrol", "check,,チェック1(1行目)";
ddepoke "newcontrol", "check,,チェック2(1行目)";
ddepoke "newcontrol", "check,,チェック3(1行目)";
ddepoke "newcolumn", "30";
ddepoke "newcontrol", "button,,ボタン1(2行目)";
ddepoke "newcontrol", "button,,ボタン2(2行目)";
ddepoke "newcolumn", "30";
ddepoke "newcontrol", "radio,,3行目";
ddepoke "item", "ラジオ1";
ddepoke "item", "ラジオ2";
ddepoke "item", "ラジオ3";
ddepoke "item", "ラジオ4";
ddepoke "item", "ラジオ5";
ddepoke "newpage", "40";
ddepoke "newcontrol", "text,,↓ここからnewpage";
ddepoke "newcontrol", "list,,";
ddepoke "newcolumn", "30";
ddepoke "newcontrol", "text,,↓newpageのあとnewcolumn";
ddepoke "newcontrol", "check,,チェック3(2段目の2行目)";
ddepoke "newcontrol", "check,,チェック4(2段目の2行目)";
ddepoke "newcontrol", "okcancel";
call MakeDialog;
ddeexecute "exit";
endmacro;
MakeDialog:
#hwnd = hidemaruhandle(0);
ddeexecute "dialog " + str(#hwnd);
$$a = "";
ddestartadvice "dlgresult", $$a;
while( strlen($$a) == 0 ) {
ddewaitadvice $$a, 100;
}
ddestopadvice "dlgresult";
ddeexecute "enddialog";
return $$a;