home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1997 November
/
VPR9711A.ISO
/
VPR_DATA
/
Special
/
Koda202
/
koda202.lzh
/
kodama
/
htmtable.mac
< prev
next >
Wrap
Text File
|
1997-08-05
|
7KB
|
223 lines
//こだマクロ(HTML作成)
//htmtable.mac
//このマクロは「秀丸エディタ」用のマクロです。
//97080611
//
main:
title "表に関するタグの指定 - こだマクロ";
#menu = getininum ( hidemarudir + "\\htmini.txt" , "Table" , "defnum" );
#i = 0;
while ( #menu + 1 > #i ) {
$top[#i] = getinistr ( hidemarudir + "\\htmini.txt" , "Table" , "def" + str ( #i ) );
$menu[#i] = leftstr ( $top[#i] , strstr ( $top[#i] , ":" ) );
$command[#i] = rightstr ( $top[#i] , strlen ( $top[#i] ) - strstr ( $top[#i] , ":" ) - 1 );
#i = #i + 1;
}
menuarray $menu, #menu + 1;
if ( result == 0 ) endmacro;
else if ( $command[result-1] == "td" ) call td "TD";
else if ( $command[result-1] == "tr" ) call tr;
else if ( $command[result-1] == "th" ) call td "TH";
else if ( $command[result-1] == "table" ) call table;
else if ( $command[result-1] == "cap" ) call caption;
writeinistr hidemarudir + "\\htmini.txt" , "Color" , "message" ,"0";
endmacro;
td:
$slwidth = "";
$slheight = "";
$slcolor = "";
$dh = $$1;
call line;
$getline = $$return;
title "マス目に関する定義";
$sely31 = "マス内の文字の表示位置はどうしますか?";
$sely311[0] = "(&Center)中央";
$sely311[1] = "(&Left)左寄せ";
$sely311[2] = "(&Right)右寄せ";
$sely312[0] = "CENTER";
$sely312[1] = "LEFT";
$sely312[2] = "RIGHT";
$sely321[0] = "(&Middle)中央";
$sely321[1] = "(&Top)上";
$sely321[2] = "(&Bottom)下";
$sely322[0] = "MIDDLE";
$sely322[1] = "TOP";
$sely322[2] = "BOTTOM";
$sely33 = "マスの幅を指定してください(ピクセル値もしくは%値)";
$sely34 = "マスの高さを指定してください(ピクセル値もしくは%値)";
$sely36 = "幅を何倍にするかを指定してください。(整数倍のみ)";
$sely375 = "最小マスを基準にしてこのマスの";
$sely37 = "高さを何倍にするかを指定してください。(整数倍のみ)";
$sely38 = "このマスの背景に埋め込む画像を指定してください。";
$sl[0] = input ( $sely375 + $sely36 , "1" );
$sl[1] = input ( $sely375 + $sely37 , "1" );
message $sely31;
menuarray $sely311,3;
#re = result - 1;
if ( #re < 1 ) $sl[5] = "";
else $sl[5] = $sely312[#re];
menuarray $sely321,3;
#re = result - 1;
if ( #re < 1 ) $sl[6] = "";
else $sl[6] = $sely322[#re];
$sl[2] = input ( $sely33 );
$sl[3] = input ( $sely34 );
writeinistr hidemarudir + "\\htmini.txt" , "Color" , "message" ,"9";
call color;
$sl[4] = $$return;
$sl[7] = input ( $sely38 );
#k = 0;
while ( #k < 5 ){
call zenkaku $sl[#k];
$sl[#k] = $$return;
#k = #k + 1;
}
insert "<" + $dh;
if ( $sl[0] == "1" ) insert "";
else insert " COLSPAN=\"" + $sl[0] + "\"";
if ( $sl[1] == "1" ) insert "";
else insert " ROWSPAN=\"" + $sl[1] + "\"";
if ( $sl[5] == "" ) insert "";
else insert " ALIGN=\"" + $sl[5] + "\"";
if ( $sl[6] == "" ) insert "";
else insert " VALIGN=\"" + $sl[6] + "\"";
if ( $sl[2] == "" ) insert "";
else insert " WIDTH=\"" + $sl[2] + "\"";
if ( $sl[3] == "" ) insert "";
else insert " HEIGHT=\"" + $sl[3] + "\"";
if ( $sl[7] == "" ) insert "";
else insert " BACKGROUND=\"" + $sl[7] + "\"";
if ( $sl[4] == "" ) insert "";
else insert " BGCOLOR=\"" + $sl[4] + "\"";
insert ">";
insert $getline + "</" + $dh + ">";
return;
tr:
call line,"\n";
title "横1列に関する定義 - こだマクロ";
$sely31 = "横1列のマス内の文字の左右の表示位置を指定してください。";
$sely311[0] = "(&Center)中央";
$sely311[1] = "(&Left)左寄せ";
$sely311[2] = "(&Right)右寄せ";
$sely312[0] = "CENTER";
$sely312[1] = "LEFT";
$sely312[2] = "RIGHT";
$sely32 = "横1列のマス内の文字の上下の表示位置を指定してください。";
$sely321[0] = "(&Middle)中央";
$sely321[1] = "(&Top)上";
$sely321[2] = "(&Bottom)下";
$sely322[0] = "MIDDLE";
$sely322[1] = "TOP";
$sely322[2] = "BOTTOM";
message $sely31;
menuarray $sely311,3;
#re = result - 1;
if ( #re <= 0 ) $seltate1 = "";
else $seltate1 = " ALIGN=\"" + $sely312[#re] + "\"";
message $sely32;
menuarray $sely321,3;
#re = result - 1;
if ( #re <= 0 ) $seltate2= "";
else $seltate2 = " VALIGN=\"" + $sely322[#re] + "\"";
insert "<TR" + $seltate1 + $seltate2 + ">";
insert $$return + "</TR>";
return;
caption:
title "表の名前について - こだマクロ";
$captname = input ( "表の名前は何ですか?" );
if ( $captname != "" ) {
menu "(&Up)表の上に付ける","(&Bottom)表の下に付ける";
if ( result == 2 ) $captalig = "BOTTOM\">";
else $captalig = "UP\">";
insert "<CAPTION ALIGN=\"" + $captalig + $captname + "</CAPTION>";
}
endmacro;
table:
title "表の定義について - こだマクロ";
$msg132 = "外枠の太さはどのくらいですか?\nピクセル値でお答えください。";
$msg133 = "表全体の横幅はどのくらいですか?\n画面に対する%値、もしくはピクセル値でピクセル値でお答えください。";
$msg134 = "表全体の高さはどのくらいですか?\n画面に対する%値、もしくはピクセル値でお答えください。";
$msg135 = "外枠以外の罫線の太さはどのくらいですか?\nピクセル値でお答えください。";
$msg136 = "マス内のデータと罫線との間隔はどのくらいですか?\nピクセル値でお答えください。";
$tbbor = input ( $msg132 );
$tbwid = input ( $msg133 );
$tbhei = input ( $msg134 );
$tbspa = input ( $msg135 );
$tbpad = input ( $msg136 );
writeinistr hidemarudir + "\\htmini.txt" , "Color" , "message" ,"10";
call color;
$tbbdc = $$return;
call line "\n";
$lines = $$return;
if ( $tbbor != "" ) $tb[0] = " BORDER=\"" + $tbbor + "\"";
else $tb[0] = $tbbor;
if ( $tbwid != "" ) $tb[1] = " WIDTH=\"" + $tbwid + "\" ";
else $tb[1] = $tbwid;
if ( $tbhei != "" ) $tb[2] = " HEIGHT=\"" + $tbhei + "\" ";
else $tb[2] = $tbhei;
if ( $tbspa != "" ) $tb[3] = " CELLSPACING=\"" + $tbspa + "\" ";
else $tb[3] = $tbspa;
if ( $tbpad != "" ) $tb[4] = " CELLPADDING=\"" + $tbpad + "\" ";
else $tb[4] = $tbpad;
if ( $tbbdc != "" ) $tb[5] = " BORDERCOLOR=\"" + $tbbdc + "\" ";
else $tb[5] = $tbbdc;
#k = 0;
while ( #k < 6 ){
call zenkaku $tb[#k];
$tb[#k] = $$return + " ";
#k = #k + 1;
}
#k = 0;
insert "<TABLE " + $tb[0] + $tb[1] + $tb[2];
insert $tb[3] + $tb[4] + $tb[5] + ">";
insert $lines + "</TABLE>";
endmacro;
line:
$line = "";
execmacro getinistr ( hidemarudir + "\\htmini.txt" , "Topmenu" , "macropath" ) + "kodaline.mac";
#line = getininum ( hidemarudir + "\\htmini.txt" , "Line" , "line" );
#i = 0;
while ( #line > #i ){
$line = $line + getinistr ( hidemarudir + "\\htmini.txt" , "Line" , str ( #i ) ) + $$1;
writeinistr hidemarudir + "\\htmini.txt" , "Line" , str ( #i ) , 0;
#i = #i + 1;
}
return $line;
zenkaku:
writeinistr hidemarudir + "\\htmini.txt" , "Zenkaku" , "line" , $$1;
execmacro getinistr ( hidemarudir + "\\htmini.txt" , "Topmenu" , "macropath" ) + "htmzen.mac";
$out = getinistr ( hidemarudir + "\\htmini.txt" , "Zenkaku" , "line" );
writeinistr hidemarudir + "\\htmini.txt" , "Zenkaku" , "line" ,0;
return $out;
color:
execmacro getinistr ( hidemarudir + "\\htmini.txt" , "Topmenu" , "macropath" ) + "htmcol.mac";
$out = getinistr ( hidemarudir + "\\htmini.txt" , "Color" , "get" );
writeinistr hidemarudir + "\\htmini.txt" , "Color" , "get" ,0;
return $out;