version 1.4, 2013/11/14 17:28:29 |
version 1.8, 2013/12/19 04:24:39 |
|
|
// $OpenXM: OpenXM_contrib2/windows/post-msg-asirgui/asirgui.mac,v 1.3 2013/11/14 17:21:51 ohara Exp $ |
// $OpenXM: OpenXM_contrib2/windows/post-msg-asirgui/asirgui.mac,v 1.7 2013/11/28 03:02:19 takayama Exp $
|
// Keep shift-jis code! |
// Keep shift-jis code!
|
call Main; |
// run "cmd /c "+$asirpath+"cmdasir %f" + " >con"; output debugmsg
|
endmacro; |
call Main;
|
Main: |
endmacro;
|
$asirpath=getenv("HOMEPATH")+"\\Desktop\\asir\\bin\\"; |
Main:
|
$asir_rootdir=getenv("ASIR_ROOTDIR"); |
$asirpath=getenv("HOMEPATH")+"\\Desktop\\asir\\bin\\";
|
if($asir_rootdir!="" && existfile($asir_rootdir+"\\bin\\asirgui.exe")) { |
$asir_rootdir=getenv("ASIR_ROOTDIR");
|
$asirpath=$asir_rootdir+"\\bin\\"; |
if($asir_rootdir!="" && existfile($asir_rootdir+"\\bin\\asirgui.exe")) {
|
} |
$asirpath=$asir_rootdir+"\\bin\\";
|
menu "asirgui起動","編集中のファイルの実行","選択範囲の実行","行の実行","選択範囲の実行(paste)","行の実行(paste)"; |
}
|
if (result==0) endmacro; |
menu "asirgui起動","編集中のファイルの実行","選択範囲の実行","行の実行","選択範囲の実行(paste)","行の実行(paste)","計算中断";
|
else if (result == 1) { |
if (result==0) endmacro;
|
run $asirpath+"asirgui"; |
else if (result == 1) {
|
} else if (result == 2) { |
run $asirpath+"asirgui";
|
run "cmd /c "+$asirpath+"cmdasir %f"; |
} else if (result == 2) {
|
} else if (result == 3) { |
run "cmd /c \""+$asirpath+"cmdasir\" %f";
|
call ExecuteSelectedArea; |
} else if (result == 3) {
|
} else if (result == 4) { |
call ExecuteSelectedArea;
|
call ExecuteSelectedLine; |
} else if (result == 4) {
|
} else if (result == 5) { |
call ExecuteSelectedLine;
|
call ExecuteSelectedAreaByPaste; |
} else if (result == 5) {
|
} else if (result == 6) { |
call ExecuteSelectedAreaByPaste;
|
call ExecuteSelectedLineByPaste; |
} else if (result == 6) {
|
} |
call ExecuteSelectedLineByPaste;
|
return true; |
} else if (result == 7) {
|
ExecuteSelectedArea: |
call AbortAsir;
|
if(selecting) { |
}
|
$s = gettext(seltopx,seltopy,selendx,selendy); |
return true;
|
// message "選択範囲は、" + $s + "です. ステルスウインドウに書き出すのはまだ書いてない."; |
ExecuteSelectedArea:
|
$tmp_fname = getenv("TEMP")+"\\cmdasir-tmp-hidemaru.rr"; |
if(selecting) {
|
run "cmd /c del "+$tmp_fname ; |
$s = gettext(seltopx,seltopy,selendx,selendy);
|
call MakeFile $tmp_fname,$s; |
// message "選択範囲は、" + $s + "です. ステルスウインドウに書き出すのはまだ書いてない.";
|
run "cmd /c "+$asirpath+"cmdasir "+$tmp_fname; |
$tmp_fname = getenv("TEMP")+"\\cmdasir-tmp-hidemaru.rr";
|
} else { |
run "cmd /c del "+$tmp_fname ;
|
message "範囲選択されていません"; |
call MakeFile $tmp_fname,$s;
|
} |
run "cmd /c \""+$asirpath+"cmdasir\" "+$tmp_fname;
|
return true; |
} else {
|
ExecuteSelectedLine: |
message "範囲選択されていません";
|
golinetop; |
}
|
beginsel; |
return true;
|
golineend; |
ExecuteSelectedLine:
|
// message(str(seltopx) + "," + str(seltopy) + "," + str(selendx) + "," + str(selendy)); |
golinetop;
|
call ExecuteSelectedArea; |
beginsel;
|
return true; |
golineend;
|
|
// message(str(seltopx) + "," + str(seltopy) + "," + str(selendx) + "," + str(selendy));
|
// MakeFile in cmd_perl. See |
call ExecuteSelectedArea;
|
// http://d.hatena.ne.jp/ohtorii/ |
return true;
|
// https://github.com/ohtorii |
|
|
// MakeFile in cmd_perl. See
|
MakeFile: |
// http://d.hatena.ne.jp/ohtorii/
|
$$tmp_filename = $$1; |
// https://github.com/ohtorii
|
##old_charset = charset; |
|
$$text=$$2; |
MakeFile:
|
##prev_hidemaru = hidemaruhandle(0); |
$$tmp_filename = $$1;
|
|
##old_charset = charset;
|
openfile "/h " + $$tmp_filename; |
$$text=$$2;
|
if(! result){ |
##prev_hidemaru = hidemaruhandle(0);
|
message("テンポラリファイルのオープンに失敗。\n" + $$tmp_filename); |
|
return false; |
openfile "/h " + $$tmp_filename;
|
} |
if(! result){
|
##new_hidemaru = hidemaruhandle(0); |
message("テンポラリファイルのオープンに失敗。\n" + $$tmp_filename);
|
setencode ##old_charset,1; |
return false;
|
insert $$text; |
}
|
|
##new_hidemaru = hidemaruhandle(0);
|
save; |
setencode ##old_charset,1;
|
setactivehidemaru ##prev_hidemaru; |
insert $$text;
|
closehidemaruforced ##new_hidemaru; |
|
return true; |
save;
|
|
setactivehidemaru ##prev_hidemaru;
|
ExecuteSelectedAreaByPaste: |
closehidemaruforced ##new_hidemaru;
|
if(selecting) { |
return true;
|
$s = gettext(seltopx,seltopy,selendx,selendy); |
|
// message "選択範囲は、" + $s + "です. ステルスウインドウに書き出すのはまだ書いてない."; |
ExecuteSelectedAreaByPaste:
|
$tmp_fname = getenv("TEMP")+"\\cmdasir-tmp-hidemaru.rr"; |
if(selecting) {
|
run "cmd /c del "+$tmp_fname ; |
$s = gettext(seltopx,seltopy,selendx,selendy);
|
call MakeFile $tmp_fname,$s; |
// message "選択範囲は、" + $s + "です. ステルスウインドウに書き出すのはまだ書いてない.";
|
run "cmd /c "+$asirpath+"cmdasir --paste-contents "+$tmp_fname; |
$tmp_fname = getenv("TEMP")+"\\cmdasir-tmp-hidemaru.rr";
|
} else { |
run "cmd /c del "+$tmp_fname ;
|
message "範囲選択されていません"; |
call MakeFile $tmp_fname,$s;
|
} |
run "cmd /c \""+$asirpath+"cmdasir\" --paste-contents "+$tmp_fname;
|
return true; |
} else {
|
ExecuteSelectedLineByPaste: |
message "範囲選択されていません";
|
golinetop; |
}
|
beginsel; |
return true;
|
golineend; |
ExecuteSelectedLineByPaste:
|
// message(str(seltopx) + "," + str(seltopy) + "," + str(selendx) + "," + str(selendy)); |
golinetop;
|
call ExecuteSelectedAreaByPaste; |
beginsel;
|
return true; |
golineend;
|
|
// message(str(seltopx) + "," + str(seltopy) + "," + str(selendx) + "," + str(selendy));
|
|
call ExecuteSelectedAreaByPaste;
|
|
return true;
|
|
|
|
AbortAsir:
|
|
run "\""+$asirpath+"cmdasir\" --abort"+" >nul";
|
|
return true;
|
|
|