mCtrl  0.9.2
treelist.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Martin Mitas
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #ifndef MCTRL_TREELIST_H
20 #define MCTRL_TREELIST_H
21 
22 #include <mCtrl/defs.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 
143 
150 
155 
162 
164 #define MC_WC_TREELISTW L"mCtrl.treelist"
165 
166 #define MC_WC_TREELISTA "mCtrl.treelist"
167 
175 
179 #define MC_TLS_HASBUTTONS 0x0001
180 
181 #define MC_TLS_HASLINES 0x0002
182 
185 #define MC_TLS_LINESATROOT 0x0004
186 #if 0 /* TODO */
187 #define MC_TLS_GRIDLINES 0x0008
188 #endif
189 
190 #define MC_TLS_SHOWSELALWAYS 0x0010
191 
193 #define MC_TLS_FULLROWSELECT 0x0020
194 
196 #define MC_TLS_NONEVENHEIGHT 0x0040
197 
198 #define MC_TLS_DOUBLEBUFFER 0x0080
199 
200 #define MC_TLS_NOCOLUMNHEADER 0x0100
201 
203 #define MC_TLS_HEADERDRAGDROP 0x0200
204 
206 #define MC_TLS_SINGLEEXPAND 0x0400
207 #if 0 /* TODO */
208 #define MC_TLS_NOTOOLTIPS 0x0800
209 #define MC_TLS_SHAREDIMAGELISTS 0x1000
210 #define MC_TLS_CHECKBOXES 0x2000
211 #define MC_TLS_EDITLABELS 0x4000
212 #endif
213 
222 
224 #define MC_TLCF_FORMAT (1 << 0)
225 
226 #define MC_TLCF_WIDTH (1 << 1)
227 
229 #define MC_TLCF_TEXT (1 << 2)
230 
231 #define MC_TLCF_IMAGE (1 << 3)
232 
233 #define MC_TLCF_ORDER (1 << 4)
234 
243 
245 #define MC_TLFMT_LEFT 0x0
246 
247 #define MC_TLFMT_RIGHT 0x1
248 
249 #define MC_TLFMT_CENTER 0x2
250 
251 #define MC_TLFMT_JUSTIFYMASK 0x3
252 
261 
267 #define MC_TLI_ROOT ((MC_HTREELISTITEM)(ULONG_PTR) -0x10000)
268 
274 #define MC_TLI_FIRST ((MC_HTREELISTITEM)(ULONG_PTR) -0xffff)
275 
281 #define MC_TLI_LAST ((MC_HTREELISTITEM)(ULONG_PTR) -0xfffe)
282 
291 
293 #define MC_TLIF_STATE (1 << 0)
294 
295 #define MC_TLIF_TEXT (1 << 1)
296 
297 #define MC_TLIF_LPARAM (1 << 2)
298 
299 #define MC_TLIF_IMAGE (1 << 3)
300 
301 #define MC_TLIF_SELECTEDIMAGE (1 << 4)
302 
303 #define MC_TLIF_EXPANDEDIMAGE (1 << 5)
304 
305 #define MC_TLIF_CHILDREN (1 << 6)
306 
315 
317 #define MC_TLIS_SELECTED (1 << 1)
318 
319 #define MC_TLIS_EXPANDED (1 << 5)
320 
329 
332 #define MC_TLSIF_TEXT (1 << 1)
333 
342 
344 #define MC_TLHT_NOWHERE (1 << 0)
345 
346 #define MC_TLHT_ONITEMICON (1 << 1)
347 
348 #define MC_TLHT_ONITEMSTATEICON (1 << 2)
349 
350 #define MC_TLHT_ONITEMLABEL (1 << 3)
351 
352 #define MC_TLHT_ONITEM (MC_TLHT_ONITEMICON | MC_TLHT_ONITEMSTATEICON | MC_TLHT_ONITEMLABEL)
353 
354 #define MC_TLHT_ONITEMINDENT (1 << 4)
355 
356 #define MC_TLHT_ONITEMBUTTON (1 << 5)
357 
358 #define MC_TLHT_ONITEMRIGHT (1 << 6)
359 
361 #define MC_TLHT_ONITEMLEFT (1 << 7)
362 
363 #define MC_TLHT_ABOVE (1 << 8)
364 
365 #define MC_TLHT_BELOW (1 << 9)
366 
367 #define MC_TLHT_TORIGHT (1 << 10)
368 
369 #define MC_TLHT_TOLEFT (1 << 11)
370 
379 
381 #define MC_TLE_COLLAPSE 0x1
382 
383 #define MC_TLE_EXPAND 0x2
384 
385 #define MC_TLE_TOGGLE 0x3
386 
395 
397 #define MC_TLGN_ROOT 0x0
398 
400 #define MC_TLGN_NEXT 0x1
401 
403 #define MC_TLGN_PREVIOUS 0x2
404 
406 #define MC_TLGN_PARENT 0x3
407 
409 #define MC_TLGN_CHILD 0x4
410 
413 #define MC_TLGN_FIRSTVISIBLE 0x5
414 
418 #define MC_TLGN_NEXTVISIBLE 0x6
419 
425 #define MC_TLGN_PREVIOUSVISIBLE 0x7
426 
427 #define MC_TLGN_CARET 0x9
428 
432 #define MC_TLGN_LASTVISIBLE 0xa
433 
441 
446 typedef struct MC_TLCOLUMNW_tag {
449  UINT fMask;
453  int fmt;
455  int cx;
457  WCHAR* pszText;
461  int iImage;
463  int iOrder;
464 } MC_TLCOLUMNW;
465 
470 typedef struct MC_TLCOLUMNA_tag {
473  UINT fMask;
477  int fmt;
479  int cx;
481  char* pszText;
485  int iImage;
487  int iOrder;
488 } MC_TLCOLUMNA;
489 
493 typedef void* MC_HTREELISTITEM;
494 
495 
500 typedef struct MC_TLITEMW_tag {
503  UINT fMask;
505  UINT state;
508  UINT stateMask;
510  WCHAR* pszText;
515  LPARAM lParam;
517  int iImage;
525 } MC_TLITEMW;
526 
531 typedef struct MC_TLITEMA_tag {
534  UINT fMask;
536  UINT state;
539  UINT stateMask;
541  char* pszText;
546  LPARAM lParam;
548  int iImage;
556 } MC_TLITEMA;
557 
562 typedef struct MC_TLSUBITEMW_tag {
565  UINT fMask;
567  int iSubItem;
569  WCHAR* pszText;
573 } MC_TLSUBITEMW;
574 
579 typedef struct MC_TLSUBITEMA_tag {
582  UINT fMask;
584  int iSubItem;
586  char* pszText;
590 } MC_TLSUBITEMA;
591 
596 typedef struct MC_TLINSERTSTRUCTW_tag {
598  MC_HTREELISTITEM hParent;
601  MC_HTREELISTITEM hInsertAfter;
605 
610 typedef struct MC_TLINSERTSTRUCTA_tag {
612  MC_HTREELISTITEM hParent;
615  MC_HTREELISTITEM hInsertAfter;
619 
623 typedef struct MC_TLHITTESTINFO_tag {
625  POINT pt;
627  UINT flags;
629  MC_HTREELISTITEM hItem;
632  int iSubItem;
634 
648 typedef struct MC_NMTREELIST_tag {
650  NMHDR hdr;
652  UINT action;
654  MC_HTREELISTITEM hItemOld;
656  LPARAM lParamOld;
658  MC_HTREELISTITEM hItemNew;
660  LPARAM lParamNew;
661 } MC_NMTREELIST;
662 
670 
677 #define MC_TLM_INSERTCOLUMNW (MC_TLM_FIRST + 0)
678 
685 #define MC_TLM_INSERTCOLUMNA (MC_TLM_FIRST + 1)
686 
693 #define MC_TLM_SETCOLUMNW (MC_TLM_FIRST + 2)
694 
701 #define MC_TLM_SETCOLUMNA (MC_TLM_FIRST + 3)
702 
709 #define MC_TLM_GETCOLUMNW (MC_TLM_FIRST + 4)
710 
717 #define MC_TLM_GETCOLUMNA (MC_TLM_FIRST + 5)
718 
725 #define MC_TLM_DELETECOLUMN (MC_TLM_FIRST + 6)
726 
734 #define MC_TLM_SETCOLUMNORDERARRAY (MC_TLM_FIRST + 7)
735 
744 #define MC_TLM_GETCOLUMNORDERARRAY (MC_TLM_FIRST + 8)
745 
752 #define MC_TLM_SETCOLUMNWIDTH (MC_TLM_FIRST + 9)
753 
760 #define MC_TLM_GETCOLUMNWIDTH (MC_TLM_FIRST + 10)
761 
775 #define MC_TLM_INSERTITEMW (MC_TLM_FIRST + 11)
776 
790 #define MC_TLM_INSERTITEMA (MC_TLM_FIRST + 12)
791 
799 #define MC_TLM_SETITEMW (MC_TLM_FIRST + 13)
800 
808 #define MC_TLM_SETITEMA (MC_TLM_FIRST + 14)
809 
824 #define MC_TLM_GETITEMW (MC_TLM_FIRST + 15)
825 
840 #define MC_TLM_GETITEMA (MC_TLM_FIRST + 16)
841 
853 #define MC_TLM_DELETEITEM (MC_TLM_FIRST + 17)
854 
866 #define MC_TLM_SETITEMHEIGHT (MC_TLM_FIRST + 18)
867 
874 #define MC_TLM_GETITEMHEIGHT (MC_TLM_FIRST + 19)
875 
883 #define MC_TLM_SETSUBITEMW (MC_TLM_FIRST + 20)
884 
892 #define MC_TLM_SETSUBITEMA (MC_TLM_FIRST + 21)
893 
909 #define MC_TLM_GETSUBITEMW (MC_TLM_FIRST + 22)
910 
926 #define MC_TLM_GETSUBITEMA (MC_TLM_FIRST + 23)
927 
934 #define MC_TLM_SETINDENT (MC_TLM_FIRST + 24)
935 
942 #define MC_TLM_GETINDENT (MC_TLM_FIRST + 25)
943 
952 #define MC_TLM_HITTEST (MC_TLM_FIRST + 26)
953 
960 #define MC_TLM_EXPAND (MC_TLM_FIRST + 27)
961 
970 #define MC_TLM_GETNEXTITEM (MC_TLM_FIRST + 28)
971 
978 #define MC_TLM_GETVISIBLECOUNT (MC_TLM_FIRST + 29)
979 
988 #define MC_TLM_ENSUREVISIBLE (MC_TLM_FIRST + 30)
989 
997 
998 
1010 #define MC_TLN_DELETEITEM (MC_TLN_FIRST + 0)
1011 
1026 #define MC_TLN_SELCHANGING (MC_TLN_FIRST + 1)
1027 
1041 #define MC_TLN_SELCHANGED (MC_TLN_FIRST + 2)
1042 
1057 #define MC_TLN_EXPANDING (MC_TLN_FIRST + 3)
1058 
1072 #define MC_TLN_EXPANDED (MC_TLN_FIRST + 4)
1073 
1081 
1083 #define MC_WC_TREELIST MCTRL_NAME_AW(MC_WC_TREELIST)
1084 
1085 #define MC_TLCOLUMN MCTRL_NAME_AW(MC_TLCOLUMN)
1086 
1087 #define MC_TLITEM MCTRL_NAME_AW(MC_TLITEM)
1088 
1089 #define MC_TLSUBITEM MCTRL_NAME_AW(MC_TLSUBITEM)
1090 
1091 #define MC_TLINSERTSTRUCT MCTRL_NAME_AW(MC_TLINSERTSTRUCT)
1092 
1093 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1094 
1095 #define MC_TLM_INSERTCOLUMN MCTRL_NAME_AW(MC_TLM_INSERTCOLUMN)
1096 
1097 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1098 
1099 #define MC_TLM_GETCOLUMN MCTRL_NAME_AW(MC_TLM_GETCOLUMN)
1100 
1101 #define MC_TLM_INSERTITEM MCTRL_NAME_AW(MC_TLM_INSERTITEM)
1102 
1103 #define MC_TLM_SETITEM MCTRL_NAME_AW(MC_TLM_SETITEM)
1104 
1105 #define MC_TLM_GETITEM MCTRL_NAME_AW(MC_TLM_GETITEM)
1106 
1107 #define MC_TLM_SETSUBITEM MCTRL_NAME_AW(MC_TLM_SETSUBITEM)
1108 
1109 #define MC_TLM_GETSUBITEM MCTRL_NAME_AW(MC_TLM_GETSUBITEM)
1110 
1114 #ifdef __cplusplus
1115 } /* extern "C" */
1116 #endif
1117 
1118 #endif /* MCTRL_TREELIST_H */