Skip to content

Commit

Permalink
improve file settings
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Apr 2, 2024
1 parent 0ad74ec commit 3265131
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
20 changes: 20 additions & 0 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5616,16 +5616,20 @@ FileSettingsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch (uMsg)
{
case WM_INITDIALOG:
// チェックボックスを初期化。
if (xg_bShowAnswerOnOpen)
CheckDlgButton(hwnd, chx1, BST_CHECKED);
if (xg_bAutoSave)
CheckDlgButton(hwnd, chx2, BST_CHECKED);
if (xg_bShowAnswerOnGenerate)
CheckDlgButton(hwnd, chx3, BST_CHECKED);
// 保存先を初期化。
for (const auto& dir : xg_dirs_save_to) {
SendDlgItemMessage(hwnd, cmb1, CB_ADDSTRING, 0, (LPARAM)dir.c_str());
}
SendDlgItemMessage(hwnd, cmb1, CB_SETCURSEL, 0, 0);
// ドラッグ&ドロップを受け付ける。
DragAcceptFiles(hwnd, TRUE);
return TRUE;

case WM_COMMAND:
Expand Down Expand Up @@ -5664,6 +5668,22 @@ FileSettingsDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
}
}
break;
case psh2: // 「フォルダを開く」ボタン。
::GetDlgItemTextW(hwnd, cmb1, xg_szDir, _countof(xg_szDir));
::ShellExecuteW(hwnd, NULL, xg_szDir, NULL, NULL, SW_SHOWNORMAL);
break;
}
break;

case WM_DROPFILES:
{
HDROP hDrop = (HDROP)wParam;
DragQueryFileW(hDrop, 0, xg_szDir, _countof(xg_szDir));
if (PathIsDirectoryW(xg_szDir))
{
::SetDlgItemTextW(hwnd, cmb1, xg_szDir);
PropSheet_Changed(GetParent(hwnd), hwnd);
}
}
break;

Expand Down
3 changes: 2 additions & 1 deletion lang/en_US.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,8 @@ FONT 9, "Tahoma"
AUTOCHECKBOX "Automatically save as &numbering file when generated", chx2, 10, 60, 195, 15
LTEXT "Numbering &save in:", -1, 10, 85, 195, 10
COMBOBOX cmb1, 10, 100, 195, 300, CBS_HASSTRINGS | CBS_AUTOHSCROLL | CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "&Browse...", psh1, 145, 120, 60, 15
PUSHBUTTON "&Browse...", psh1, 10, 115, 60, 15
PUSHBUTTON "Open &Folder", psh2, 110, 115, 95, 15
}

//////////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 2 additions & 1 deletion lang/ja_JP.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1519,7 +1519,8 @@ FONT 9, "MS UI Gothic"
AUTOCHECKBOX "問題を生成したら自動で連番保存する(&N)", chx2, 10, 60, 195, 15
LTEXT "連番ファイル保存先(&S):", -1, 10, 85, 195, 10
COMBOBOX cmb1, 10, 100, 195, 300, CBS_HASSTRINGS | CBS_AUTOHSCROLL | CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "参照(&B)...", psh1, 145, 120, 60, 15
PUSHBUTTON "参照(&B)...", psh1, 10, 115, 60, 15
PUSHBUTTON "フォルダを開く(&F)", psh2, 110, 115, 95, 15
}

//////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 3265131

Please sign in to comment.