Skip to content

Commit

Permalink
OnOpenHyojunka
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Mar 20, 2018
1 parent 616f365 commit 1488181
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion READMEJP.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
エクスポートを修正・標準化。
エクスポート方法を選べるようにエクスポート オプションを追加。
"resource.h"の更新を使いやすく修正。
2018.XX.YY ver.4.0
2018.03.20 ver.4.0
バックアップをもっと安全に。
バックアップを5世代までに制限。
非標準のリソースIDの解釈を改善。
Expand Down
34 changes: 34 additions & 0 deletions src/RisohEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ class MMainWnd : public MWindowBase
void OnOpenReadMe(HWND hwnd);
void OnOpenReadMeJp(HWND hwnd);
void OnOpenLicense(HWND hwnd);
void OnOpenHyojunka(HWND hwnd);
void OnDebugTreeNode(HWND hwnd);
void OnAdviceResH(HWND hwnd);
void OnUnloadResH(HWND hwnd);
Expand Down Expand Up @@ -2807,6 +2808,36 @@ void MMainWnd::OnOpenReadMeJp(HWND hwnd)
ShellExecuteW(hwnd, NULL, szPath, NULL, NULL, SW_SHOWNORMAL);
}

void MMainWnd::OnOpenHyojunka(HWND hwnd)
{
WCHAR szPath[MAX_PATH];
GetModuleFileNameW(NULL, szPath, _countof(szPath));
LPWSTR pch = wcsrchr(szPath, L'\\');
if (pch == NULL)
return;

++pch;
size_t diff = pch - szPath;
StringCchCopyW(pch, diff, L"HYOJUNKA.txt");
if (GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES)
{
StringCchCopyW(pch, diff, L"..\\HYOJUNKA.txt");
if (GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES)
{
StringCchCopyW(pch, diff, L"..\\..\\HYOJUNKA.txt");
if (GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES)
{
StringCchCopyW(pch, diff, L"..\\..\\..\\HYOJUNKA.txt");
if (GetFileAttributesW(szPath) == INVALID_FILE_ATTRIBUTES)
{
return;
}
}
}
}
ShellExecuteW(hwnd, NULL, szPath, NULL, NULL, SW_SHOWNORMAL);
}

void MMainWnd::OnOpenLicense(HWND hwnd)
{
WCHAR szPath[MAX_PATH];
Expand Down Expand Up @@ -7186,6 +7217,9 @@ void MMainWnd::OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
case ID_OPENLICENSE:
OnOpenLicense(hwnd);
break;
case ID_OPENHYOJUNKA:
OnOpenHyojunka(hwnd);
break;
case ID_DEBUGTREENODE:
OnDebugTreeNode(hwnd);
break;
Expand Down
2 changes: 2 additions & 0 deletions src/lang/ja-JP.rc
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ IDR_MAINMENU MENU
MENUITEM "&README.txtを開く", ID_OPENREADME
MENUITEM "README&JP.txtを開く", ID_OPENREADMEJP
MENUITEM SEPARATOR
MENUITEM "&HYOJUNKA.txtを開く", ID_OPENHYOJUNKA
MENUITEM SEPARATOR
MENUITEM "&LICENSE.txtを開く", ID_OPENLICENSE
MENUITEM SEPARATOR
MENUITEM "バージョン情報(&A)...", ID_ABOUT
Expand Down
1 change: 1 addition & 0 deletions src/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
#define ID_IDJUMP09 230
#define ID_SHOWLANGS 231
#define ID_SHOWHIDETOOLBAR 232
#define ID_OPENHYOJUNKA 233

#define IDD_REPLACERES 100
#define IDD_ADDICON 101
Expand Down

0 comments on commit 1488181

Please sign in to comment.