home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 October
/
VPR9710A.ISO
/
Ffilly
/
TFYW111
/
RTW_WIN.MAC
< prev
next >
Wrap
Text File
|
1997-07-14
|
6KB
|
250 lines
// ウィンドウ関連関数
main:
menu
"&OpenWin\tウィンドウを開く",
"O&penWin...\tウィンドウを開く(詳細設定)",
"&MoveWin...\tウィンドウの設定を変更",
"&CloseWin\tウィンドウを閉じる",
"CloseWin&All\tすべてのウィンドウを閉じる",
"Cap&Titlet\tウィンドウのキャプションの文字を指定",
"&GetPicNo\tウィンドウに関連付けされたピクチャー番号を得る";
if(result == 0) goto macro_cancel;
else if(result == 1) call InsFunc "OpenWin",1;
else if(result == 2) goto OpenWinF;
else if(result == 3) goto MoveWin;
else if(result == 4) call InsFunc "CloseWin",1;
else if(result == 5) call InsFunc "CloseWinAll",0;
else if(result == 6) call InsFunc "CapTitle",2;
else if(result == 7) call InsFunc "GetPicNo",1;
macro_end:
endmacro;
macro_cancel:
writeininum "tfywrite.ini", "Control", "MenuCancel", 1;
endmacro;
OpenWinF:
escape;
call MacSrvInit;
ddepoke "newdialog", "41,OpenWin";
ddepoke "newcontrol", "text,,ピクチャー番号(&P)";
ddepoke "part", "15";
ddepoke "newcontrol", "edit,Picture,";
ddepoke "newcontrol", "text,,ウィンドウの位置";
ddepoke "part", "13";
ddepoke "newcontrol", "text,,X座標(&X)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,X,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&Y)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,Y,";
ddepoke "newcontrol", "text,,サイズ";
ddepoke "part", "13";
ddepoke "newcontrol", "text,,幅(&W)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,W,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,高さ(&H)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,H,";
ddepoke "newcontrol", "text,,ピクチャーの左上";
ddepoke "newcontrol", "text,, ";
ddepoke "part", "13";
ddepoke "newcontrol", "text,,X座標(&R)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,PX,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&D)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,PY,";
ddepoke "newcontrol", "text,,ピクチャーが無い位置の色(16進)(&C)";
ddepoke "part", "29";
ddepoke "newcontrol", "edit,Col,";
ddepoke "newcontrol", "text,, ";
ddepoke "part", "21";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0") goto macro_end;
$Picture = dderequest("getstring Picture");
$X = dderequest("getstring X");
$Y = dderequest("getstring Y");
$W = dderequest("getstring W");
$H = dderequest("getstring H");
$PX = dderequest("getstring PX");
$PY = dderequest("getstring PY");
$Col = dderequest("getstring Col");
$Cmd = "OpenWin(" +$Picture+ "," +$X+ "," +$Y+ "," +$W+ "," +$H+ "," +$PX+ "," +$PY+ "," +$Col+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
MoveWin:
escape;
call MacSrvInit;
ddepoke "newdialog", "41,MoveWin";
ddepoke "newcontrol", "text,,ウィンドウ番号(&W)";
ddepoke "part", "13";
ddepoke "newcontrol", "edit,Win,";
ddepoke "newcontrol", "text,,ピクチャー番号(&P)";
ddepoke "part", "13";
ddepoke "newcontrol", "edit,Picture,";
ddepoke "newcontrol", "text,,ウィンドウの位置";
ddepoke "part", "13";
ddepoke "newcontrol", "text,,X座標(&X)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,X,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&Y)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,Y,";
ddepoke "newcontrol", "text,,サイズ";
ddepoke "part", "13";
ddepoke "newcontrol", "text,,幅(&W)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,W,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,高さ(&H)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,H,";
ddepoke "newcontrol", "text,,ピクチャーの左上";
ddepoke "part", "13";
ddepoke "newcontrol", "text,,X座標(&R)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,PX,";
ddepoke "part", "6";
ddepoke "newcontrol", "text,,Y座標(&D)";
ddepoke "part", "8";
ddepoke "newcontrol", "edit,PY,";
ddepoke "newcontrol", "text,, ";
ddepoke "part", "21";
ddepoke "newcontrol", "okcancel,Ok";
call MakeDialog;
$Ok = dderequest("getstring Ok");
if($Ok == "0") goto macro_end;
$Win = dderequest("getstring Win");
$Picture = dderequest("getstring Picture");
$X = dderequest("getstring X");
$Y = dderequest("getstring Y");
$W = dderequest("getstring W");
$H = dderequest("getstring H");
$PX = dderequest("getstring PX");
$PY = dderequest("getstring PY");
$Cmd = "MoveWin(" +$Win+ "," +$Picture+ "," +$X+ "," +$Y+ "," +$W+ "," +$H+ "," +$PX+ "," +$PY+ ");";
insert $Cmd;
goto macro_end;
ddeexecute "exit";
//関数の挿入
InsFunc:
//第1引数 str 関数名
//第2引数 str 関数の引数のタイプ
// (0=なし、1=数値型、2=文字列型、3=配列変数)
if(##2 == 0){
escape;
insert $$1 + "();";
return;
}
#Select = selecting;
$SText = "";
if(#Select == 1){
#STopX = seltopx;
#STopY = seltopy;
#SEndX = selendx;
#SEndY = selendy;
$SText = gettext(#STopX,#STopY,#SEndX,#SEndY);
#SLength = strlen($SText);
moveto #STopX,#STopY;
beginsel;
right #SLength;
delete;
}
if(##2 == 1){
insertfix $$1 + "(" + $SText + ");";
if($SText == ""){
gowordend;
right;
}
}
else if(##2 == 2){
insertfix $$1 + "(\"" + $SText + "\");";
if($SText == ""){
gowordend;
right 2;
}
}
else if(##2 == 3){
if(rightstr($SText,2) != "[]") $SText = $SText + "[]";
insertfix $$1 + "(\"" + $SText + "\");";
if($SText == ""){
gowordend;
right;
}
}
return;
//ダイアログボックス関連サブルーチン
MacSrvInit:
run "macserv.exe /h";
ddeinitiate "HideMacroServer", "DlgService";
if( !result ) {
message "ddeinitiate failed";
endmacro;
}
ddeexecute "setcurdir " + directory;
return;
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;