From 79d4fa6d9a79295b747eedcc17b4de6ccdde7e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Wed, 20 Jul 2022 02:30:50 +0200 Subject: Fix ANSI compatibility. It's not very useful, but it's a fun exercise. --- c/datalistview.cpp | 4 ++-- c/episodelistview.cpp | 8 ++++---- c/listview.cpp | 2 ++ 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'c') diff --git a/c/datalistview.cpp b/c/datalistview.cpp index 517a055..eace820 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -18,13 +18,13 @@ DataListView::DataListView(const HWND hWndParent) lvc.mask = LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM; lvc.iSubItem = DLVSIKEY; - lvc.pszText = TEXT("Key"); + lvc.pszText = (TCHAR*)TEXT("Key"); lvc.cx = Dpi(42); ListView_InsertColumn(hWnd, DLVSIKEY, &lvc); lvc.iSubItem = DLVSIVALUE; - lvc.pszText = TEXT("Value"); + lvc.pszText = (TCHAR*)TEXT("Value"); lvc.cx = 500; ListView_InsertColumn(hWnd, DLVSIVALUE, &lvc); } diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index 6ed9146..5df33a1 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -17,17 +17,17 @@ EpisodeListView::EpisodeListView(const HWND hWndParent) lvc.mask = LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM; lvc.iSubItem = ELVSIEPISODE; - lvc.pszText = TEXT("#"); + lvc.pszText = (TCHAR*)TEXT("#"); lvc.cx = Dpi(42); ListView_InsertColumn(hWnd, ELVSIEPISODE, &lvc); lvc.iSubItem = ELVSITITLE; - lvc.pszText = TEXT("Title"); + lvc.pszText = (TCHAR*)TEXT("Title"); lvc.cx = 500; ListView_InsertColumn(hWnd, ELVSITITLE, &lvc); lvc.iSubItem = ELVSIRATING; - lvc.pszText = TEXT("/"); + lvc.pszText = (TCHAR*)TEXT("/"); lvc.cx = Dpi(30); ListView_InsertColumn(hWnd, ELVSIRATING, &lvc); @@ -415,7 +415,7 @@ void EpisodeListView::UpdateItem(const LVITEM* const pLvi) ListView_SetItemText(hWnd, pLvi->iItem, ELVSITITLE, tszName); r: if (!Pl("episode_data","episode_rating",pLvi->lParam,&iRating)) { - ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, TEXT("")); + ListView_SetItemText(hWnd, pLvi->iItem, ELVSIRATING, (TCHAR*)TEXT("")); return; } diff --git a/c/listview.cpp b/c/listview.cpp index 056a17b..3ad66f5 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -56,8 +56,10 @@ void ListView::UpdateTheme(const BOOL bThemeActive) wAction = UIS_CLEAR; } +#ifdef UNICODE /* Use modern "Explorer" theme. */ SetWindowTheme(hWnd, tszTheme, NULL); +#endif /* The modern theme requires double buffering. */ ListView_SetExtendedListViewStyleEx(hWnd, LVS_EX_DOUBLEBUFFER, dwStyle); -- cgit v1.2.3