67 |
if (ctx->hil) |
if (ctx->hil) |
68 |
ImageList_Destroy (ctx->hil); |
ImageList_Destroy (ctx->hil); |
69 |
delete ctx; |
delete ctx; |
70 |
} /* listview_release */ |
} |
71 |
|
|
72 |
|
|
73 |
|
int |
74 |
|
listview_set_column_width (listview_ctrl_t ctx, int col, int width) |
75 |
|
{ |
76 |
|
LVCOLUMN lvc; |
77 |
|
|
78 |
|
memset (&lvc, 0, sizeof (lvc)); |
79 |
|
lvc.mask = LVCF_WIDTH; |
80 |
|
lvc.cx = width; |
81 |
|
ListView_SetColumn (ctx->ctrl, col, &lvc); |
82 |
|
return 0; |
83 |
|
} |
84 |
|
|
85 |
|
|
86 |
int |
int |
261 |
} |
} |
262 |
|
|
263 |
|
|
264 |
|
/* Return the index of the selected item. |
265 |
|
Support both selections and checkboxes. */ |
266 |
|
int |
267 |
|
listview_get_selected_item (listview_ctrl_t lv) |
268 |
|
{ |
269 |
|
int pos, i; |
270 |
|
|
271 |
|
pos = listview_get_curr_pos (lv); |
272 |
|
if (pos != -1) |
273 |
|
return pos; |
274 |
|
for (i=0; i < listview_count_items (lv, 0); i++) { |
275 |
|
if (listview_get_item_state (lv, i)) |
276 |
|
return i; |
277 |
|
} |
278 |
|
return -1; |
279 |
|
} |
280 |
|
|
281 |
|
|
282 |
/* Return if the given element is selected or if the ext |
/* Return if the given element is selected or if the ext |
283 |
style is used, if the checkbox is activated. */ |
style is used, if the checkbox is activated. */ |
284 |
int |
int |