Skip to content

Commit

Permalink
Fix #77
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Apr 18, 2024
1 parent 594a656 commit 5015a94
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
31 changes: 31 additions & 0 deletions XgDictList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,36 @@ void XgDictList_ReloadList(HWND hwnd)
item.iItem = iItem;
item.iSubItem = 0;
ListView_InsertItem(hwndLst1, &item);

item.iItem = iItem;
item.iSubItem = 1;
item.pszText = const_cast<LPWSTR>(entry.m_friendly_name.c_str());
ListView_SetItem(hwndLst1, &item);

WIN32_FIND_DATAW find;
HANDLE hFind = ::FindFirstFileW(entry.m_filename.c_str(), &find);
::FindClose(hFind);

WCHAR szText[32];
item.iItem = iItem;
item.iSubItem = 2;
if (hFind == INVALID_HANDLE_VALUE)
{
StringCchCopyW(szText, _countof(szText), L"N/A");
}
else
{
FILETIME ftLocal;
::FileTimeToLocalFileTime(&find.ftLastWriteTime, &ftLocal);
SYSTEMTIME st;
::FileTimeToSystemTime(&ftLocal, &st);
StringCchPrintfW(szText, _countof(szText), L"%04d-%02d-%02d",
st.wYear, st.wMonth, st.wDay);
item.pszText = szText;
}
item.pszText = szText;
ListView_SetItem(hwndLst1, &item);

++iItem;
}

Expand Down Expand Up @@ -150,10 +176,15 @@ XgDictListDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
column.pszText = XgLoadStringDx1(IDS_FILENAME);
column.cx = 200;
ListView_InsertColumn(hwndLst1, 0, &column);

column.pszText = XgLoadStringDx1(IDS_DISPLAYNAME);
column.cx = 250;
ListView_InsertColumn(hwndLst1, 1, &column);

column.pszText = XgLoadStringDx1(IDS_UPDATEDDATE);
column.cx = 90;
ListView_InsertColumn(hwndLst1, 2, &column);

// イメージリストを設定。
HIMAGELIST himl = XgDictList_CreateRadioButtonImageList(hwnd);
ListView_SetImageList(hwndLst1, himl, LVSIL_STATE);
Expand Down
1 change: 1 addition & 0 deletions lang/en_US.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1824,6 +1824,7 @@ STRINGTABLE
IDS_FITWHOLE, "Fit whole"
IDS_FILENAME, "Filename"
IDS_DISPLAYNAME, "Display Name"
IDS_UPDATEDDATE, "Updated Date"
IDS_TT_NEW, "New crossword"
IDS_TT_GENERATE, "Generate crossword"
IDS_TT_OPEN, "Open crossword"
Expand Down
1 change: 1 addition & 0 deletions lang/ja_JP.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1828,6 +1828,7 @@ STRINGTABLE
IDS_FITWHOLE, "全体に合わせる"
IDS_FILENAME, "ファイル名"
IDS_DISPLAYNAME, "表示名"
IDS_UPDATEDDATE, "更新日"
IDS_TT_NEW, "新規作成"
IDS_TT_GENERATE, "問題を自動生成する"
IDS_TT_OPEN, "問題を開く"
Expand Down
1 change: 1 addition & 0 deletions resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@
#define IDS_FITWHOLE 331
#define IDS_FILENAME 332
#define IDS_DISPLAYNAME 333
#define IDS_UPDATEDDATE 334
#define IDS_TT_NEW 10100
#define IDS_TT_GENERATE 10101
#define IDS_TT_OPEN 10102
Expand Down

0 comments on commit 5015a94

Please sign in to comment.