Skip to content

Commit 5015a94

Browse files
committed
Fix #77
1 parent 594a656 commit 5015a94

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

XgDictList.cpp

+31
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,36 @@ void XgDictList_ReloadList(HWND hwnd)
7171
item.iItem = iItem;
7272
item.iSubItem = 0;
7373
ListView_InsertItem(hwndLst1, &item);
74+
7475
item.iItem = iItem;
7576
item.iSubItem = 1;
7677
item.pszText = const_cast<LPWSTR>(entry.m_friendly_name.c_str());
7778
ListView_SetItem(hwndLst1, &item);
79+
80+
WIN32_FIND_DATAW find;
81+
HANDLE hFind = ::FindFirstFileW(entry.m_filename.c_str(), &find);
82+
::FindClose(hFind);
83+
84+
WCHAR szText[32];
85+
item.iItem = iItem;
86+
item.iSubItem = 2;
87+
if (hFind == INVALID_HANDLE_VALUE)
88+
{
89+
StringCchCopyW(szText, _countof(szText), L"N/A");
90+
}
91+
else
92+
{
93+
FILETIME ftLocal;
94+
::FileTimeToLocalFileTime(&find.ftLastWriteTime, &ftLocal);
95+
SYSTEMTIME st;
96+
::FileTimeToSystemTime(&ftLocal, &st);
97+
StringCchPrintfW(szText, _countof(szText), L"%04d-%02d-%02d",
98+
st.wYear, st.wMonth, st.wDay);
99+
item.pszText = szText;
100+
}
101+
item.pszText = szText;
102+
ListView_SetItem(hwndLst1, &item);
103+
78104
++iItem;
79105
}
80106

@@ -150,10 +176,15 @@ XgDictListDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
150176
column.pszText = XgLoadStringDx1(IDS_FILENAME);
151177
column.cx = 200;
152178
ListView_InsertColumn(hwndLst1, 0, &column);
179+
153180
column.pszText = XgLoadStringDx1(IDS_DISPLAYNAME);
154181
column.cx = 250;
155182
ListView_InsertColumn(hwndLst1, 1, &column);
156183

184+
column.pszText = XgLoadStringDx1(IDS_UPDATEDDATE);
185+
column.cx = 90;
186+
ListView_InsertColumn(hwndLst1, 2, &column);
187+
157188
// イメージリストを設定。
158189
HIMAGELIST himl = XgDictList_CreateRadioButtonImageList(hwnd);
159190
ListView_SetImageList(hwndLst1, himl, LVSIL_STATE);

lang/en_US.rc

+1
Original file line numberDiff line numberDiff line change
@@ -1824,6 +1824,7 @@ STRINGTABLE
18241824
IDS_FITWHOLE, "Fit whole"
18251825
IDS_FILENAME, "Filename"
18261826
IDS_DISPLAYNAME, "Display Name"
1827+
IDS_UPDATEDDATE, "Updated Date"
18271828
IDS_TT_NEW, "New crossword"
18281829
IDS_TT_GENERATE, "Generate crossword"
18291830
IDS_TT_OPEN, "Open crossword"

lang/ja_JP.rc

+1
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,7 @@ STRINGTABLE
18281828
IDS_FITWHOLE, "全体に合わせる"
18291829
IDS_FILENAME, "ファイル名"
18301830
IDS_DISPLAYNAME, "表示名"
1831+
IDS_UPDATEDDATE, "更新日"
18311832
IDS_TT_NEW, "新規作成"
18321833
IDS_TT_GENERATE, "問題を自動生成する"
18331834
IDS_TT_OPEN, "問題を開く"

resource.h

+1
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@
254254
#define IDS_FITWHOLE 331
255255
#define IDS_FILENAME 332
256256
#define IDS_DISPLAYNAME 333
257+
#define IDS_UPDATEDDATE 334
257258
#define IDS_TT_NEW 10100
258259
#define IDS_TT_GENERATE 10101
259260
#define IDS_TT_OPEN 10102

0 commit comments

Comments
 (0)