Skip to content

Commit

Permalink
Fix #53
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Apr 2, 2024
1 parent 197c7bc commit aee1e30
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 34 deletions.
45 changes: 28 additions & 17 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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*/)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -916,3 +917,4 @@
- 「問題を生成したら自動で連番保存」設定を追加。
- 2024年XX月YY日 ver.5.2.1
- 右クリックメニューに「全体に合わせる」を追加。
- ツールバーやステータスバーの右クリックに対応。
17 changes: 9 additions & 8 deletions lang/en_US.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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
}
Expand Down
20 changes: 11 additions & 9 deletions lang/ja_JP.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aee1e30

Please sign in to comment.