22 |
#include <config.h> |
#include <config.h> |
23 |
#endif |
#endif |
24 |
|
|
|
#ifdef __MINGW32__ |
|
|
#include <w32api.h> |
|
|
#define _WIN32_IE IE401 |
|
|
#endif |
|
|
|
|
|
#include <stdio.h> |
|
25 |
#include <stdio.h> |
#include <stdio.h> |
26 |
#include <windows.h> |
#include <windows.h> |
27 |
#include <commctrl.h> |
#include <commctrl.h> |
313 |
|
|
314 |
|
|
315 |
void |
void |
316 |
|
listview_deselect_all (listview_ctrl_t ctx) |
317 |
|
{ |
318 |
|
ListView_SetItemState (ctx->ctrl, -1, ~LVNI_SELECTED, LVNI_SELECTED); |
319 |
|
} |
320 |
|
|
321 |
|
|
322 |
|
void |
323 |
listview_select_one (listview_ctrl_t ctx, int pos) |
listview_select_one (listview_ctrl_t ctx, int pos) |
324 |
{ |
{ |
325 |
ListView_SetItemState (ctx->ctrl, pos, LVIS_SELECTED|LVIS_FOCUSED, LVIS_FOCUSED|LVIS_SELECTED); |
ListView_SetItemState (ctx->ctrl, pos, LVIS_SELECTED|LVIS_FOCUSED, LVIS_FOCUSED|LVIS_SELECTED); |
351 |
return pos; |
return pos; |
352 |
} |
} |
353 |
|
|
|
/** Some functions to make the handling with TreeView Controls easier **/ |
|
|
int |
|
|
treeview_add_item( HWND tree, HTREEITEM parent, const char *text ) |
|
|
{ |
|
|
TVINSERTSTRUCT tvis; |
|
|
|
|
|
memset( &tvis, 0, sizeof tvis ); |
|
|
tvis.hParent = parent; |
|
|
tvis.hInsertAfter = TVI_LAST; |
|
|
tvis.item.mask = TVIF_TEXT; |
|
|
tvis.item.pszText = (char *)text; |
|
|
TreeView_InsertItem( tree, &tvis ); |
|
|
|
|
|
return 0; |
|
|
} /* treeview_add_item */ |
|