$ini = macrodir + "\\Nepo101.ini"; //設定ファイルのパス
//マクロ開始
call initialize;
//マクロ終了
////// ■ メイン関数群 ■ ////// 基本的に上から下へ実行
// &initialize 初期化と設定の取得 //
initialize:
#version = 200;
enabledraw;
//田楽DLLロード
loaddll hidemarudir + "\\DengakuDLL.dll";
if (!result)
call error "「文字列からファイルを開くマクロ」\n\n田楽DLLのロードに失敗しました。\n" + hidemarudir +" に DengakuDLL.dll があるか確認してください。";
else if (val(leftstr(dllfuncstr("GETVERSION"), 1)) < 2)
call error "このマクロの実行には Ver.2.00 以降の田楽DLLが必要です。";
else if (!existfile($ini))
#fastContact = 1; //初回起動
else
#fastContact = 0;
call createDialog; //次へ
return;
//initialize.end
createDialog:
// 親コントロール // envset
##r = dllfunc("NEWDIALOG", "文字列からファイルを開くマクロの設定", 120, "");
##r = dllfunc("NEWCONTROL", "tab", "tab1", "");
##r = dllfunc("SETCTRLITEM", "", "SystemTab,全般", "-1");
##r = dllfunc("SETCTRLITEM", "", "ExtensionTab,拡張子", "-1");
##r = dllfunc("SETCTRLITEM", "", "AppsTab,アプリケーション", "-1");
##r = dllfunc("SETCTRLITEM", "", "IndexSearchTab,インデックス検索", "-1");
##r = dllfunc("SETCTRLITEM", "", "ReplaceWebPathTab,Webパス変換", "-1");
##r = dllfunc("SETCTRLITEM", "", "ReplaceAliasPathTab,エイリアスパス変換", "-1");
##r = dllfunc("SETCTRLSTATE", "", getinistr($ini, "System", "CurrentEnvsetPage"));
##r = dllfunc("SETCTRLNOTIFY", "", "5");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("SETCTRLWIDTH", "", 40);
##r = dllfunc("NEWCONTROL", "okcancel", "", "");
##r = dllfunc("SETCTRLWIDTH", "", 40);
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("SETCTRLWIDTH", "", 40);
// call createNewDialog;
call createSystemTab;
call createExtensionTab;
call createAppsTab;
call createIndexSearchTab;
call createReplacePathTab;
call createReplaceAliasTab;
call dialogControl; //次へ
return;
//createDialog.end
// ダイアログコントロール // envset
dialogControl:
if (!dllfunc("SHOWDIALOG", hidemaruhandle(0), 1))
call error "show";
while (1) {
$$notify = "";
while (!strlen($$notify))
$$notify = dllfuncstr("WAITCTRLNOTIFY", 100);
##notify = val($$notify);
if (##notify == 0 || ##notify == 1) {
break;
//ファイラの参照 envset
} else if (##notify >= 300 && ##notify < 309) { call refCtrl "Filer", ##notify;
//エディタの参照 envset
} else if (##notify >= 310 && ##notify < 319) { call refCtrl "Editor", ##notify;
//ブラウザの参照 envset
} else if (##notify >= 320 && ##notify < 329) { call refCtrl "Browser", ##notify;
//ビューアの参照 envset
} else if (##notify >= 330 && ##notify < 339) { call refCtrl "Viewer", ##notify;
//プレイヤーの参照 envset
} else if (##notify >= 340 && ##notify < 349) { call refCtrl "Player", ##notify;
//インデックス検索の有効チェックボックス envset
} else if (##notify == 40) {
##UseIndexSearchEnable = 1 - ##UseIndexSearchEnable;
##r = dllfunc("ENABLECTRL", ##UseIndexSearchEnable, "IndexFileList");
//Webパス変換の有効チェックボックス envset
} else if (##notify == 50) {
##UseReplaceWebPathEnable = 1 - ##UseReplaceWebPathEnable;
##r = dllfunc("ENABLECTRL", ##UseReplaceWebPathEnable, "WebList");
//エイリアスパス変換の有効チェックボックス envset
} else if (##notify == 60) {
##UseReplaceAliasPathEnable = 1 - ##UseReplaceAliasPathEnable;
##r = dllfunc("ENABLECTRL", ##UseReplaceAliasPathEnable, "AliasList");
}
}
//ダイアログ終了
if (!dllfunc("ENDDIALOG"))
call error "ダイアログの終了処理に失敗しました。";
call saveEnvset ##notify; //次へ
return;
// envset
// saveEnvset ■保存 // envset
saveEnvset:
//iniがない時にキャンセルしたら作らない
if (##1 == 0 && #fastContact) //なぜ (!##1 && #fastContact) だと真になる?
goto exit;
//キャンセルしても今開いてるダイアログページは記憶する
writeininum $ini, "System", "EnvsetMacroVersion", #version;
writeinistr $ini, "System", "CurrentEnvsetPage", dllfuncstr("GETCTRLSTATE", "tab1");
if (!##1) //キャンセル=0, OK=1
goto exit;
// 全般 // envset
writeinistr $ini, "System", "UseFastSelect", dllfuncstr("GETCTRLSTATE", "UseFastSelect");
writeinistr $ini, "System", "UseDebugMode", dllfuncstr("GETCTRLSTATE", "UseDebugMode");
writeinistr $ini, "System", "UseFolderOpen", dllfuncstr("GETCTRLSTATE", "UseFolderOpen");
$$keyword = dllfuncstr("GETCTRLSTRING", "EnvsetKeyword");
if ($$keyword == "") //空白キーワードを指定
$$keyword = "EnvsetKeywordNoneStrings";
writeinistr $ini, "System", "EnvsetKeyword", $$keyword;
// 拡張子選択 // envset
writeinistr $ini, "ExtensionList", "SelectExt", dllfuncstr("GETCTRLSTRING", "SelectExt");
writeinistr $ini, "ExtensionList", "EditorExt", dllfuncstr("GETCTRLSTRING", "EditorExt");
writeinistr $ini, "ExtensionList", "BrowserExt", dllfuncstr("GETCTRLSTRING", "BrowserExt");
writeinistr $ini, "ExtensionList", "ViewerExt", dllfuncstr("GETCTRLSTRING", "ViewerExt");
writeinistr $ini, "ExtensionList", "PlayerExt", dllfuncstr("GETCTRLSTRING", "PlayerExt");
writeinistr $ini, "ExtensionList", "ExecuteExt", dllfuncstr("GETCTRLSTRING", "ExecuteExt");
// アプリケーション // envset
call appsSave "Filer";
call appsSave "Editor";
call appsSave "Browser";
call appsSave "Viewer";
call appsSave "Player";
// インデックス検索 // envset
writeinistr $ini, "IndexSearch", "UseIndexSearch", dllfuncstr("GETCTRLSTATE", "UseIndexSearch");
$$list = dllfuncstr("GETTOKEN", dllfuncstr("GETCTRLSTRING", "IndexFileList"), "\n"); //改行があったら削除
writeinistr $ini, "IndexSearch", "IndexFileList", $$list;
// Webパス変換 // envset
writeinistr $ini, "ReplaceWebPath", 0, 0; //設定を減らした時にリストの最後尾が残るので一度セクションごと消す
writeinistr $ini, "ReplaceWebPath", "UseReplaceWebPath", dllfuncstr("GETCTRLSTATE", "UseReplaceWebPath");
$$path = dllfuncstr("GETTOKEN", dllfuncstr("GETCTRLSTRING", "WebList"), "\n"); //書式:"DocRoot0>WebRoot0\nDocRoot1>WebRoot1\n..."
##i = 0;
while (1) {
call subleft $$path, ">";
$$droot = $$return;
call subright $$path, ">";
$$wroot = $$return;
if ($$droot == "" && $$wroot == "") //空行を見つけたら抜ける
break;
else if ($$droot != "" && $$wroot != "") {
writeinistr $ini, "ReplaceWebPath", "DocRoot" + str(##i), $$droot;
writeinistr $ini, "ReplaceWebPath", "WebRoot" + str(##i), $$wroot;
} else if (!dllfunc("HASMORETOKENS"))
break;
$$path = dllfuncstr("GETTOKEN", "", "\n");
##i = ##i +1;
}
// エイリアスパス変換 // envset
writeinistr $ini, "ReplaceAliasPath", 0, 0; //設定を減らした時にリストの最後尾が残るので一度セクションごと消す
writeinistr $ini, "ReplaceAliasPath", "UseReplaceAliasPath", dllfuncstr("GETCTRLSTATE", "UseReplaceAliasPath");
$$path = dllfuncstr("GETTOKEN", dllfuncstr("GETCTRLSTRING", "AliasList"), "\n"); //書式:AliasPath0>LocalPath0\n...
##i = 0;
while (1) {
call subleft $$path, ">";
$$alias = $$return;
call subright $$path, ">";
$$local = $$return;
if ($$alias == "" && $$local == "") //空行を見つけたら抜ける
break;
else if ($$alias != "" || $$local != "") {
writeinistr $ini, "ReplaceAliasPath", "AliasPath" + str(##i), $$alias;
writeinistr $ini, "ReplaceAliasPath", "LocalPath" + str(##i), $$local;
} else if (!dllfunc("HASMORETOKENS"))
break;
$$path = dllfuncstr("GETTOKEN", "", "\n");
##i = ##i +1;
}
call exit;
return;
//saveEnvset.end
// e&xit 終了処理 // envset
exit:
freedll;
endmacro;
//exit.end
////// ■ サブ関数群 ■ ////// メイン関数群の可読性を高めるためにモジュール化して分離
// &t タブの作成 全般タブ // envset
createSystemTab:
##r = dllfunc("NEWDLGPAGE", "SystemTab", 118);
##r = dllfunc("NEWCONTROL","group", "", "高速モード");
##r = dllfunc("SETCTRLITEM", "", "SystemGroup1", "-1");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL","group", "", "デバッグモード");
##r = dllfunc("SETCTRLITEM", "", "SystemGroup2", "-1");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL","group", "", "フォルダオープン");
##r = dllfunc("SETCTRLITEM", "", "SystemGroup3", "-1");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL","group", "", "クイック環境設定起動");
##r = dllfunc("SETCTRLITEM", "", "SystemGroup4", "-1");
//高速モード envset
##r = dllfunc("NEWDLGPAGE", "SystemGroup1", 118);
##r = dllfunc("NEWCONTROL", "check", "UseFastSelect", "パス取得中は画面に描画しない ( disabledraw を使う)");
##r = dllfunc("NEWCONTROL", "text", "", " 動作が速くなりますが、どの部分をパスとして拾ったのかわからなくなります。");
##r = dllfunc("NEWCONTROL", "text", "", " このマクロの癖がわかってきたらONにすることをおすすめ。");
//デバッグモード envset
##r = dllfunc("NEWDLGPAGE", "SystemGroup2", 118);
##r = dllfunc("NEWCONTROL", "check", "UseDebugMode", "デバッグモードにする");
##r = dllfunc("NEWCONTROL", "text", "", " 取得したパスや処理結果とかをいちいち報告します。エイリアスの設定とかがうまくいかない時に");
##r = dllfunc("NEWCONTROL", "text", "", " ONにすると解決のヒントになるかもしれません。ダイアログには該当の関数名も表示されます。");
//フォルダオープン envset
##r = dllfunc("NEWDLGPAGE", "SystemGroup3", 118);
##r = dllfunc("NEWCONTROL", "check", "UseFolderOpen", "ファイルのパスからフォルダを開けるようにする");
##r = dllfunc("NEWCONTROL", "text", "", " 取得したパスからファイル名を取り除いて、フォルダのパスに整形します。");
##r = dllfunc("NEWCONTROL", "text", "", " この設定を有効にすると、メニューに「このファイルがあるフォルダを開く」が現れます。");
//クイック環境設定起動 envset
##r = dllfunc("NEWDLGPAGE", "SystemGroup4", 118);
##r = dllfunc("NEWCONTROL", "text", "", "キーワード : ");
##r = dllfunc("SETCTRLWIDTH", "", 8);
##r = dllfunc("NEWCONTROL", "edit", "EnvsetKeyword", "envset");
##r = dllfunc("SETCTRLWIDTH", "", 20);
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", " 取得した文字がキーワードと一致すると、この設定ダイアログを開きます。");
##r = dllfunc("NEWCONTROL", "text", "", " この環境設定マクロにマクロの登録数を費やさずにすみます。");
##r = dllfunc("NEWCONTROL", "text", "", " 欄を空にすると、なにもない行でマクロを起動した時に環境設定を開きます。");
//設定適用
##r = dllfunc("SETCTRLSTATE", "UseDebugMode", getinistr($ini, "System", "UseDebugMode"));
##r = dllfunc("SETCTRLSTATE", "UseFastSelect", getinistr($ini, "System", "UseFastSelect"));
##r = dllfunc("SETCTRLSTATE", "UseFolderOpen", getinistr($ini, "System", "UseFolderOpen"));
$$keyword = getinistr($ini, "System", "EnvsetKeyword");
if ($$keyword != "") {
if ($$keyword == "EnvsetKeywordNoneStrings") //空白キーワードを指定してる時
$$keyword = "";
$$r = dllfuncstr("SETCTRLSTRING", "EnvsetKeyword", $$keyword);
}
return;
//createSystemTab.end
// 拡張子タブ // 20 envset
createExtensionTab:
##r = dllfunc("NEWDLGPAGE", "ExtensionTab", 118);
##r = dllfunc("NEWCONTROL","group", "", "説明");
##r = dllfunc("SETCTRLITEM", "", "ExtensionGroup1", "-1");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "エディタかブラウザを選択する拡張子(Webパス変換が適用される拡張子)");
##r = dllfunc("NEWCONTROL", "edit", "SelectExt", "cgi,htm,html,shtm,shtml,xht,xhtml");
##r = dllfunc("NEWCONTROL", "text", "", "エディタで開く拡張子(テキストファイル)");
##r = dllfunc("NEWCONTROL", "edit", "EditorExt", "bat,cfg,conf,css,dat,hilight,htt,ini,inf,js,log,m3u,mac,pl,pm,reg,txt,vbs");
##r = dllfunc("NEWCONTROL", "text", "", "ブラウザで開く拡張子(ブラウザで開けるバイナリファイル)");
##r = dllfunc("NEWCONTROL", "edit", "BrowserExt", "mht,swf,pdf,doc,xsl");
##r = dllfunc("NEWCONTROL", "text", "", "画像ビューアで開く拡張子");
##r = dllfunc("NEWCONTROL", "edit", "ViewerExt", "bmp,gif,jpg,png");
##r = dllfunc("NEWCONTROL", "text", "", "再生プレイヤーで開く拡張子");
##r = dllfunc("NEWCONTROL", "edit", "PlayerExt", "asf,avi,cda,m3u,mid,midi,mp3,mpg,mpeg,wav,wma,wmv");
##r = dllfunc("NEWCONTROL", "text", "", "そのまま実行する拡張子(実行ファイル)");
##r = dllfunc("NEWCONTROL", "edit", "ExecuteExt", "exe,scr");
##r = dllfunc("NEWDLGPAGE", "ExtensionGroup1", 118);
##r = dllfunc("NEWCONTROL", "text", "", "取得したパスの拡張子を判別し、それぞれのアプリケーションで開きます。");
##r = dllfunc("NEWCONTROL", "text", "", "拡張子はコンマ区切りで列挙してください。(ピリオドを入れちゃダメ)");
##r = dllfunc("NEWCONTROL", "text", "", "設定が重複してる時は、上のものほど優先されます。");
return;
//createExtensionTab.end
// アプリケーションタブ // 30 envset
createAppsTab:
##r = dllfunc("NEWDLGPAGE", "AppsTab", 118);
##r = dllfunc("NEWCONTROL","group", "", "説明");
##r = dllfunc("SETCTRLITEM", "", "AppsGroup1", "-1");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "tab", "apps", "");
##r = dllfunc("SETCTRLITEM", "", "FilerTab,ファイラ", "-1");
##r = dllfunc("SETCTRLITEM", "", "EditorTab,エディタ", "-1");
##r = dllfunc("SETCTRLITEM", "", "BrowserTab,ブラウザ", "-1");
##r = dllfunc("SETCTRLITEM", "", "ViewerTab,画像ビューア", "-1");
##r = dllfunc("SETCTRLITEM", "", "PlayerTab,再生プレイヤー", "-1");
##r = dllfunc("NEWDLGPAGE", "AppsGroup1", 118);
##r = dllfunc("NEWCONTROL", "text", "", "メニューに表示するアプリケーションを登録します。パスには %systemroot% や %windir% などの環境変数も使えます。");
##r = dllfunc("NEWCONTROL", "text", "", "起動オプションがある時はパスの後ろに手入力してください。");
##r = dllfunc("NEWCONTROL", "text", "", "パスに空白が含まれても構いませんが、起動オプションを同時に指定する場合は、パスを \" \" でくくる必要があります。");
##r = dllfunc("NEWCONTROL", "text", "", "特に C:\\Program Files を使ってる時はご注意。( [参照] を使うと、空白がある時は自動でくくってくれます)");
##r = dllfunc("NEWCONTROL", "text", "", "また、登録をひとつだけにしておくと、メニューを出さずに直で実行します。(設定によって他の選択メニューが出ることもあります)");
// ファイラタブ // 300〜309 envset
##r = dllfunc("NEWDLGPAGE", "FilerTab", 115);
call createAppTab "Filer", "30"; //参照ボタンの識別子は300〜309
if (dllfuncstr("GETCTRLSTRING", "FilerPath0") == "") {
$$r = dllfuncstr("SETCTRLSTRING", "FilerName0", "エクスプローラ");
$$r = dllfuncstr("SETCTRLSTRING", "FilerPath0", "%windir%\\Explorer.exe");
}
// エディタタブ // 310〜319 envset
##r = dllfunc("NEWDLGPAGE", "EditorTab", 115);
call createAppTab "Editor", "31";
if (dllfuncstr("GETCTRLSTRING", "EditorPath0") == "") {
$$r = dllfuncstr("SETCTRLSTRING", "EditorName0", "秀丸エディタ");
$$r = dllfuncstr("SETCTRLSTRING", "EditorPath0", "" + hidemarudir + "\\Hidemaru.exe");
}
// ブラウザタブ // 320〜329 envset
##r = dllfunc("NEWDLGPAGE", "BrowserTab", 115);
call createAppTab "Browser", "32";
if (dllfuncstr("GETCTRLSTRING", "BrowserPath0") == "") {
$$r = dllfuncstr("SETCTRLSTRING", "BrowserName0", "Internet Explorer");
$$r = dllfuncstr("SETCTRLSTRING", "BrowserPath0", "%systemdrive%\\Program Files\\Internet Explorer\\iexplore.exe");
}
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "秀丸エクスプローラを導入してる時は、秀丸もここに登録しておくと使えるようになります。FTPにも対応しているのでおすすめ。");
##r = dllfunc("NEWCONTROL", "text", "", "秀丸エクスプローラは秀丸の開発サイトから無償でダウンロードできます。");
// ビューアタブ // 330〜339 envset
##r = dllfunc("NEWDLGPAGE", "ViewerTab", 115);
call createAppTab "Viewer", "33";
if (dllfuncstr("GETCTRLSTRING", "ViewerPath0") == "") {
$$r = dllfuncstr("SETCTRLSTRING", "ViewerName0", "Internet Explorer");
$$r = dllfuncstr("SETCTRLSTRING", "ViewerPath0", "%systemdrive%\\Program Files\\Internet Explorer\\iexplore.exe");
}
// プレイヤータブ // 340〜349 envset
##r = dllfunc("NEWDLGPAGE", "PlayerTab", 115);
call createAppTab "Player", "34";
if (dllfuncstr("GETCTRLSTRING", "PlayerPath0") == "") {
$$r = dllfuncstr("SETCTRLSTRING", "PlayerName0", "Windows Media Player");
$$r = dllfuncstr("SETCTRLSTRING", "PlayerPath0", "%systemdrive%\\Program Files\\Windows Media Player\\wmplayer.exe");
}
return;
//createAppsTab.end
// アプリケーションタブのコントロール生成 // envset
createAppTab:
$$appKey = $$1;
$$notify = $$2;
##i = 0;
while (##i < 10) {
$$i = str(##i);
$$ii = str(##i +1);
$$name[##i] = getinistr($ini, $$appKey, $$appKey + "Name" + $$i);
$$path[##i] = getinistr($ini, $$appKey, $$appKey + "Path" + $$i);
$$optn[##i] = getinistr($ini, $$appKey, $$appKey + "Optn" + $$i);
##r = dllfunc("NEWCONTROL", "text", "", "表示名" + $$ii);
##r = dllfunc("SETCTRLWIDTH", "", 8);
##r = dllfunc("NEWCONTROL", "edit", $$appKey + "Name" + $$i, $$name[##i]);
##r = dllfunc("SETCTRLWIDTH", "", 23);
##r = dllfunc("NEWCONTROL", "text", "", " パス" + $$ii);
##r = dllfunc("SETCTRLWIDTH", "", 7);
##r = dllfunc("NEWCONTROL", "edit", $$appKey + "Path" + $$i, $$path[##i]);
##r = dllfunc("SETCTRLWIDTH", "", 72);
##r = dllfunc("NEWCONTROL", "reffilebutton", $$appKey + "Ref" + $$i, "");
##r = dllfunc("SETCTRLWIDTH", "", 6);
##r = dllfunc("SETCTRLITEM", "", "");
##r = dllfunc("SETCTRLITEM", "", hidemarudir);
##r = dllfunc("SETCTRLITEM", "", "'実行ファイル (*.exe)'");
##r = dllfunc("SETCTRLITEM", "", "1");
##r = dllfunc("SETCTRLNOTIFY", "", $$notify + $$i);
##i = ##i +1;
}
return;
//createAppTab.end envset
// インデックス検索タブ // 40 envset
createIndexSearchTab:
##r = dllfunc("NEWDLGPAGE", "IndexSearchTab", 118);
##r = dllfunc("NEWCONTROL","group", "", "説明");
##r = dllfunc("SETCTRLITEM", "", "IndexGroup1", "-1");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "check", "UseIndexSearch", "この機能を使う");
##r = dllfunc("SETCTRLNOTIFY", "", "40");
##r = dllfunc("NEWCONTROL", "mledit", "IndexFileList", "index.cgi>index.html>index.htm");
##r = dllfunc("SETCTRLHEIGHT", "", 2);
##r = dllfunc("NEWDLGPAGE", "IndexGroup1", 118);
##r = dllfunc("NEWCONTROL", "text", "", "取得したパスにファイル名がない時(フォルダのパスだった時)、そのフォルダの中を検索して、下のリストにあるファイルが見つかれば、");
##r = dllfunc("NEWCONTROL", "text", "", "そのファイルをエディタで開くことができます。");
##r = dllfunc("NEWCONTROL", "text", "", "用途としては、たとえば から ../folder/index.html を開いたりできます。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "> で区切っていくつでも指定できますが、重複して見つかった時は前の方が優先されます。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "この設定を有効にすると、取得した文字がフォルダのパスだった時に「インデックスファイル名を補完してエディタで開く」が現れます。");
##c = getininum($ini, "IndexSearch", "UseIndexSearch");
##UseIndexSearchEnable = ##c;
if (##c)
##r = dllfunc("SETCTRLSTATE", "UseIndexSearch", str(##c));
else
##r = dllfunc("ENABLECTRL", 0, "IndexFileList");
if (getinistr($ini, "IndexSearch", "IndexFileList") != "")
##r = dllfunc("SETCTRLSTRING", "IndexFileList", getinistr($ini, "IndexSearch", "IndexFileList"));
return;
//createIndexSearchTab.end
// Webパス変換タブ // 50 envset
createReplacePathTab:
##r = dllfunc("NEWDLGPAGE", "ReplaceWebPathTab", 118);
##r = dllfunc("NEWCONTROL","group", "", "説明");
##r = dllfunc("SETCTRLITEM", "", "WebPathGroup1", "-1");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "check", "UseReplaceWebPath", "この機能を使う");
##r = dllfunc("SETCTRLNOTIFY", "", "50");
##r = dllfunc("NEWCONTROL", "mledit", "WebList", "");
##r = dllfunc("SETCTRLHEIGHT", "", 10);
##r = dllfunc("NEWCONTROL", "text", "", "※細かい入力チェックはしてません。特に、途中に空行を作ると後ろ全部が消え去るのでご注意。");
##r = dllfunc("NEWDLGPAGE", "WebPathGroup1", 118);
##r = dllfunc("NEWCONTROL", "text", "", "取得したローカルのパスをWebのHTTPパスへ変換します。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", " 例:ローカルパスが D:/My Documents/Web/ で、変換パスが http://server.ne.jp/~user/ の時、");
##r = dllfunc("NEWCONTROL", "text", "", " D:/My Documents/Web/folder/... を http://server.ne.jp/~user/folder/... に変換します。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "この機能は、[拡張子] タブの「エディタかブラウザを選択する拡張子」のみに適用され、マッチしたものがあると");
##r = dllfunc("NEWCONTROL", "text", "", "自動で「Webパスに変換してブラウザで開く」というメニューが現れます。(変換後のパスも一緒に表示されます)");
##r = dllfunc("NEWCONTROL", "text", "", "これを使うと、CGIやXHTMLのような「サーバーを通さないとブラウザでプレビューできないファイル」に対応できます。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "1行ごとに「ローカルパス>Webパス」という書式で設定します。(「左のパスを右のパスへ変換」と解釈するとわかりやすいかも)");
##r = dllfunc("NEWCONTROL", "text", "", "パスの区切りは / でも \\ でも構わないし、空白が入っても大丈夫です。");
##r = dllfunc("NEWCONTROL", "text", "", " 例: D:/My Documents/Web/>http://server.ne.jp/~user/");
##r = dllfunc("NEWCONTROL", "text", "", "また、複数にマッチする時は、上の方が優先されます。");
##c = getininum($ini, "ReplaceWebPath", "UseReplaceWebPath");
##UseReplaceWebPathEnable = ##c;
if (##c)
##r = dllfunc("SETCTRLSTATE", "UseReplaceWebPath", str(##c));
else
##r = dllfunc("ENABLECTRL", 0, "WebList");
if (getinistr($ini, "ReplaceWebPath", "DocRoot0") != "") {
##i = 0;
$$s = "";
while (1) {
$$droot = getinistr($ini, "ReplaceWebPath", "DocRoot" + str(##i));
$$wroot = getinistr($ini, "ReplaceWebPath", "WebRoot" + str(##i));
if ($$droot != "" || $$wroot != "")
$$s = $$s + $$droot + ">" + $$wroot + "\n";
else
break;
##i = ##i +1;
} ##r = dllfunc("NEWCONTROL", "text", "", $$s);
##r = dllfunc("SETCTRLSTRING", "WebList", $$s);
}
return;
//createReplacePathTab.end
// エイリアスパス変換タブ // 60 envset
createReplaceAliasTab:
##r = dllfunc("NEWDLGPAGE", "ReplaceAliasPathTab", 118);
##r = dllfunc("NEWCONTROL","group", "", "説明");
##r = dllfunc("SETCTRLITEM", "", "AliasPathGroup1", "-1");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "check", "UseReplaceAliasPath", "この機能を使う");
##r = dllfunc("SETCTRLNOTIFY", "", "60");
##r = dllfunc("NEWCONTROL", "mledit", "AliasList", "");
##r = dllfunc("SETCTRLHEIGHT", "", 10);
##r = dllfunc("NEWCONTROL", "text", "", "※細かい入力チェックはしてません。特に、途中に空行を作ると後ろ全部が消え去るのでご注意。");
##r = dllfunc("NEWDLGPAGE", "AliasPathGroup1", 118);
##r = dllfunc("NEWCONTROL", "text", "", "自宅サーバーなどでエイリアスを設定している人向けの機能です。");
##r = dllfunc("NEWCONTROL", "text", "", "取得したパスが「 / から始まるルートパス」だった時、この設定に従ってパスを変換します。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", " 例:エイリアスパスが /alias/ で、実際のパスが D:/My Documents/Web/エイリアス/ の時、");
##r = dllfunc("NEWCONTROL", "text", "", " /alias/folder/image/ を D:/My Documents/Web/エイリアス/folder/image/ に変換します。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "これを使うことで、 などにも柔軟に対応させることができます。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "1行ごとに「エイリアスパス>実際のパス」という書式で設定します。(「左のパスを右のパスへ変換」と解釈するとわかりやすいかも)");
##r = dllfunc("NEWCONTROL", "text", "", "パスの区切りは / でも \\ でも構わないし、空白が入っても大丈夫です。");
##r = dllfunc("NEWCONTROL", "text", "", " 例: /alias/folder/>D:My Documents/Web/エイリアス/folder/");
##r = dllfunc("NEWCONTROL", "text", "", "また、複数にマッチする時は、上の方が優先されます。");
##r = dllfunc("NEWCONTROL", "text", "", "");
##r = dllfunc("NEWCONTROL", "text", "", "応用として、 /alias/web/>http://server.ne.jp/~user/ なんていう設定もアリです。( http:// にすると自動でブラウザメニューになります)");
##c = getininum($ini, "ReplaceAliasPath", "UseReplaceAliasPath");
##UseReplaceAliasPathEnable = ##c;
if (##c)
##r = dllfunc("SETCTRLSTATE", "UseReplaceAliasPath", str(##c));
else
##r = dllfunc("ENABLECTRL", 0, "AliasList");
if (getinistr($ini, "ReplaceAliasPath", "AliasPath0") != "") {
##i = 0;
$$s = "";
while (1) {
$$alias = getinistr($ini, "ReplaceAliasPath", "AliasPath" + str(##i));
$$local = getinistr($ini, "ReplaceAliasPath", "LocalPath" + str(##i));
if ($$alias != "" || $$local != "")
$$s = $$s + $$alias + ">" + $$local + "\n";
else
break;
##i = ##i +1;
}
##r = dllfunc("SETCTRLSTRING", "AliasList", $$s);
}
return;
//createReplaceAliasTab.end
// refCtrl 参照ボタンの実行 // envset
refCtrl:
$$appKey = $$1;
$$n = rightstr(str(##2), 1); //notifyの下1桁を抜く(参照ボタンが押されたコントロールを識別)
$$p = dllfuncstr("GETCTRLSTRING", $$appKey + "Ref" + $$n); //参照で選ばれたパスを取得
if (strstr($$p, "|") != -1) { //複数選択した時はひとつに削る
$$s = dllfuncstr("GETTOKEN", $$p, "|");
$$p = $$s;
$$s = dllfuncstr("GETTOKEN", "", "|");
$$p = $$p + "\\" + $$s;
}
if (strstr($$p, " ") != -1) //空白が含まれる時は " " でくくる
$$p = "\"" + $$p + "\"";
##r = dllfunc("SETCTRLSTRING", $$appKey + "Path" + $$n, $$p); //パス挿入
return;
//refCtrl.end
// appsSave アプリケーションの設定保存 // envset
appsSave:
$$appKey = $$1;
##i = 0;
while (##i < 10) {
$$i = str(##i);
$$name = dllfuncstr("GETCTRLSTRING", $$appKey + "Name" + $$i);
$$path = dllfuncstr("GETCTRLSTRING", $$appKey + "Path" + $$i);
if ($$name != "" && $$path != "") {
writeinistr $ini, $$appKey, $$appKey + "Name" + $$i, $$name;
writeinistr $ini, $$appKey, $$appKey + "Path" + $$i, $$path;
} else {
writeinistr $ini, $$appKey, $$appKey + "Name" + $$i, 0;
writeinistr $ini, $$appKey, $$appKey + "Path" + $$i, 0;
}
##i = ##i +1;
}
return;
//appsSave.end
////// ■ 汎用関数群 ■ //////
subleft:
##n = dllfunc("STRSTR2", $$1, $$2);
$$s = dllfuncstr("LEFTSTR2", $$1, ##n);
return $$s;
subright:
##n = dllfunc("STRSTR2", $$1, $$2);
$$s = dllfuncstr("MIDSTR2", $$1, ##n + dllfunc("STRLEN2", $$2), dllfunc("STRLEN2", $$1) - ##n);
return $$s;
alert:
#r = dllfunc("SHOWMESSAGE", "alert", $$1);
return;
error:
call alert $$1;
call exit;
return;