diff options
author | John Ankarström <john@ankarstrom.se> | 2022-07-20 02:30:50 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2022-07-20 02:30:50 +0200 |
commit | 79d4fa6d9a79295b747eedcc17b4de6ccdde7e37 (patch) | |
tree | e410ce9da4c00e6082625d2ed7e61a216f31f29d | |
parent | 3d56ea09228ac2989eb8b89c8b69909603d61c3e (diff) | |
download | EpisodeBrowser-79d4fa6d9a79295b747eedcc17b4de6ccdde7e37.tar.gz |
Fix ANSI compatibility.
It's not very useful, but it's a fun exercise.
-rw-r--r-- | c/datalistview.cpp | 4 | ||||
-rw-r--r-- | c/episodelistview.cpp | 8 | ||||
-rw-r--r-- | c/listview.cpp | 2 |
3 files changed, 8 insertions, 6 deletions
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); |