diff --git a/GUI.cpp b/GUI.cpp index e35ba37..a205e72 100644 --- a/GUI.cpp +++ b/GUI.cpp @@ -5695,6 +5695,28 @@ void __fastcall XgJumpNumber(HWND hwnd, INT nNumber, BOOL bVert) SetFocus(hwnd); } +// ジャンプダイアログ。 +void XgJumpDialog(HWND hwnd) +{ + XG_JumpDialog dialog; + if (dialog.DoModal(hwnd) == IDOK) { + switch (dialog.m_nType) { + case 0: // マス位置。 + xg_caret_pos.m_j = dialog.m_jCol - 1; + xg_caret_pos.m_i = dialog.m_iRow - 1; + // 表示を更新する。 + XgEnsureCaretVisible(hwnd); + XgUpdateStatusBar(hwnd); + // すぐに入力できるようにする。 + SetFocus(hwnd); + break; + case 1: // カギ位置。 + XgJumpNumber(hwnd, dialog.m_nNumber, dialog.m_bVert); + break; + } + } +} + // コマンドを実行する。 void __fastcall MainWnd_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT /*codeNotify*/) { @@ -6966,6 +6988,11 @@ void __fastcall MainWnd_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT /*codeNo bUpdateImage = TRUE; break; + case ID_JUMP: + // ジャンプ。 + XgJumpDialog(hwnd); + break; + default: if (!XgOnCommandExtra(hwnd, id)) { ::MessageBeep(0xFFFFFFFF); @@ -7315,23 +7342,7 @@ void MainWnd_OnNotify(HWND hwnd, int idCtrl, LPNMHDR pnmh) noexcept { if (pnmh->code == NM_DBLCLK && idCtrl == IDW_STATUSBAR) { // ステータスバーがダブルクリックされた。 - XG_JumpDialog dialog; - if (dialog.DoModal(hwnd) == IDOK) { - switch (dialog.m_nType) { - case 0: // マス位置。 - xg_caret_pos.m_j = dialog.m_jCol - 1; - xg_caret_pos.m_i = dialog.m_iRow - 1; - // 表示を更新する。 - XgEnsureCaretVisible(hwnd); - XgUpdateStatusBar(hwnd); - // すぐに入力できるようにする。 - SetFocus(hwnd); - break; - case 1: // カギ位置。 - XgJumpNumber(hwnd, dialog.m_nNumber, dialog.m_bVert); - break; - } - } + XgJumpDialog(hwnd); return; } diff --git a/HISTORY.txt b/HISTORY.txt index f0cc90e..8e37e7c 100644 --- a/HISTORY.txt +++ b/HISTORY.txt @@ -300,6 +300,7 @@ - Added "Automatically save as numbering file when generated" setting. - 2024-XX-YY ver.5.2.1 - Added "Fit whole" to Right-click menu. + - Supported right-click on toolbar and status bar. # 開発履歴 (Japanese) @@ -916,3 +917,4 @@ - 「問題を生成したら自動で連番保存」設定を追加。 - 2024年XX月YY日 ver.5.2.1 - 右クリックメニューに「全体に合わせる」を追加。 + - ツールバーやステータスバーの右クリックに対応。 diff --git a/lang/en_US.rc b/lang/en_US.rc index 543e4d8..4b3abb4 100644 --- a/lang/en_US.rc +++ b/lang/en_US.rc @@ -561,6 +561,8 @@ IDB_DELETEPAT BITMAP "res/1033_Bitmap_102.bmp" { MENUITEM "&Toolbar", ID_TOOLBAR MENUITEM "&Status bar", ID_STATUS + MENUITEM SEPARATOR + MENUITEM "&Jump...", ID_JUMP } } @@ -1494,17 +1496,16 @@ FONT 9, "Tahoma" { AUTORADIOBUTTON "Jump to &position", rad1, 10, 10, 90, 15, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "Jump to &clue", rad2, 10, 60, 90, 15, WS_TABSTOP - RTEXT "(", -1, 40, 40, 10, 10 - EDITTEXT edt1, 55, 35, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT - CONTROL "", scr1, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 101, 24, 12, 20 - RTEXT ",", -1, 90, 40, 15, 10 + EDITTEXT edt1, 20, 35, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT + CONTROL "", scr1, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 40, 35, 10, 20 + LTEXT "th from left", -1, 55, 40, 45, 10 EDITTEXT edt2, 110, 35, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT - CONTROL "", scr2, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 101, 24, 12, 20 - LTEXT ")", -1, 145, 40, 15, 10 + CONTROL "", scr2, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 100, 25, 10, 20 + LTEXT "th from top", -1, 145, 40, 45, 10 AUTORADIOBUTTON "&Across", rad3, 25, 85, 40, 15, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "&Down", rad4, 75, 85, 35, 15, WS_TABSTOP - EDITTEXT edt3, 119, 85, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT - CONTROL "", scr3, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 101, 24, 12, 20 + EDITTEXT edt3, 120, 85, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT + CONTROL "", scr3, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 100, 25, 10, 20 DEFPUSHBUTTON "&Jump", IDOK, 65, 115, 60, 15 PUSHBUTTON "Cancel", IDCANCEL, 130, 115, 60, 15 } diff --git a/lang/ja_JP.rc b/lang/ja_JP.rc index c665fe2..1674d4f 100644 --- a/lang/ja_JP.rc +++ b/lang/ja_JP.rc @@ -564,6 +564,8 @@ IDB_DELETEPAT BITMAP "res/1041_Bitmap_102.bmp" { MENUITEM "ツール バー(&T)", ID_TOOLBAR MENUITEM "ステータス バー(&S)", ID_STATUS + MENUITEM SEPARATOR + MENUITEM "ジャンプ(&J)...", ID_JUMP } } @@ -1497,17 +1499,17 @@ FONT 9, "MS UI Gothic" { AUTORADIOBUTTON "指定位置にジャンプ(&P)", rad1, 10, 10, 90, 15, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "カギにジャンプ(&C)", rad2, 10, 60, 90, 15, WS_TABSTOP - RTEXT "(", -1, 40, 40, 10, 10 - EDITTEXT edt1, 55, 35, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT - CONTROL "", scr1, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 101, 24, 12, 20 - RTEXT ",", -1, 90, 40, 15, 10 - EDITTEXT edt2, 110, 35, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT - CONTROL "", scr2, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 101, 24, 12, 20 - LTEXT ")", -1, 145, 40, 15, 10 + RTEXT "左から", -1, 10, 40, 30, 10 + EDITTEXT edt1, 50, 35, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT + CONTROL "", scr1, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 70, 35, 10, 20 + LTEXT "番目、右から", -1, 85, 40, 40, 10 + EDITTEXT edt2, 130, 35, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT + CONTROL "", scr2, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 100, 25, 10, 20 + LTEXT "番目", -1, 165, 40, 20, 10 AUTORADIOBUTTON "ヨコ(&A)", rad3, 25, 85, 40, 15, WS_GROUP | WS_TABSTOP AUTORADIOBUTTON "タテ(&D)", rad4, 75, 85, 35, 15, WS_TABSTOP - EDITTEXT edt3, 119, 85, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT - CONTROL "", scr3, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 101, 24, 12, 20 + EDITTEXT edt3, 120, 85, 30, 15, ES_NUMBER | ES_AUTOHSCROLL | ES_RIGHT + CONTROL "", scr3, "msctls_updown32", UDS_ARROWKEYS | UDS_AUTOBUDDY | UDS_ALIGNRIGHT | UDS_SETBUDDYINT, 100, 25, 10, 20 DEFPUSHBUTTON "ジャンプ", IDOK, 65, 115, 60, 15 PUSHBUTTON "キャンセル", IDCANCEL, 130, 115, 60, 15 } diff --git a/resource.h b/resource.h index 89539fb..c3cdb8e 100644 --- a/resource.h +++ b/resource.h @@ -508,6 +508,7 @@ #define ID_GENERALSETTINGS 605 #define ID_NUMBERINGSAVE 606 #define ID_VIEW_DOUBLEFRAME 607 +#define ID_JUMP 608 #define ID_TT_BASE 10000 #define ctl2 1185