209 |
} |
} |
210 |
|
|
211 |
|
|
212 |
|
/* Delete a single item from @ctx at position @pos. */ |
213 |
int |
int |
214 |
listview_del_item( listview_ctrl_t ctx, int pos ) |
listview_del_item (listview_ctrl_t ctx, int pos) |
215 |
{ |
{ |
216 |
int rc = 0; |
int rc = 0; |
217 |
|
|
218 |
if( ListView_DeleteItem( ctx->ctrl, pos ) == -1 ) |
if (ListView_DeleteItem (ctx->ctrl, pos) == -1) |
219 |
rc = 1; |
rc = 1; |
220 |
return rc; |
return rc; |
221 |
} /* listview_del_item */ |
} |
222 |
|
|
223 |
|
|
224 |
|
/* Delete all selected items in @ctx. */ |
225 |
int |
int |
226 |
listview_del_items( listview_ctrl_t ctx ) |
listview_del_sel_items (listview_ctrl_t ctx) |
227 |
{ |
{ |
228 |
int i, n; |
int i, n; |
229 |
|
|
|
/* delete all selected entries */ |
|
230 |
n = listview_count_items (ctx, 0); |
n = listview_count_items (ctx, 0); |
231 |
for( i = n; i > 0; i-- ) { |
for (i = n; i > -1; i--) { |
232 |
if ( listview_get_item_state( ctx, i ) ) |
if (listview_get_item_state (ctx, i)) |
233 |
listview_del_item( ctx, i ); |
listview_del_item (ctx, i); |
234 |
} |
} |
235 |
return 0; |
return 0; |
236 |
} /* listview_del_items */ |
} |
237 |
|
|
238 |
|
|
239 |
int |
int |
240 |
listview_del_all( listview_ctrl_t ctx ) |
listview_del_all_items (listview_ctrl_t ctx) |
241 |
{ |
{ |
242 |
int rc = 0; |
int rc = 0; |
243 |
|
|
244 |
if( ListView_DeleteAllItems( ctx->ctrl ) == FALSE ) |
if (ListView_DeleteAllItems (ctx->ctrl) == FALSE) |
245 |
rc = 1; |
rc = 1; |
246 |
return rc; |
return rc; |
247 |
} /* listview_del_all */ |
} |
248 |
|
|
249 |
|
|
250 |
int |
int |
397 |
HIMAGELIST hil; |
HIMAGELIST hil; |
398 |
DWORD i; |
DWORD i; |
399 |
|
|
400 |
hil = ImageList_Create (16, 16, ILC_COLOR16, nicons, 1); |
hil = ImageList_Create (16, 16, ILC_COLOR8|ILC_MASK, nicons, 1); |
401 |
|
ImageList_SetBkColor (hil, CLR_NONE); |
402 |
for (i=0; i < nicons; i++) |
for (i=0; i < nicons; i++) |
403 |
ImageList_AddIcon (hil, ico[i]); |
ImageList_AddIcon (hil, ico[i]); |
404 |
ListView_SetImageList (ctx->ctrl, hil, LVSIL_SMALL); |
ListView_SetImageList (ctx->ctrl, hil, LVSIL_SMALL); |
405 |
} |
} |
406 |
|
|