Skip to content

Commit 4197a5e

Browse files
committed
add jump feature 6
1 parent 0465267 commit 4197a5e

File tree

1 file changed

+20
-22
lines changed

1 file changed

+20
-22
lines changed

XG_JumpDialog.hpp

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ class XG_JumpDialog : public XG_Dialog
1919
{
2020
if (!xg_bSolved) {
2121
m_nType = 0;
22-
m_nNumber = 1;
2322
}
2423

2524
if (m_nType == 0) {
@@ -29,20 +28,18 @@ class XG_JumpDialog : public XG_Dialog
2928
EnableWindow(GetDlgItem(hwnd, rad3), FALSE);
3029
EnableWindow(GetDlgItem(hwnd, rad4), FALSE);
3130
CheckRadioButton(hwnd, rad1, rad2, rad1);
31+
SetDlgItemInt(hwnd, edt1, m_jCol, FALSE);
32+
SetDlgItemInt(hwnd, edt2, m_iRow, FALSE);
3233
} else {
3334
EnableWindow(GetDlgItem(hwnd, edt1), FALSE);
3435
EnableWindow(GetDlgItem(hwnd, edt2), FALSE);
3536
EnableWindow(GetDlgItem(hwnd, edt3), TRUE);
3637
EnableWindow(GetDlgItem(hwnd, rad3), TRUE);
3738
EnableWindow(GetDlgItem(hwnd, rad4), TRUE);
3839
CheckRadioButton(hwnd, rad1, rad2, rad2);
40+
SetDlgItemInt(hwnd, edt3, m_nNumber, FALSE);
41+
CheckRadioButton(hwnd, rad3, rad4, (m_bVert ? rad4 : rad3));
3942
}
40-
41-
CheckRadioButton(hwnd, rad3, rad4, (m_bVert ? rad4 : rad3));
42-
43-
SetDlgItemInt(hwnd, edt1, m_jCol, FALSE);
44-
SetDlgItemInt(hwnd, edt2, m_iRow, FALSE);
45-
SetDlgItemInt(hwnd, edt3, m_nNumber, FALSE);
4643
}
4744

4845
BOOL OnOK(HWND hwnd)
@@ -54,20 +51,23 @@ class XG_JumpDialog : public XG_Dialog
5451
m_nNumber = GetDlgItemInt(hwnd, edt3, NULL, FALSE);
5552

5653
INT nFixed = 0;
57-
if (m_jCol <= 0) {
58-
m_jCol = 1;
59-
nFixed = edt1;
60-
} else if (m_jCol > xg_nCols) {
61-
m_jCol = xg_nCols;
62-
nFixed = edt1;
63-
}
6454

65-
if (m_iRow <= 0) {
66-
m_iRow = 1;
67-
nFixed = edt2;
68-
} else if (m_iRow > xg_nRows) {
69-
m_iRow = xg_nRows;
70-
nFixed = edt2;
55+
if (m_nType == 0) {
56+
if (m_jCol <= 0) {
57+
m_jCol = 1;
58+
nFixed = edt1;
59+
} else if (m_jCol > xg_nCols) {
60+
m_jCol = xg_nCols;
61+
nFixed = edt1;
62+
}
63+
64+
if (m_iRow <= 0) {
65+
m_iRow = 1;
66+
nFixed = edt2;
67+
} else if (m_iRow > xg_nRows) {
68+
m_iRow = xg_nRows;
69+
nFixed = edt2;
70+
}
7171
}
7272

7373
if (m_nType == 1) {
@@ -109,8 +109,6 @@ class XG_JumpDialog : public XG_Dialog
109109
nFixed = edt3;
110110
}
111111
}
112-
} else {
113-
m_nNumber = 1;
114112
}
115113

116114
if (nFixed) {

0 commit comments

Comments
 (0)