Skip to content

Commit

Permalink
enable double-frame letters setting
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Nov 2, 2021
1 parent f81e58f commit a0d165e
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 8 deletions.
22 changes: 22 additions & 0 deletions GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ BOOL xg_bShowNumbering = TRUE;
// �L�����b�g��\�����邩�H
BOOL xg_bShowCaret = TRUE;

// ��d�}�X�����B
std::wstring xg_strDoubleFrameLetters;

//////////////////////////////////////////////////////////////////////////////
// static variables

Expand Down Expand Up @@ -637,6 +640,8 @@ bool __fastcall XgLoadSettings(void)

xg_nViewMode = XG_VIEW_NORMAL;

xg_strDoubleFrameLetters = XgLoadStringDx1(IDS_DBLFRAME_LETTERS_1);

// ����L�[���J���B
MRegKey company_key(HKEY_CURRENT_USER, s_pszSoftwareCompanyName, FALSE);
if (company_key) {
Expand Down Expand Up @@ -840,6 +845,10 @@ bool __fastcall XgLoadSettings(void)
}
}

if (!app_key.QuerySz(L"DoubleFrameLetters", sz, ARRAYSIZE(sz))) {
xg_strDoubleFrameLetters = sz;
}

// �ۑ���̃��X�g���擾����B
if (!app_key.QueryDword(L"SaveToCount", dwValue)) {
nDirCount = dwValue;
Expand Down Expand Up @@ -950,6 +959,7 @@ bool __fastcall XgSaveSettings(void)

app_key.SetSz(L"Recent", xg_dict_name.c_str());
app_key.SetSz(L"BlackCellImage", xg_strBlackCellImage.c_str());
app_key.SetSz(L"DoubleFrameLetters", xg_strDoubleFrameLetters.c_str());

// �ۑ���̃��X�g��ݒ肷��B
nCount = static_cast<int>(s_dirs_save_to.size());
Expand Down Expand Up @@ -5365,6 +5375,13 @@ BOOL SettingsDlg_OnInitDialog(HWND hwnd)
ComboBox_SetCurSel(hCmb1, ComboBox_FindStringExact(hCmb1, -1, psz));
}

// ��d�}�X�����B
HWND hCmb2 = GetDlgItem(hwnd, cmb2);
for (INT i = IDS_DBLFRAME_LETTERS_1; i <= IDS_DBLFRAME_LETTERS_6; ++i) {
ComboBox_AddString(hCmb2, XgLoadStringDx1(i));
}
ComboBox_SetText(hCmb2, xg_strDoubleFrameLetters.c_str());

UpdateBlockPreview(hwnd);

return TRUE;
Expand Down Expand Up @@ -5501,6 +5518,11 @@ void SettingsDlg_OnOK(HWND hwnd)
::PostMessageW(xg_hHintsWnd, WM_SIZE, 0, 0);
}

// ��d�}�X�����B
WCHAR szText[MAX_PATH];
ComboBox_GetText(GetDlgItem(hwnd, cmb2), szText, _countof(szText));
xg_strDoubleFrameLetters = szText;

// �C���[�W���X�V����B
int x = XgGetHScrollPos();
int y = XgGetVScrollPos();
Expand Down
2 changes: 2 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
対称のルールのときに「解を求める(黒マス追加なし)」で盤を対称にするようにした。
最大単語長周りを修正。
「skeleton」のtypoを修正。
「二重マス文字」の指定が可能に。

## History of XWordGiver (English)

Expand Down Expand Up @@ -471,3 +472,4 @@
- When the policy is symmetrical, "Finding solution (without adding blocks)" forces the board symmetrical.
- Fixed around Max Word Length.
- Fixed typo of skeleton.
- Enabled the "double-frame letters" settings.
14 changes: 11 additions & 3 deletions lang/en_US.rc
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ FONT 9, "Tahoma"
PUSHBUTTON "Cancel", IDCANCEL, 240, 135, 60, 14
}

IDD_CONFIG DIALOG 0, 0, 274, 211
IDD_CONFIG DIALOG 0, 0, 274, 250
CAPTION "Configuration"
STYLE DS_CENTER | DS_MODALFRAME | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 9, "Tahoma"
Expand Down Expand Up @@ -600,11 +600,13 @@ FONT 9, "Tahoma"
PUSHBUTTON "Reset", psh11, 209, 140, 35, 14
LTEXT "Block i&mage:", -1, 5, 166, 52, 11
COMBOBOX cmb1, 60, 165, 102, 300, CBS_HASSTRINGS | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK", IDOK, 145, 192, 60, 14
PUSHBUTTON "Cancel", IDCANCEL, 210, 192, 60, 14
LTEXT "Please drop your favorite square image into the BLOCK folder in BMP/EMF format.", -1, 5, 182, 138, 21
CONTROL "", ico1, "STATIC", SS_BITMAP, 165, 165, 20, 20
CONTROL "", ico2, "STATIC", SS_ENHMETAFILE, 165, 165, 20, 20
RTEXT "&Double-frame letters:", -1, 5, 212, 80, 12
COMBOBOX cmb2, 90, 210, 180, 300, CBS_HASSTRINGS | CBS_AUTOHSCROLL | CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK", IDOK, 145, 230, 60, 14
PUSHBUTTON "Cancel", IDCANCEL, 210, 230, 60, 14
}

IDD_SEQSOLVE DIALOG 0, 0, 310, 80
Expand Down Expand Up @@ -1468,6 +1470,12 @@ STRINGTABLE
IDS_SHALLIMIRROR, "Shall I make the block pattern symmetrical according to the specified policy?"
IDS_EVENROWLINESYMV, "Forcing symmetrical even rows and banning adjacent blocks is unreasonable. Please reconfirm the policies."
IDS_EVENCOLLINESYMH, "Forcing symmetrical even columns and banning adjacent blocks is unreasonable. Please reconfirm the policies."
IDS_DBLFRAME_LETTERS_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
IDS_DBLFRAME_LETTERS_2, "αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"
IDS_DBLFRAME_LETTERS_3, "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん"
IDS_DBLFRAME_LETTERS_4, "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン"
IDS_DBLFRAME_LETTERS_5, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせすん"
IDS_DBLFRAME_LETTERS_6, "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセスン"
IDS_TT_NEW, "New crossword"
IDS_TT_GENERATE, "Generate crossword"
IDS_TT_OPEN, "Open crossword"
Expand Down
14 changes: 11 additions & 3 deletions lang/ja_JP.rc
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ FONT 9, "MS UI Gothic"
PUSHBUTTON "キャンセル", IDCANCEL, 240, 135, 60, 14
}

IDD_CONFIG DIALOG 0, 0, 274, 211
IDD_CONFIG DIALOG 0, 0, 274, 250
CAPTION "クロスワード ギバーの設定"
STYLE DS_CENTER | DS_MODALFRAME | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 9, "MS UI Gothic"
Expand Down Expand Up @@ -603,11 +603,13 @@ FONT 9, "MS UI Gothic"
PUSHBUTTON "リセット", psh11, 209, 140, 35, 14
LTEXT "黒マス画像(&M):", -1, 5, 166, 52, 11
COMBOBOX cmb1, 60, 165, 102, 300, CBS_HASSTRINGS | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK", IDOK, 145, 192, 60, 14
PUSHBUTTON "キャンセル", IDCANCEL, 210, 192, 60, 14
LTEXT "BLOCKフォルダに好きな正方形の画像をBMP/EMF形式で放り込んで下さい。", -1, 10, 182, 128, 21
CONTROL "", ico1, "STATIC", SS_BITMAP, 165, 165, 20, 20
CONTROL "", ico2, "STATIC", SS_ENHMETAFILE, 165, 165, 20, 20
RTEXT "二重マス文字(&D):", -1, 5, 212, 80, 12
COMBOBOX cmb2, 90, 210, 180, 300, CBS_HASSTRINGS | CBS_AUTOHSCROLL | CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "OK", IDOK, 145, 230, 60, 14
PUSHBUTTON "キャンセル", IDCANCEL, 210, 230, 60, 14
}

IDD_SEQSOLVE DIALOG 0, 0, 310, 80
Expand Down Expand Up @@ -1471,6 +1473,12 @@ STRINGTABLE
IDS_SHALLIMIRROR, "指定されたルールに従って黒マスパターンを対称にしますか?"
IDS_EVENROWLINESYMV, "偶数行数でタテ線対称で連黒禁は不可です。ルールを再確認して下さい。"
IDS_EVENCOLLINESYMH, "偶数列数でヨコ線対称で連黒禁は不可です。ルールを再確認して下さい。"
IDS_DBLFRAME_LETTERS_1, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
IDS_DBLFRAME_LETTERS_2, "αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ"
IDS_DBLFRAME_LETTERS_3, "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをん"
IDS_DBLFRAME_LETTERS_4, "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン"
IDS_DBLFRAME_LETTERS_5, "いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせすん"
IDS_DBLFRAME_LETTERS_6, "イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセスン"
IDS_TT_NEW, "新規作成"
IDS_TT_GENERATE, "問題を自動生成する"
IDS_TT_OPEN, "問題を開く"
Expand Down
6 changes: 6 additions & 0 deletions resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@
#define IDS_SHALLIMIRROR 260
#define IDS_EVENROWLINESYMV 261
#define IDS_EVENCOLLINESYMH 262
#define IDS_DBLFRAME_LETTERS_1 263
#define IDS_DBLFRAME_LETTERS_2 264
#define IDS_DBLFRAME_LETTERS_3 265
#define IDS_DBLFRAME_LETTERS_4 266
#define IDS_DBLFRAME_LETTERS_5 267
#define IDS_DBLFRAME_LETTERS_6 268
#define IDS_TT_NEW 10100
#define IDS_TT_GENERATE 10101
#define IDS_TT_OPEN 10102
Expand Down
10 changes: 8 additions & 2 deletions xword.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3631,7 +3631,10 @@ void __fastcall XgDrawMarkWord(HDC hdc, LPSIZE psiz)
}
::InflateRect(&rc, 4, 4);

StringCbPrintf(sz, sizeof(sz), L"%c", ZEN_LARGE_A + i);
if (i < (INT)xg_strDoubleFrameLetters.size())
StringCbPrintf(sz, sizeof(sz), L"%c", xg_strDoubleFrameLetters[i]);
else
StringCbPrintf(sz, sizeof(sz), L"%c", ZEN_BLACK);
::GetTextExtentPoint32W(hdc, sz, int(wcslen(sz)), &siz);

RECT rcText = rc;
Expand Down Expand Up @@ -3892,7 +3895,10 @@ void __fastcall XgDrawXWord_NormalView(XG_Board& xw, HDC hdc, LPSIZE psiz, bool
::InflateRect(&rc, 4, 4);
}

StringCbPrintf(sz, sizeof(sz), L"%c", L'A' + nMarked);
if (nMarked < (INT)xg_strDoubleFrameLetters.size())
StringCbPrintf(sz, sizeof(sz), L"%c", xg_strDoubleFrameLetters[nMarked]);
else
StringCbPrintf(sz, sizeof(sz), L"%c", ZEN_BLACK);

// ��d�}�X�̉E���[�̕����̔w�i��h��‚Ԃ��B
RECT rcText;
Expand Down
2 changes: 2 additions & 0 deletions xword.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,8 @@ inline BOOL XgIsUserJapanese(VOID)
extern BOOL xg_bShowNumbering;
// �L�����b�g��\�����邩�H
extern BOOL xg_bShowCaret;
// ��d�}�X�����B
extern std::wstring xg_strDoubleFrameLetters;

//////////////////////////////////////////////////////////////////////////////

Expand Down

0 comments on commit a0d165e

Please sign in to comment.