diff options
Diffstat (limited to 'c/datalistview.c')
-rw-r--r-- | c/datalistview.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/c/datalistview.c b/c/datalistview.c index d859e24..6749af7 100644 --- a/c/datalistview.c +++ b/c/datalistview.c @@ -5,29 +5,27 @@ #include "resource.h" #include "defs.h" -HWND Dlv_hWnd; +HWND HDlv; HWND -DlvCreate(HWND hWnd) +DlvCreate() { - HWND hDlv; LVCOLUMN lvc; - Dlv_hWnd = hWnd; - hDlv = LvCreate(hWnd, (HMENU)IDC_DATALISTVIEW); + HDlv = LvCreate((HMENU)IDC_DATALISTVIEW); lvc.mask = LVCF_WIDTH|LVCF_TEXT|LVCF_SUBITEM; lvc.iSubItem = 0; lvc.pszText = TEXT("Key"); lvc.cx = 42; - ListView_InsertColumn(hDlv, 0, &lvc); + ListView_InsertColumn(HDlv, 0, &lvc); lvc.iSubItem = 1; lvc.pszText = TEXT("Value"); lvc.cx = 500; - ListView_InsertColumn(hDlv, 1, &lvc); + ListView_InsertColumn(HDlv, 1, &lvc); - return hDlv; + return HDlv; } /* Show episode data. */ @@ -35,12 +33,10 @@ void DlvShowEpisode(int iEpisode) { fid_t f; - HWND hDlv; LVITEM lviKey, lviValue; term_t t; - hDlv = GetDlgItem(Dlv_hWnd, IDC_DATALISTVIEW); - ListView_DeleteAllItems(hDlv); + ListView_DeleteAllItems(HDlv); lviKey.mask = LVIF_TEXT; lviValue.mask = LVIF_TEXT; @@ -75,24 +71,24 @@ DlvShowEpisode(int iEpisode) if (!PL_get_arg(1, tHead, tValue)) continue; GAC(tValue,&szValue) continue; - tszKey = TSZFromSZ(szKey, CP_UTF8); + tszKey = TszFromSz(szKey, CP_UTF8); if (!tszKey) continue; - tszValue = TSZFromSZ(szValue, CP_UTF8); - if (!tszValue) goto e1; + tszValue = TszFromSz(szValue, CP_UTF8); + if (!tszValue) goto n; lviKey.mask = LVIF_TEXT; lviKey.iItem = i; lviKey.iSubItem = 0; lviKey.pszText = tszKey; - ListView_InsertItem(hDlv, &lviKey); + ListView_InsertItem(HDlv, &lviKey); lviValue.iItem = i; lviValue.iSubItem = 1; lviValue.pszText = tszValue; - ListView_SetItem(hDlv, &lviValue); + ListView_SetItem(HDlv, &lviValue); free(tszValue); -e1: free(tszKey); +n: free(tszKey); } } |