/[winpt]/trunk/Include/wptCommonCtl.h
ViewVC logotype

Annotation of /trunk/Include/wptCommonCtl.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 335 - (hide annotations)
Sun Nov 27 12:20:21 2011 UTC (13 years, 3 months ago) by twoaday
File MIME type: text/plain
File size: 4025 byte(s)


1 werner 37 /* wptCommonCtl.h - Win32 Imagelist headerfile
2 twoaday 329 * Copyright (C) 2004-2006, 2009 Timo Schulz
3 werner 37 *
4     * This file is part of WinPT.
5     *
6     * WinPT is free software; you can redistribute it and/or
7     * modify it under the terms of the GNU General Public License
8     * as published by the Free Software Foundation; either version 2
9     * of the License, or (at your option) any later version.
10     *
11     * WinPT is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14     * General Public License for more details.
15     */
16    
17     #ifndef WPT_COMMONCTL_H
18     #define WPT_COMMONCTL_H
19    
20     #include <commctrl.h>
21    
22     /* Symbol constants for the toolbar. */
23     enum km_sym_tid_t {
24 twoaday 143 IMI_KEY_NEW=0,
25     IMI_KEY_DELETE,
26 werner 37 IMI_KEY_PROPS,
27     IMI_KEY_SIGN,
28 twoaday 143 IMI_KEY_SEARCH,
29     IMI_KEY_FILE_IMPORT,
30     IMI_KEY_FILE_EXPORT,
31 werner 37 IMI_KEY_IMPORT,
32 twoaday 143 IMI_KEY_EXPORT,
33 werner 37 IMI_SORT_UPARROW,
34     IMI_SORT_DOWNARROW,
35     IMI_EXIT,
36     IMAGELIST_NUMIMAGES
37     };
38    
39     /*-- List View --*/
40     #define KEYLIST_SORT_DESC 0x8000
41    
42     typedef int (CALLBACK *listview_cmp) (LPARAM lParam1, LPARAM lParam2,
43     LPARAM lParamSort);
44    
45     /* Listview column. */
46     struct listview_column_s {
47     int pos; /* position of the column. */
48     int width; /* width of the column. */
49     char *fieldname; /* name of the column. */
50     };
51     typedef struct listview_column_s * listview_column_t;
52    
53     /* Listview control context. */
54     struct listview_ctrl_s {
55     HWND ctrl; /* the actual listview window. */
56     int cols; /* number of columns. */
57     int items; /* number of items. */
58 twoaday 174 unsigned int ext_chkbox:1; /* exteneded style: checkboxes. */
59 twoaday 133 HIMAGELIST hil; /* Imagelist context. */
60 werner 37 };
61     typedef struct listview_ctrl_s * listview_ctrl_t;
62    
63 twoaday 219
64 twoaday 208 void listview_new (listview_ctrl_t *ctx, HWND ctrl);
65 werner 37 void listview_release (listview_ctrl_t ctx);
66     int listview_add_column (listview_ctrl_t ctx, listview_column_t col);
67     int listview_add_item_pos (listview_ctrl_t ctx, int pos);
68     int listview_add_item (listview_ctrl_t ctx, const char *text);
69     int listview_add_item2 (listview_ctrl_t ctx, const char * text, void * magic);
70     void listview_add_sub_item (listview_ctrl_t ctx, int pos, int col,
71     const char *text);
72     int listview_count_items (listview_ctrl_t ctx, int curr_sel);
73     int listview_del_item (listview_ctrl_t ctx, int pos);
74 twoaday 151 int listview_del_sel_items (listview_ctrl_t ctx);
75     int listview_del_all_items (listview_ctrl_t ctx);
76 werner 37 int listview_get_item_state (listview_ctrl_t ctx, int pos);
77 twoaday 192 int listview_get_selected_item (listview_ctrl_t lv);
78 werner 37 void* listview_get_item2 (listview_ctrl_t ctx, int pos);
79     int listview_set_item2 (listview_ctrl_t ctx, int pos, void *magic);
80     int listview_sort_items (listview_ctrl_t ctx, int sortby,
81     listview_cmp sort_cb);
82     int listview_get_curr_pos (listview_ctrl_t ctx);
83     int listview_get_item_text (listview_ctrl_t ctx, int entry, int pos,
84     char *text, int maxbytes);
85     void listview_set_ext_style (listview_ctrl_t ctx);
86 twoaday 329 void listview_set_grid_style (listview_ctrl_t ctx);
87 twoaday 174 void listview_set_chkbox_style (listview_ctrl_t ctx);
88 werner 37 int listview_set_column_order (listview_ctrl_t ctx, int *array);
89 twoaday 192 int listview_set_column_width (listview_ctrl_t ctx, int col, int width);
90 werner 37 int listview_del_items (listview_ctrl_t ctx);
91     void listview_select_all (listview_ctrl_t ctx);
92 twoaday 77 void listview_deselect_all (listview_ctrl_t ctx);
93 werner 37 void listview_select_one (listview_ctrl_t ctx, int pos);
94 twoaday 240 int listview_find (listview_ctrl_t ctx, const char * str, int substr);
95 werner 37 void listview_scroll (listview_ctrl_t ctx, int oldpos, int newpos);
96 twoaday 129 int listview_del_column (listview_ctrl_t ctx, int pos);
97 twoaday 133 int listview_add_item_image (listview_ctrl_t ctx, const char *text, int image);
98 twoaday 182 void listview_set_image_list (listview_ctrl_t ctx, int cx, int cy,
99     HICON *ico, DWORD nicons);
100 werner 37
101     /*-- Image List --*/
102 twoaday 335 int km_imagelist_load (HWND hwnd, HIMAGELIST *r_il);
103     int km_imagelist_destroy (HIMAGELIST il);
104     int km_imagelist_getindex (HIMAGELIST il, int icon);
105 werner 37 #endif /*WPT_COMMONCTL_H*/

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26