Skip to content

Commit

Permalink
5.1.3 and improve erasing settings
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Dec 25, 2023
1 parent 19ca58a commit 5af9179
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 29 deletions.
17 changes: 16 additions & 1 deletion GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,21 @@ bool __fastcall XgEraseSettings(void) noexcept
// レジストリのアプリキーを削除する。
RegDeleteTreeDx(HKEY_CURRENT_USER, s_pszSoftwareCompanyAndApp);

// 黒マスの情報も消す。
xg_strBlackCellImage.clear();
if (xg_hbmBlackCell) {
::DeleteObject(xg_hbmBlackCell);
xg_hbmBlackCell = nullptr;
}
if (xg_hBlackCellEMF) {
::DeleteEnhMetaFile(xg_hBlackCellEMF);
xg_hBlackCellEMF = nullptr;
}
XgGetFileManager().clear();

// 設定を読み直す。
XgLoadSettings();

return true;
}

Expand Down Expand Up @@ -6782,7 +6797,7 @@ void __fastcall MainWnd_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT /*codeNo
xg_hbmBlackCell = nullptr;
}
if (xg_hBlackCellEMF) {
DeleteEnhMetaFile(xg_hBlackCellEMF);
::DeleteEnhMetaFile(xg_hBlackCellEMF);
xg_hBlackCellEMF = nullptr;
}
// スケルトンビューを設定。
Expand Down
4 changes: 4 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@
- 2023-08-15 ver.5.1.2
- Improved Japanese dictionaries.
- Improved "Policy Preset" dialog. Improved policy descriptions.
- 2023-12-25 ver.5.1.3
- In "Initialize application", we decided to erase the block information.

# 開発履歴 (Japanese)

Expand Down Expand Up @@ -827,3 +829,5 @@
- 2023年08月15日 ver.5.1.2
- 日本語辞書の改良。
- 「ルール プリセット」ダイアログの改良。ルールの説明の改良。
- 2023年12月25日 ver.5.1.3
- 「アプリの初期化」において黒マスの情報も消す。
9 changes: 5 additions & 4 deletions Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ bool XG_FileManager::save_images(const std::unordered_set<std::wstring>& files)
m_path2contents.erase(target);
DeleteObject(m_path2hbm[target]);
m_path2hbm[target] = nullptr;
DeleteEnhMetaFile(m_path2hemf[target]);
::DeleteEnhMetaFile(m_path2hemf[target]);
m_path2hemf[target] = nullptr;
}

Expand All @@ -1191,6 +1191,7 @@ void XG_FileManager::convert()

void XG_FileManager::clear()
{
delete_handles();
*this = XG_FileManager();
}

Expand Down Expand Up @@ -1393,13 +1394,13 @@ void XG_FileManager::delete_handles() noexcept
{
for (auto& pair : m_path2hbm)
{
DeleteObject(pair.second);
::DeleteObject(pair.second);
}
m_path2hbm.clear();

for (auto& pair : m_path2hemf)
{
DeleteEnhMetaFile(pair.second);
::DeleteEnhMetaFile(pair.second);
}
m_path2hemf.clear();
}
Expand All @@ -1423,7 +1424,7 @@ bool XG_FileManager::load_block_image(const std::wstring& path)
{
DeleteObject(xg_hbmBlackCell);
xg_hbmBlackCell = nullptr;
DeleteEnhMetaFile(xg_hBlackCellEMF);
::DeleteEnhMetaFile(xg_hBlackCellEMF);
xg_hBlackCellEMF = nullptr;

if (path.empty())
Expand Down
2 changes: 1 addition & 1 deletion XG_PictureBoxDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class XG_PictureBoxDialog : public XG_Dialog
{
DeleteObject(m_hbm);
m_hbm = nullptr;
DeleteEnhMetaFile(m_hEMF);
::DeleteEnhMetaFile(m_hEMF);
m_hEMF = nullptr;
}

Expand Down
6 changes: 3 additions & 3 deletions XG_SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ void XG_SettingsDialog::UpdateBlockPreview(HWND hwnd)
SendMessageW(hIco2, STM_SETIMAGE, IMAGE_ENHMETAFILE, 0);
ShowWindow(hIco1, SW_SHOWNOACTIVATE);
DeleteObject(hbmOld);
DeleteEnhMetaFile(hOldEMF);
::DeleteEnhMetaFile(hOldEMF);
return;
}
if (hEMF1)
Expand All @@ -969,13 +969,13 @@ void XG_SettingsDialog::UpdateBlockPreview(HWND hwnd)
SendMessageW(hIco2, STM_SETIMAGE, IMAGE_ENHMETAFILE, reinterpret_cast<LPARAM>(hEMF1));
ShowWindow(hIco2, SW_SHOWNOACTIVATE);
DeleteObject(hbmOld);
DeleteEnhMetaFile(hOldEMF);
::DeleteEnhMetaFile(hOldEMF);
return;
}
}

SendDlgItemMessageW(hwnd, ico1, STM_SETIMAGE, IMAGE_BITMAP, 0);
SendDlgItemMessageW(hwnd, ico2, STM_SETIMAGE, IMAGE_ENHMETAFILE, 0);
DeleteObject(hbmOld);
DeleteEnhMetaFile(hOldEMF);
::DeleteEnhMetaFile(hOldEMF);
}
2 changes: 1 addition & 1 deletion installer32.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define APP_VERSION "5.1.2"
#define APP_VERSION "5.1.3"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
Expand Down
2 changes: 1 addition & 1 deletion installer64.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define APP_VERSION "5.1.2"
#define APP_VERSION "5.1.3"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
Expand Down
18 changes: 9 additions & 9 deletions lang/en_US.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1510,8 +1510,8 @@ FONT 9, "Tahoma"
// RT_VERSION

1 VERSIONINFO
FILEVERSION 5, 1, 2, 0
PRODUCTVERSION 5, 1, 2, 0
FILEVERSION 5, 1, 3, 0
PRODUCTVERSION 5, 1, 3, 0
FILEOS 0x40004
FILETYPE 0x1
FILESUBTYPE 0x0
Expand All @@ -1522,10 +1522,10 @@ FILESUBTYPE 0x0
{
VALUE "CompanyName", "Katayama Hirofumi MZ\0"
VALUE "FileDescription", "XWordGiver\0"
VALUE "FileVersion", "5.1.2\0"
VALUE "FileVersion", "5.1.3\0"
VALUE "LegalCopyright", "Copyright (C) 2012-2023 katahiromz. All rights reserved.\0"
VALUE "ProductName", "XWordGiver\0"
VALUE "ProductVersion", "5.1.2\0"
VALUE "ProductVersion", "5.1.3\0"
}
}
BLOCK "VarFileInfo"
Expand All @@ -1539,7 +1539,7 @@ FILESUBTYPE 0x0

STRINGTABLE
{
IDS_VERSION, "XWordGiver ver.5.1.2\nby katahiromz"
IDS_VERSION, "XWordGiver ver.5.1.3\nby katahiromz"
IDS_APPNAME, "XWordGiver"
IDS_CANTLOAD, "I couldn't load the file."
IDS_WRONGFORMAT, "This format is wrong."
Expand All @@ -1552,7 +1552,7 @@ STRINGTABLE
IDS_CANTACCEL, "I couldn't load the accelerators."
IDS_CANTREGWND, "I couldn't register the window classes."
IDS_CANTMAKEWND, "I couldn't create the window."
IDS_APPTITLE, "XWordGiver ver.5.1.2 - %s"
IDS_APPTITLE, "XWordGiver ver.5.1.3 - %s"
IDS_MADEPROBLEM, "I have generated a crossword.\n\nCalculation time: %u.%u[sec]"
IDS_CANTMAKEPROBLEM, "I couldn't create the puzzle.\n\nPlease confirm the dictionary, the block pattern, and the policy.\n\nCalculation time: %u.%u[sec]"
IDS_ENTERINT, "Please enter an integer between 2 and 256."
Expand All @@ -1571,7 +1571,7 @@ STRINGTABLE
IDS_NOWSOLVING, "Calculating...(%u.%u sec) %u Retrial(s)"
IDS_HLINE, "----------------------------"
IDS_MONOFONT, "MS ゴシック"
IDS_APPTITLE2, "XWordGiver ver.5.1.2 (%s) - %s"
IDS_APPTITLE2, "XWordGiver ver.5.1.3 (%s) - %s"
IDS_CROSSWORD, "Crossword"
IDS_ANSWER, "Answer: "
IDS_SETPORTRAIT, "Please use the portrait paper to print."
Expand Down Expand Up @@ -1635,8 +1635,8 @@ STRINGTABLE
IDS_VINPUT, "Vert"
IDS_ABC, "ABC"
IDS_DICTIONARY, "Dict"
IDS_APPINFO, "XWordGiver ver.5.1.2"
IDS_APPINFO2, "XWordGiver ver.5.1.2 (%s)"
IDS_APPINFO, "XWordGiver ver.5.1.3"
IDS_APPINFO2, "XWordGiver ver.5.1.3 (%s)"
IDS_HINPUT2, "H\no\nr\nz"
IDS_VINPUT2, "V\ne\nr\nt"
IDS_KANA, "Kana"
Expand Down
18 changes: 9 additions & 9 deletions lang/ja_JP.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1513,8 +1513,8 @@ FONT 9, "MS UI Gothic"
// RT_VERSION

1 VERSIONINFO
FILEVERSION 5, 1, 2, 0
PRODUCTVERSION 5, 1, 2, 0
FILEVERSION 5, 1, 3, 0
PRODUCTVERSION 5, 1, 3, 0
FILEOS 0x40004
FILETYPE 0x1
FILESUBTYPE 0x0
Expand All @@ -1525,10 +1525,10 @@ FILESUBTYPE 0x0
{
VALUE "CompanyName", "片山博文MZ\0"
VALUE "FileDescription", "クロスワード ギバー\0"
VALUE "FileVersion", "5.1.2\0"
VALUE "FileVersion", "5.1.3\0"
VALUE "LegalCopyright", "Copyright (C) 2012-2023 片山博文MZ. All rights reserved.\0"
VALUE "ProductName", "XWordGiver\0"
VALUE "ProductVersion", "5.1.2\0"
VALUE "ProductVersion", "5.1.3\0"
}
}
BLOCK "VarFileInfo"
Expand All @@ -1542,7 +1542,7 @@ FILESUBTYPE 0x0

STRINGTABLE
{
IDS_VERSION, "クロスワード ギバー ver.5.1.2\nby 片山博文MZ"
IDS_VERSION, "クロスワード ギバー ver.5.1.3\nby 片山博文MZ"
IDS_APPNAME, "クロスワード ギバー"
IDS_CANTLOAD, "ファイルが読み込めません。"
IDS_WRONGFORMAT, "形式が間違っています。"
Expand All @@ -1555,7 +1555,7 @@ STRINGTABLE
IDS_CANTACCEL, "アクセラレータの読み込みに失敗しました。"
IDS_CANTREGWND, "ウィンドウクラスの登録に失敗しました。"
IDS_CANTMAKEWND, "ウィンドウ作成に失敗しました。"
IDS_APPTITLE, "クロスワード ギバー ver.5.1.2 - %s"
IDS_APPTITLE, "クロスワード ギバー ver.5.1.3 - %s"
IDS_MADEPROBLEM, "問題を作成しました。\n\n計算時間: %u.%u[秒]"
IDS_CANTMAKEPROBLEM, "問題を作成できませんでした。\n\n辞書の設定や黒マスの配置やルールを確認して下さい。\n\n計算時間: %u.%u[秒]"
IDS_ENTERINT, "2以上256以下の整数を入力して下さい。"
Expand All @@ -1574,7 +1574,7 @@ STRINGTABLE
IDS_NOWSOLVING, "計算しています...(%u.%u秒経過) %u 回目の再試行"
IDS_HLINE, "――――――――――――――"
IDS_MONOFONT, "MS ゴシック"
IDS_APPTITLE2, "クロスワード ギバー ver.5.1.2 (%s) - %s"
IDS_APPTITLE2, "クロスワード ギバー ver.5.1.3 (%s) - %s"
IDS_CROSSWORD, "クロスワード"
IDS_ANSWER, "答え:"
IDS_SETPORTRAIT, "縦長の用紙設定で印刷して下さい。"
Expand Down Expand Up @@ -1638,8 +1638,8 @@ STRINGTABLE
IDS_VINPUT, "タテ入力"
IDS_ABC, "英字"
IDS_DICTIONARY, "辞書"
IDS_APPINFO, "クロスワード ギバー ver.5.1.2"
IDS_APPINFO2, "クロスワード ギバー ver.5.1.2 (%s)"
IDS_APPINFO, "クロスワード ギバー ver.5.1.3"
IDS_APPINFO2, "クロスワード ギバー ver.5.1.3 (%s)"
IDS_HINPUT2, "ヨコ\n入\n力"
IDS_VINPUT2, "タテ\n入\n力"
IDS_KANA, "カナ"
Expand Down

0 comments on commit 5af9179

Please sign in to comment.