aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/episodelistview.c')
-rw-r--r--c/episodelistview.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/c/episodelistview.c b/c/episodelistview.c
index d3445e8..7d87b7a 100644
--- a/c/episodelistview.c
+++ b/c/episodelistview.c
@@ -165,11 +165,14 @@ ElvUpdate()
{
fid_t f;
HWND hListView;
+ int iTop;
LVITEM lviEpisode, lviName;
qid_t q;
term_t t;
hListView = GetDlgItem(gElv_hWnd, IDC_EPISODELISTVIEW);
+ SendMessage(hListView, WM_SETREDRAW, FALSE, 0);
+ iTop = ListView_GetTopIndex(hListView);
ListView_DeleteAllItems(hListView);
lviEpisode.mask = LVIF_TEXT|LVIF_PARAM;
@@ -198,7 +201,7 @@ ElvUpdate()
t2 = PL_new_term_refs(3);
if(!PL_put_integer(t2+0, iEpisode))
- return;
+ continue;
r = PL_call_predicate(NULL, PL_Q_NORMAL,
PL_predicate("lookup_episode_local", 3, "episode_data"),
@@ -240,14 +243,18 @@ ElvUpdate()
}
if (g_iSelectedItem != -1) {
+ int iLast;
+ iLast = ListView_GetItemCount(hListView)-1;
+ ListView_EnsureVisible(hListView, iLast, TRUE);
+ ListView_EnsureVisible(hListView, iTop, TRUE);
ListView_SetItemState(hListView, g_iSelectedItem,
LVIS_SELECTED, LVIS_SELECTED);
- ListView_EnsureVisible(hListView, g_iSelectedItem, TRUE);
}
close:
+ SendMessage(hListView, WM_SETREDRAW, TRUE, 0);
PL_cut_query(q);
- PL_close_foreign_frame(f);
+ PL_discard_foreign_frame(f);
}
/* Update episode name. */