MiniGUI API Reference (MiniGUI-Standalone)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
listview.h
Go to the documentation of this file.
1 //
3 // IMPORTANT NOTICE
4 //
5 // The following open source license statement does not apply to any
6 // entity in the Exception List published by FMSoft.
7 //
8 // For more information, please visit:
9 //
10 // https://www.fmsoft.cn/exception-list
11 //
13 
55 /*
56  * $Id: listview.h 11677 2009-05-23 08:07:19Z dongjunjie $
57  *
58  * MiniGUI for Linux/uClinux, eCos, uC/OS-II, VxWorks,
59  * pSOS, ThreadX, NuCleus, OSE, and Win32.
60  */
61 
62 #ifndef EXT_LISTVIEW_H
63 #define EXT_LISTVIEW_H
64 
65 
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69 
84 #define CTRL_LISTVIEW ("ListView")
85 
87 #define LV_OKAY 0
88 
89 #define LV_ERR (-1)
90 
91 #define LV_ERRSPACE (-2)
92 
97 typedef GHANDLE HLVITEM;
98 
103 #define LVIF_FOLD 0x0001L
104 
109 typedef struct _LVITEM
110 {
114  int nItem;
119 
130 
131 } LVITEM;
132 
134 typedef LVITEM *PLVITEM;
135 
137 #define LVFLAG_BITMAP 0x0001
138 
139 #define LVFLAG_ICON 0x0002
140 
145 typedef struct _LVSUBITEM
146 {
156  int nItem;
158  int subItem;
160  char *pszText;
162  int nTextMax;
167 } LVSUBITEM;
170 
172 typedef struct _LVSORTDATA
173 {
175  int ncol;
177  int losorted;
180 } LVSORTDATA;
183 
185 typedef int (*PFNLVCOMPARE) (HLVITEM nItem1, HLVITEM nItem2, PLVSORTDATA sortData);
186 
187 typedef GHANDLE HLVHDR;
188 typedef GHANDLE HLVHDRITEM;
189 
191 /* hlvhdr is reserved for extension */
192 typedef void (*PFN_LVHDR_BKDRAWFUNC) (HWND hWnd, HLVHDR hlvhdr, HDC hdc, RECT *rcDraw);
194 typedef void (*PFN_LVHDR_ITEMDRAWFUNC) (HWND hWnd, int idx, HDC hdc, RECT *rcDraw);
195 
196 
198 typedef struct _LVCUSTOMDRAWFUNCS
199 {
205 
206 
209 #define LVCF_LEFTALIGN 0x0000
210 
211 #define LVCF_RIGHTALIGN 0x0001
212 
213 #define LVCF_CENTERALIGN 0x0002
214 
215 #define LVCF_TREEVIEW 0x0004
216 
219 #define LVHF_LEFTALIGN 0x0000
220 
221 #define LVHF_RIGHTALIGN 0x0004
222 
223 #define LVHF_CENTERALIGN 0x0008
224 
229 typedef struct _LVCOLUMN
230 {
232  int nCols;
234  int width;
236  char *pszHeadText;
238  int nTextMax;
245 } LVCOLUMN;
248 
251 #define LVFF_TEXT 0x0001
252 
253 #define LVFF_ADDDATA 0x0002
254 
256 typedef struct _LVFINDINFO
257 {
268  int iStart;
270  int nCols;
272  char **pszInfo;
275 
277  int nItem;
279  int nSubitem;
280 
281 } LVFINDINFO;
284 
286 typedef struct _LVNM_NORMAL
287 {
292 } LVNM_NORMAL;
295 
300 
305 
310 
315 
320 
333 #define LVS_UPNOTIFY 0x0001L /* must be the same with SVS_UPNOTIFY */
334 #define LVS_NOTIFY LVS_UPNOTIFY
335 
342 #define LVS_SORT 0x0002L
343 
348 #define LVS_MULTIPLESEL 0x0008L /* reserved */
349 
354 #define LVS_CHECKBOX 0x1000L /* reserved */
355 
362 #define LVS_AUTOCHECK 0x2000L /* reserved */
363 
368 #define LVS_AUTOCHECKBOX (LVS_CHECKBOX | LVS_AUTOCHECK) /* reserved */
369 
374 #define LVS_TREEVIEW 0x4000L
375 
376 #define LVS_WITHGRID 0x8000L
377 
406 #define LVM_ADDITEM 0xF110
407 
430 #define LVM_FILLSUBITEM 0xF111
431 
447 #define LVM_ADDCOLUMN 0xF112
448 
467 #define LVM_DELITEM 0xF113
468 
491 #define LVM_CLEARSUBITEM 0xF114
492 
508 #define LVM_DELCOLUMN 0xF115
509 
525 #define LVM_COLSORT 0xF116
526 
549 #define LVM_SETSUBITEMCOLOR 0xF117
550 
568 #define LVM_FINDITEM 0xF118
569 
594 #define LVM_GETSUBITEMTEXT 0xF119
595 
609 #define LVM_GETITEMCOUNT 0xF11A
610 
624 #define LVM_GETCOLUMNCOUNT 0xF11B
625 
639 #define LVM_GETSELECTEDITEM 0xF11C
640 
654 #define LVM_DELALLITEM 0xF11D
655 
671 #define LVM_MODIFYHEAD 0xF11E
672 
691 #define LVM_SELECTITEM 0xF11F
692 
693 
712 #define LVM_SHOWITEM 0xF120
713 
736 #define LVM_GETSUBITEMLEN 0xF121
737 
754 #define LVM_SETCOLUMN 0xF122
755 
778 #define LVM_SETSUBITEMTEXT 0xF123
779 
802 #define LVM_SETSUBITEM 0xF124
803 
823 #define LVM_GETCOLUMN 0xF125
824 
841 #define LVM_GETCOLUMNWIDTH 0xF126
842 
863 #define LVM_GETITEM 0xF127
864 
884 #define LVM_GETITEMSTATE 0xF128
885 
899 #define LVM_GETSELECTEDCOLUMN 0xF129
900 
914 #define LVM_GETSELECTEDCOUNT 0xF130
915 
929 #define LVM_GETTOPVISIBLE 0xF131
930 
935 #define LVM_NULL 0xF132
936 
941 #define LVM_SETITEMSTATE 0xF133
942 
977 #define LVM_SORTITEMS 0xF134
978 
997 #define LVM_SETITEMHEIGHT 0xF135
998 
1014 #define LVM_SETHEADHEIGHT 0xF136
1015 
1041 #define LVM_GETITEMADDDATA 0xF137
1042 
1067 #define LVM_SETITEMADDDATA 0xF138
1068 
1087 #define LVM_CHOOSEITEM 0xF139
1088 
1118 #define LVM_SETSTRCMPFUNC 0xF140
1119 
1120 #define LVIR_PARENT 1
1121 #define LVIR_FIRSTCHILD 2
1122 #define LVIR_NEXTSIBLING 3
1123 #define LVIR_PREVSIBLING 4
1124 
1153 #define LVM_GETRELATEDITEM 0xF141
1154 
1173 #define LVM_FOLDITEM 0xF142
1174 
1191 #define LVM_SETCUSTOMDRAW 0xF143
1192 
1209 #define LVM_GETSELECTEDITEMRECT 0xF144
1210 
1211 
1212 
1223 #define LVN_CLICKED 1 /* must be the same as SVN_CLICKED */
1224 
1230 #define LVN_SELCHANGE 2 /* must be the same as SVN_SELCHANGED */
1231 
1237 #define LVN_ITEMRDOWN 4
1238 
1244 #define LVN_ITEMRUP 5
1245 
1251 #define LVN_HEADRDOWN 6
1252 
1258 #define LVN_HEADRUP 7
1259 
1264 #define LVN_KEYDOWN 8
1265 
1272 #define LVN_ITEMDBCLK 9
1273 
1279 #define LVN_ITEMCLK 10
1280 
1286 #define LVN_COLCHANGE 11
1287 
1293 #define LVN_FOLDED 12
1294 
1300 #define LVN_UNFOLDED 13
1301 
1307 #ifdef __cplusplus
1308 }
1309 #endif
1310 
1311 #endif /* EXT_LISTVIEW_H */
1312 
_LVSUBITEM::nTextMax
int nTextMax
Definition: listview.h:162
_LVCOLUMN::nCols
int nCols
Definition: listview.h:232
_LVCUSTOMDRAWFUNCS
Definition: listview.h:198
_LVFINDINFO
Definition: listview.h:256
_LVSUBITEM::flags
DWORD flags
Definition: listview.h:154
LVCOLUMN
struct _LVCOLUMN LVCOLUMN
DWORD
DWORD_PTR DWORD
A unsigned long type definition for pointer precision.
Definition: common.h:604
_LVCOLUMN::image
DWORD image
Definition: listview.h:240
HWND
GHANDLE HWND
Handle to main window or control.
Definition: common.h:407
HDC
GHANDLE HDC
Handle to device context.
Definition: common.h:412
HLVITEM
GHANDLE HLVITEM
List view item handle.
Definition: listview.h:97
_LVSORTDATA
Definition: listview.h:172
PLVSUBITEM
LVSUBITEM * PLVSUBITEM
Definition: listview.h:169
_LVITEM::nItem
int nItem
Definition: listview.h:114
_LVFINDINFO::nCols
int nCols
Definition: listview.h:270
_LVSUBITEM::subItem
int subItem
Definition: listview.h:158
WPARAM
UINT_PTR WPARAM
A type definition for the first message paramter.
Definition: common.h:706
LVNM_HEADRDOWN
LVNM_NORMAL LVNM_HEADRDOWN
Definition: listview.h:302
GHANDLE
PVOID GHANDLE
General handle.
Definition: common.h:402
_LVCOLUMN
Definition: listview.h:229
_LVITEM::itemData
DWORD itemData
Definition: listview.h:118
_LVCOLUMN::pszHeadText
char * pszHeadText
Definition: listview.h:236
_RECT
Definition: common.h:936
_LVSUBITEM::pszText
char * pszText
Definition: listview.h:160
_LVITEM::nItemHeight
int nItemHeight
Definition: listview.h:116
_LVCOLUMN::nTextMax
int nTextMax
Definition: listview.h:238
_LVFINDINFO::flags
DWORD flags
Definition: listview.h:266
_LVFINDINFO::pszInfo
char ** pszInfo
Definition: listview.h:272
_LVITEM
Definition: listview.h:109
_LVSORTDATA::ncol
int ncol
Definition: listview.h:175
PLVNM_ITEMRDOWN
LVNM_ITEMRDOWN * PLVNM_ITEMRDOWN
Definition: listview.h:314
LVSUBITEM
struct _LVSUBITEM LVSUBITEM
_LVITEM::dwFlags
DWORD dwFlags
Definition: listview.h:129
PLVSORTDATA
LVSORTDATA * PLVSORTDATA
Definition: listview.h:182
LVNM_ITEMRDOWN
LVNM_NORMAL LVNM_ITEMRDOWN
Definition: listview.h:312
PLVNM_KEYDOWN
LVNM_KEYDOWN * PLVNM_KEYDOWN
Definition: listview.h:299
PLVFINDINFO
LVFINDINFO * PLVFINDINFO
Definition: listview.h:283
_LVSORTDATA::losorted
int losorted
Definition: listview.h:177
LVITEM
struct _LVITEM LVITEM
_LVSUBITEM::nItem
int nItem
Definition: listview.h:156
PLVITEM
LVITEM * PLVITEM
Definition: listview.h:134
_LVSUBITEM
Definition: listview.h:145
LVNM_KEYDOWN
LVNM_NORMAL LVNM_KEYDOWN
Definition: listview.h:297
_LVNM_NORMAL
Definition: listview.h:286
_LVCUSTOMDRAWFUNCS::pfnDrawHdrItem
PFN_LVHDR_ITEMDRAWFUNC pfnDrawHdrItem
Definition: listview.h:203
_LVSORTDATA::hLV
HWND hLV
Definition: listview.h:179
LVSORTDATA
struct _LVSORTDATA LVSORTDATA
_LVSUBITEM::image
DWORD image
Definition: listview.h:166
PLVNM_ITEMRUP
LVNM_ITEMRUP * PLVNM_ITEMRUP
Definition: listview.h:319
PFN_LVHDR_ITEMDRAWFUNC
void(* PFN_LVHDR_ITEMDRAWFUNC)(HWND hWnd, int idx, HDC hdc, RECT *rcDraw)
Definition: listview.h:194
_LVFINDINFO::nSubitem
int nSubitem
Definition: listview.h:279
LVNM_HEADRUP
LVNM_NORMAL LVNM_HEADRUP
Definition: listview.h:307
LVFINDINFO
struct _LVFINDINFO LVFINDINFO
PFNLVCOMPARE
int(* PFNLVCOMPARE)(HLVITEM nItem1, HLVITEM nItem2, PLVSORTDATA sortData)
Definition: listview.h:185
LVNM_NORMAL
struct _LVNM_NORMAL LVNM_NORMAL
PLVNM_NORMAL
LVNM_NORMAL * PLVNM_NORMAL
Definition: listview.h:294
_LVCOLUMN::colFlags
DWORD colFlags
Definition: listview.h:244
_LVCOLUMN::pfnCompare
PFNLVCOMPARE pfnCompare
Definition: listview.h:242
PFN_LVHDR_BKDRAWFUNC
void(* PFN_LVHDR_BKDRAWFUNC)(HWND hWnd, HLVHDR hlvhdr, HDC hdc, RECT *rcDraw)
Definition: listview.h:192
_LVCOLUMN::width
int width
Definition: listview.h:234
PLVCOLUMN
LVCOLUMN * PLVCOLUMN
Definition: listview.h:247
LVNM_ITEMRUP
LVNM_NORMAL LVNM_ITEMRUP
Definition: listview.h:317
_LVFINDINFO::nItem
int nItem
Definition: listview.h:277
LVCUSTOMDRAWFUNCS
struct _LVCUSTOMDRAWFUNCS LVCUSTOMDRAWFUNCS
LPARAM
UINT_PTR LPARAM
A type definition for the second message paramter.
Definition: common.h:712
PLVNM_HEADRDOWN
LVNM_HEADRDOWN * PLVNM_HEADRDOWN
Definition: listview.h:304
_LVNM_NORMAL::lParam
LPARAM lParam
Definition: listview.h:291
_LVSUBITEM::nTextColor
int nTextColor
Definition: listview.h:164
_LVCUSTOMDRAWFUNCS::pfnDrawHdrBk
PFN_LVHDR_BKDRAWFUNC pfnDrawHdrBk
Definition: listview.h:201
_LVNM_NORMAL::wParam
WPARAM wParam
Definition: listview.h:289
_LVFINDINFO::iStart
int iStart
Definition: listview.h:268
_LVFINDINFO::addData
DWORD addData
Definition: listview.h:274
PLVNM_HEADUP
LVNM_HEADRUP * PLVNM_HEADUP
Definition: listview.h:309