|
>田楽DLLはDLLファイルなので、秀丸マクロでできないいろいろなことができるの
>で、DLLの関数内でなんでもできてしまいます。
>杉浦さんいきいてみないとわからないかもしれません。
とはいえ、DLLの中から、titleを変えられるのでしょうか?
わかったことですが、おかしくなるタイトルは直前に検索した文字列でした。
で、一応差し障りのない程度に省略したマクロを貼り付けます。
Win2000SP3とXPSP1で再現しました。
titletest.mac
----------------------------------
OptionSetting:
if (1/2 == 0 && version < 302) {
message "このマクロには秀丸の Ver.3.02 以降が必要です。";
endmacro;
}
//=== タブの作成表示 ================================
//田楽DLLのロード
loaddll(hidemarudir + "\\DengakuDLL.dll");
if (!result) {
message "DLL をロードできませんでした。";
endmacro;
}
title "ヘッダ編集のオプション";
call OptionChange;
goto END;
ERROR:
message "何らかのエラーによりマクロを中止します。";
END:
freedll;
endmacro;
OptionChange:
// 著作権情報(page 6)
if (!dllfunc("NEWDLGPAGE","page5",60))goto ERROR;
$ProgramerName = "ProgramerName";
call SetDiagText "ProgramerName",$ProgramerName,"プログラマ名(&P)";
if (!dllfunc("NEWCONTROL","text","","")) goto ERROR;
if (!dllfunc("NEWCONTROL","text","","著作権情報を入力してください")) goto ER
ROR;
if (!dllfunc("NEWCONTROL","text","","(空白行以下は出力しません)")) goto ER
ROR;
$Copyright = "Copyright";
call SetDiagTextMulti "Copyright",$Copyright;
if (!dllfunc("SETCTRLHEIGHT","",5)) goto ERROR;
call SetDiagCheck "No","DefalutSave","著作権情報初期値の保存";
if (!dllfunc("NEWCONTROL","text","","著作権情報の更新は最初の1行だけです"))
goto ERROR;
//ヘッダ編集(page3)
$CommentEdit = "CommentEdit";
$AutoColect = "AutoColect";
$SubrJudgment = "SubrJudgment";
$AsmColect = "AsmColect";
$AutoInfo = "AutoInfo";
$AutoID = "AutoID";
if (!dllfunc("NEWDLGPAGE","page3",60)) goto ERROR;
if (!dllfunc("NEWCONTROL","radio","CommentEdit","History/特記事項")) goto E
RROR;
if (!dllfunc("SETCTRLITEM","","上書き(&O)","-1")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","挿入(&I)","-1")) goto ERROR;
if($CommentEdit == "Overwrite"){
if (!dllfunc("SETCTRLSTATE","","1")) goto ERROR;
}
else{
if (!dllfunc("SETCTRLSTATE","","2")) goto ERROR;
}
call SetDiagCheck $SubrJudgment,"SubrJudgment","サブルーチンヘッダ自動挿入(&S)";
call SetDiagCheck $AsmColect ,"AsmColect" ,"構造化記述時のASMコレクション(&A)";
call SetDiagCheck $AutoInfo ,"AutoInfo" ,"設定情報の自動更新(&P)";
call SetDiagCheck $AutoID ,"AutoID" ,"IDの自動作成(&N)";
call SetDiagCheck $CPPcomment ,"CPPcomment" ,"C++風コメント(&H)";
// 関数シンクロ(page4)
$InsertObject = "InsertObject";
$StartStr= "StartStr";
$EndStr= "EndStr";
$SpecialFile= "SpecialFile";
if (!dllfunc("NEWDLGPAGE","page4",60)) goto ERROR;
if (!dllfunc("NEWCONTROL","radio","InsertObject","プロトタイプ宣言の挿入位置
")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","対応するヘッダファイル(&h)","-1")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","自分のファイル(&I)","-1")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","特定のファイル(&O)","-1")) goto ERROR;
if($InsertObject == "Myheader"){
if (!dllfunc("SETCTRLSTATE","","1")) goto ERROR;
}
else if($InsertObject == "MyFile"){
if (!dllfunc("SETCTRLSTATE","","2")) goto ERROR;
}
else if($InsertObject == "SpecialFile"){
if (!dllfunc("SETCTRLSTATE","","3")) goto ERROR;
}
else{
if (!dllfunc("SETCTRLSTATE","","1")) goto ERROR;
}
call SetDiagText "SpecialFile","","特定のファイル名(&F)";
if (!dllfunc("NEWCONTROL","text","","※挿入位置で特定のファイルを選んだとき
のみ有効です")) goto ERROR;
if (!dllfunc("NEWCONTROL","text",""," ファイル名で検索した後、最初に現れる
開始文字列から挿入します")) goto ERROR;
call SetDiagText "StartStr","* 関数宣言 *","開始文字列(&S)";
call SetDiagText "EndStr","* End of Include *","終了文字列(&E)";
// 開発環境(page2)
if (!dllfunc("NEWDLGPAGE","page2",60,"")) goto ERROR;
call GetToolName;
call SetDiagText "CompilerName",$CompilerName,"コンパイラ名:Version(&C)";
call SetDiagText "AssemblerName",$AssemblerName,"アセンブラ名:Version(&A)";
call SetDiagText "LinkerName",$LinkerName,"リンカ名:Version(&L)";
call SetDiagCombo "OsName",$OsName,"使用OS名:Version(&O)";
call SetDiagCheck "No","DefalutToolSave","開発環境初期値の保存";
// 製品情報(page1)
if (!dllfunc("NEWDLGPAGE","page1",60,)) goto ERROR;
call SetDiagText "Systemname","","システム名(&S)";
call SetDiagText "Coustomer","","客先社名:部署:担当者(&C)";
call SetDiagText "Moder","","客先製品名(&N)";
call SetDiagText "Version","1.00","現在のバージョン(&V)";
call SetDiagText "Oder","","仕掛かり番号(&O)";
call SetDiagText "Cpu","","使用マイコン(&M)";
// タイムスタンプ(page6)
$TimeStamp = "%yy/%m/%d(%W)";
//--- 入力要求ダイアログの作成 ---
if (!dllfunc("NEWDLGPAGE","page6",60,)) goto ERROR;
if (!dllfunc("NEWCONTROL","text","","タイムスタンプの書式を入力してください
")) goto ERROR;
if (!dllfunc("NEWCONTROL","text",""," %YY:年4桁 ex) 2000")) goto ERROR;
if (!dllfunc("NEWCONTROL","text",""," %Y :年2桁 ex) 00")) goto ERROR;
if (!dllfunc("NEWCONTROL","text",""," %M :月2桁")) goto ERROR;
if (!dllfunc("NEWCONTROL","text",""," %D :日2桁")) goto ERROR;
if (!dllfunc("NEWCONTROL","text",""," ※大文字、小文字の区別はありません"))
goto ERROR;
if (!dllfunc("NEWCONTROL","text",""," %W :曜日日本語 ex) 月火...")) goto ER
ROR;
if (!dllfunc("NEWCONTROL","text",""," %w :曜日英語 ex) Mon,Thu")) goto ER
ROR;
if (!dllfunc("NEWCONTROL","text",""," その他の全角、半角文字はそのまま出力
します")) goto ERROR;
if (!dllfunc("NEWCONTROL","text","","このバージョンから年月日付は自分で記入
してください")) goto ERROR;
call SetDiagText1 "TimeStamp",$TimeStamp;
if (!dllfunc("NEWDIALOG","設定値の変更",62,"")) goto ERROR;
if (!dllfunc("NEWCONTROL","tab","tab1","")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","page1,製品情報","-1")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","page2,開発環境","-1")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","page3,ヘッダ編集","-1")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","page4,関数シンクロ","-1")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","page5,著作権情報","-1")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","page6,タイムスタンプ","-1")) goto ERROR;
if (!dllfunc("SETCTRLSTATE","","1")) goto ERROR;
if (!dllfunc("NEWCONTROL","text","","")) goto ERROR;
if (!dllfunc("SETCTRLWIDTH","",60-25)) goto ERROR;
if (!dllfunc("NEWCONTROL","okcancel","","")) goto ERROR;
// ダイアログの表示
if (!dllfunc("SHOWDIALOG",hidemaruhandle(0),1)) goto ERROR;
while(1){
$name = "";
while (strlen($name) == 0) $name = dllfuncstr("WAITCTRLNOTIFY",1);
if ($name == "0" || $name == "1") break;
}
//--- OKが押されたら入力値をゲット ---
if (!dllfunc("ENDDIALOG")) goto ERROR;
if( $name == "1" ) {
}
freedll;
return;
SetDiagText:
$data = "";
if($data == "") $data = $$2;
if (!dllfunc("NEWCONTROL","text","",$$3)) goto ERROR;
if (!dllfunc("SETCTRLWIDTH","",20)) goto ERROR;
if (!dllfunc("NEWCONTROL","edit",$$1,$data)) goto ERROR;
return;
SetDiagCombo:
$data = "";
if($$2 == "" || $$2 == "なし" || $$2 == "未使用"){
if($data == "") $data = $$2;
if($data == "") $data = "なし";
if (!dllfunc("NEWCONTROL","text","",$$3)) goto ERROR;
if (!dllfunc("SETCTRLWIDTH","",20)) goto ERROR;
if (!dllfunc("NEWCONTROL","edit",$$1,$data)) goto ERROR;
}
else{
if (!dllfunc("NEWCONTROL","text","",$$3)) goto ERROR;
if (!dllfunc("SETCTRLWIDTH","",20)) goto ERROR;
if (!dllfunc("NEWCONTROL","combo",$$1,"")) goto ERROR;
if (!dllfunc("SETCTRLITEM","","なし","")) goto ERROR;
if (!dllfunc("SETCTRLSTATE","","1")) goto ERROR;
if($data != "" && $data != "なし" && $data != "未使用"){
if (!dllfunc("SETCTRLITEM","",$data,"")) goto ERROR;
if (!dllfunc("SETCTRLSTATE","","2")) goto ERROR;
}
if($$2 != "" && $$2 != "なし" && $$2 != "未使用" && $$2 != $data){
if (!dllfunc("SETCTRLITEM","",$$2,"")) goto ERROR;
}
}
return;
SetDiagText1:
$data = "";
if($data == "") $data = $$2;
if (!dllfunc("NEWCONTROL","edit",$$1,$data)) goto ERROR;
return;
SetDiagTextMulti:
$data = "";
if($data == "") $data = $$2;
if (!dllfunc("NEWCONTROL","mledit",$$1,$data)) goto ERROR;
return;
SetDiagCheck:
if (!dllfunc("NEWCONTROL","check",$$2,$$3)) goto ERROR;
if($$1 == "Yes")
if (!dllfunc("SETCTRLSTATE","","1")) goto ERROR;
else
if (!dllfunc("SETCTRLSTATE","","0")) goto ERROR;
return;
GetToolName:
$mcu = "MCU";
$lang = "LANG";
$CompilerName = "Compiler";
$AssemblerName = "Assembler";
$LinkerName = "Linker";
$OsName = "Os";
return;
--------------------------------
|
|