1 |
/* wptImagelist.cpp - Imagelist helper routines |
/* wptImagelist.cpp - Imagelist helper routines |
2 |
* Copyright (C) 2003 Andreas Jobs |
* Copyright (C) 2003 Andreas Jobs |
3 |
* Copyright (C) 2004 Timo Schulz |
* Copyright (C) 2004, 2006 Timo Schulz |
4 |
* |
* |
5 |
* This file is part of WinPT. |
* This file is part of WinPT. |
6 |
* |
* |
18 |
* along with WinPT; if not, write to the Free Software Foundation, |
* along with WinPT; if not, write to the Free Software Foundation, |
19 |
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 |
*/ |
*/ |
|
|
|
21 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
22 |
#include <config.h> |
#include <config.h> |
23 |
#endif |
#endif |
40 |
ImageList_ReplaceIcon (glob_imagelist, -1, \ |
ImageList_ReplaceIcon (glob_imagelist, -1, \ |
41 |
LoadIcon (glob_hinst, MAKEINTRESOURCE (resid))) |
LoadIcon (glob_hinst, MAKEINTRESOURCE (resid))) |
42 |
|
|
43 |
|
|
44 |
|
/* Load the image list with the default icons. |
45 |
|
Return value: 0 on success. */ |
46 |
int |
int |
47 |
imagelist_load (HWND hwnd) |
imagelist_load (HWND hwnd) |
48 |
{ |
{ |
53 |
return -1; |
return -1; |
54 |
} |
} |
55 |
|
|
56 |
|
il_map[IMI_KEY_NEW] = replace_icon (IDI_KEY_NEW); |
57 |
il_map[IMI_KEY_DELETE] = replace_icon (IDI_KEY_DELETE); |
il_map[IMI_KEY_DELETE] = replace_icon (IDI_KEY_DELETE); |
58 |
il_map[IMI_KEY_PROPS] = replace_icon (IDI_KEY_PROPS); |
il_map[IMI_KEY_PROPS] = replace_icon (IDI_KEY_PROPS); |
59 |
il_map[IMI_KEY_SIGN] = replace_icon (IDI_KEY_SIGN); |
il_map[IMI_KEY_SIGN] = replace_icon (IDI_KEY_SIGN); |
60 |
|
il_map[IMI_KEY_SEARCH] = replace_icon (IDI_KEY_SEARCH); |
61 |
|
il_map[IMI_KEY_FILE_IMPORT]= replace_icon (IDI_KEY_FILE_IMPORT); |
62 |
|
il_map[IMI_KEY_FILE_EXPORT]= replace_icon (IDI_KEY_FILE_EXPORT); |
63 |
il_map[IMI_KEY_IMPORT] = replace_icon (IDI_KEY_IMPORT); |
il_map[IMI_KEY_IMPORT] = replace_icon (IDI_KEY_IMPORT); |
64 |
il_map[IMI_KEY_EXPORT] = replace_icon (IDI_KEY_EXPORT); |
il_map[IMI_KEY_EXPORT] = replace_icon (IDI_KEY_EXPORT); |
65 |
il_map[IMI_SORT_UPARROW] = replace_icon (IDI_SORT_UPARROW); |
il_map[IMI_SORT_UPARROW] = replace_icon (IDI_SORT_UPARROW); |
66 |
il_map[IMI_SORT_DOWNARROW] = replace_icon (IDI_SORT_DOWNARROW); |
il_map[IMI_SORT_DOWNARROW] = replace_icon (IDI_SORT_DOWNARROW); |
|
/*il_map[IMI_EXIT] = replace_icon (IDI_EXIT);*/ |
|
67 |
return 0; |
return 0; |
68 |
} /* imagelist_load */ |
} |
69 |
|
|
70 |
|
|
71 |
|
/* Free image list. */ |
72 |
int |
int |
73 |
imagelist_destroy (void) |
imagelist_destroy (void) |
74 |
{ |
{ |
75 |
ImageList_Destroy (glob_imagelist); |
ImageList_Destroy (glob_imagelist); |
76 |
glob_imagelist = NULL; |
glob_imagelist = NULL; |
77 |
return 0; |
return 0; |
78 |
} /* imagelist_destroy */ |
} |
79 |
|
|
80 |
|
|
81 |
|
/* Map an index to an icon. */ |
82 |
int |
int |
83 |
imagelist_getindex (int icon) |
imagelist_getindex (int icon) |
84 |
{ |
{ |
85 |
if ((icon < 0) || (icon >= IMAGELIST_NUMIMAGES)) |
if ((icon < 0) || (icon >= IMAGELIST_NUMIMAGES)) |
86 |
return -1; |
return -1; |
87 |
return il_map[icon]; |
return il_map[icon]; |
88 |
} /* imagelist_getindex */ |
} |