mCtrl  0.9.4
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 
148 
155 
160 
167 
169 #define MC_WC_TREELISTW L"mCtrl.treelist"
170 
171 #define MC_WC_TREELISTA "mCtrl.treelist"
172 
180 
184 #define MC_TLS_HASBUTTONS 0x0001
185 
186 #define MC_TLS_HASLINES 0x0002
187 
190 #define MC_TLS_LINESATROOT 0x0004
191 #if 0 /* TODO */
192 #define MC_TLS_GRIDLINES 0x0008
193 #endif
194 
195 #define MC_TLS_SHOWSELALWAYS 0x0010
196 
198 #define MC_TLS_FULLROWSELECT 0x0020
199 
201 #define MC_TLS_NONEVENHEIGHT 0x0040
202 
203 #define MC_TLS_DOUBLEBUFFER 0x0080
204 
205 #define MC_TLS_NOCOLUMNHEADER 0x0100
206 
208 #define MC_TLS_HEADERDRAGDROP 0x0200
209 
211 #define MC_TLS_SINGLEEXPAND 0x0400
212 #if 0 /* TODO */
213 #define MC_TLS_NOTOOLTIPS 0x0800
214 #define MC_TLS_CHECKBOXES 0x1000
215 #define MC_TLS_EDITLABELS 0x2000
216 #endif
217 
226 
228 #define MC_TLCF_FORMAT (1 << 0)
229 
230 #define MC_TLCF_WIDTH (1 << 1)
231 
233 #define MC_TLCF_TEXT (1 << 2)
234 
235 #define MC_TLCF_IMAGE (1 << 3)
236 
237 #define MC_TLCF_ORDER (1 << 4)
238 
247 
249 #define MC_TLFMT_LEFT 0x0
250 
251 #define MC_TLFMT_RIGHT 0x1
252 
253 #define MC_TLFMT_CENTER 0x2
254 
255 #define MC_TLFMT_JUSTIFYMASK 0x3
256 
265 
271 #define MC_TLI_ROOT ((MC_HTREELISTITEM)(ULONG_PTR) -0x10000)
272 
278 #define MC_TLI_FIRST ((MC_HTREELISTITEM)(ULONG_PTR) -0xffff)
279 
285 #define MC_TLI_LAST ((MC_HTREELISTITEM)(ULONG_PTR) -0xfffe)
286 
295 
297 #define MC_TLIF_STATE (1 << 0)
298 
299 #define MC_TLIF_TEXT (1 << 1)
300 
301 #define MC_TLIF_LPARAM (1 << 2)
302 
303 #define MC_TLIF_IMAGE (1 << 3)
304 
305 #define MC_TLIF_SELECTEDIMAGE (1 << 4)
306 
307 #define MC_TLIF_EXPANDEDIMAGE (1 << 5)
308 
309 #define MC_TLIF_CHILDREN (1 << 6)
310 
311 #define MC_TLIF_TEXTCOLOR (1 << 7)
312 
313 #define MC_TLIF_BKCOLOR (1 << 8)
314 
322 
324 #define MC_TLIS_SELECTED (1 << 1)
325 
326 #define MC_TLIS_EXPANDED (1 << 5)
327 
331 
332 
338 
341 #define MC_TLSIF_TEXT (1 << 1)
342 
351 
353 #define MC_TLHT_NOWHERE (1 << 0)
354 
355 #define MC_TLHT_ONITEMICON (1 << 1)
356 
357 #define MC_TLHT_ONITEMSTATEICON (1 << 2)
358 
359 #define MC_TLHT_ONITEMLABEL (1 << 3)
360 
361 #define MC_TLHT_ONITEM (MC_TLHT_ONITEMICON | MC_TLHT_ONITEMSTATEICON | MC_TLHT_ONITEMLABEL)
362 
363 #define MC_TLHT_ONITEMINDENT (1 << 4)
364 
365 #define MC_TLHT_ONITEMBUTTON (1 << 5)
366 
367 #define MC_TLHT_ONITEMRIGHT (1 << 6)
368 
370 #define MC_TLHT_ONITEMLEFT (1 << 7)
371 
372 #define MC_TLHT_ABOVE (1 << 8)
373 
374 #define MC_TLHT_BELOW (1 << 9)
375 
376 #define MC_TLHT_TORIGHT (1 << 10)
377 
378 #define MC_TLHT_TOLEFT (1 << 11)
379 
388 
390 #define MC_TLE_COLLAPSE 0x1
391 
392 #define MC_TLE_EXPAND 0x2
393 
394 #define MC_TLE_TOGGLE 0x3
395 
404 
406 #define MC_TLGN_ROOT 0x0
407 
409 #define MC_TLGN_NEXT 0x1
410 
412 #define MC_TLGN_PREVIOUS 0x2
413 
415 #define MC_TLGN_PARENT 0x3
416 
418 #define MC_TLGN_CHILD 0x4
419 
422 #define MC_TLGN_FIRSTVISIBLE 0x5
423 
427 #define MC_TLGN_NEXTVISIBLE 0x6
428 
434 #define MC_TLGN_PREVIOUSVISIBLE 0x7
435 
436 #define MC_TLGN_CARET 0x9
437 
441 #define MC_TLGN_LASTVISIBLE 0xa
442 
450 
455 typedef struct MC_TLCOLUMNW_tag {
458  UINT fMask;
462  int fmt;
464  int cx;
466  WCHAR* pszText;
470  int iImage;
472  int iOrder;
473 } MC_TLCOLUMNW;
474 
479 typedef struct MC_TLCOLUMNA_tag {
482  UINT fMask;
486  int fmt;
488  int cx;
490  char* pszText;
494  int iImage;
496  int iOrder;
497 } MC_TLCOLUMNA;
498 
502 typedef void* MC_HTREELISTITEM;
503 
504 
509 typedef struct MC_TLITEMW_tag {
512  UINT fMask;
514  UINT state;
517  UINT stateMask;
519  WCHAR* pszText;
524  LPARAM lParam;
526  int iImage;
538  COLORREF textColor;
543  COLORREF bkColor;
544 } MC_TLITEMW;
545 
550 typedef struct MC_TLITEMA_tag {
553  UINT fMask;
555  UINT state;
558  UINT stateMask;
560  char* pszText;
565  LPARAM lParam;
567  int iImage;
579  COLORREF textColor;
584  COLORREF bkColor;
585 } MC_TLITEMA;
586 
591 typedef struct MC_TLSUBITEMW_tag {
594  UINT fMask;
596  int iSubItem;
598  WCHAR* pszText;
602 } MC_TLSUBITEMW;
603 
608 typedef struct MC_TLSUBITEMA_tag {
611  UINT fMask;
613  int iSubItem;
615  char* pszText;
619 } MC_TLSUBITEMA;
620 
625 typedef struct MC_TLINSERTSTRUCTW_tag {
627  MC_HTREELISTITEM hParent;
630  MC_HTREELISTITEM hInsertAfter;
634 
639 typedef struct MC_TLINSERTSTRUCTA_tag {
641  MC_HTREELISTITEM hParent;
644  MC_HTREELISTITEM hInsertAfter;
648 
652 typedef struct MC_TLHITTESTINFO_tag {
654  POINT pt;
656  UINT flags;
658  MC_HTREELISTITEM hItem;
661  int iSubItem;
663 
677 typedef struct MC_NMTREELIST_tag {
679  NMHDR hdr;
681  UINT action;
683  MC_HTREELISTITEM hItemOld;
685  LPARAM lParamOld;
687  MC_HTREELISTITEM hItemNew;
689  LPARAM lParamNew;
690 } MC_NMTREELIST;
691 
699 
706 #define MC_TLM_INSERTCOLUMNW (MC_TLM_FIRST + 0)
707 
714 #define MC_TLM_INSERTCOLUMNA (MC_TLM_FIRST + 1)
715 
722 #define MC_TLM_SETCOLUMNW (MC_TLM_FIRST + 2)
723 
730 #define MC_TLM_SETCOLUMNA (MC_TLM_FIRST + 3)
731 
738 #define MC_TLM_GETCOLUMNW (MC_TLM_FIRST + 4)
739 
746 #define MC_TLM_GETCOLUMNA (MC_TLM_FIRST + 5)
747 
754 #define MC_TLM_DELETECOLUMN (MC_TLM_FIRST + 6)
755 
763 #define MC_TLM_SETCOLUMNORDERARRAY (MC_TLM_FIRST + 7)
764 
773 #define MC_TLM_GETCOLUMNORDERARRAY (MC_TLM_FIRST + 8)
774 
781 #define MC_TLM_SETCOLUMNWIDTH (MC_TLM_FIRST + 9)
782 
789 #define MC_TLM_GETCOLUMNWIDTH (MC_TLM_FIRST + 10)
790 
804 #define MC_TLM_INSERTITEMW (MC_TLM_FIRST + 11)
805 
819 #define MC_TLM_INSERTITEMA (MC_TLM_FIRST + 12)
820 
828 #define MC_TLM_SETITEMW (MC_TLM_FIRST + 13)
829 
837 #define MC_TLM_SETITEMA (MC_TLM_FIRST + 14)
838 
853 #define MC_TLM_GETITEMW (MC_TLM_FIRST + 15)
854 
869 #define MC_TLM_GETITEMA (MC_TLM_FIRST + 16)
870 
882 #define MC_TLM_DELETEITEM (MC_TLM_FIRST + 17)
883 
895 #define MC_TLM_SETITEMHEIGHT (MC_TLM_FIRST + 18)
896 
903 #define MC_TLM_GETITEMHEIGHT (MC_TLM_FIRST + 19)
904 
912 #define MC_TLM_SETSUBITEMW (MC_TLM_FIRST + 20)
913 
921 #define MC_TLM_SETSUBITEMA (MC_TLM_FIRST + 21)
922 
938 #define MC_TLM_GETSUBITEMW (MC_TLM_FIRST + 22)
939 
955 #define MC_TLM_GETSUBITEMA (MC_TLM_FIRST + 23)
956 
963 #define MC_TLM_SETINDENT (MC_TLM_FIRST + 24)
964 
971 #define MC_TLM_GETINDENT (MC_TLM_FIRST + 25)
972 
981 #define MC_TLM_HITTEST (MC_TLM_FIRST + 26)
982 
989 #define MC_TLM_EXPAND (MC_TLM_FIRST + 27)
990 
999 #define MC_TLM_GETNEXTITEM (MC_TLM_FIRST + 28)
1000 
1007 #define MC_TLM_GETVISIBLECOUNT (MC_TLM_FIRST + 29)
1008 
1017 #define MC_TLM_ENSUREVISIBLE (MC_TLM_FIRST + 30)
1018 
1030 #define MC_TLM_SETIMAGELIST (MC_TLM_FIRST + 31)
1031 
1039 #define MC_TLM_GETIMAGELIST (MC_TLM_FIRST + 32)
1040 
1048 
1049 
1061 #define MC_TLN_DELETEITEM (MC_TLN_FIRST + 0)
1062 
1077 #define MC_TLN_SELCHANGING (MC_TLN_FIRST + 1)
1078 
1092 #define MC_TLN_SELCHANGED (MC_TLN_FIRST + 2)
1093 
1108 #define MC_TLN_EXPANDING (MC_TLN_FIRST + 3)
1109 
1123 #define MC_TLN_EXPANDED (MC_TLN_FIRST + 4)
1124 
1132 
1134 #define MC_WC_TREELIST MCTRL_NAME_AW(MC_WC_TREELIST)
1135 
1136 #define MC_TLCOLUMN MCTRL_NAME_AW(MC_TLCOLUMN)
1137 
1138 #define MC_TLITEM MCTRL_NAME_AW(MC_TLITEM)
1139 
1140 #define MC_TLSUBITEM MCTRL_NAME_AW(MC_TLSUBITEM)
1141 
1142 #define MC_TLINSERTSTRUCT MCTRL_NAME_AW(MC_TLINSERTSTRUCT)
1143 
1144 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1145 
1146 #define MC_TLM_INSERTCOLUMN MCTRL_NAME_AW(MC_TLM_INSERTCOLUMN)
1147 
1148 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1149 
1150 #define MC_TLM_GETCOLUMN MCTRL_NAME_AW(MC_TLM_GETCOLUMN)
1151 
1152 #define MC_TLM_INSERTITEM MCTRL_NAME_AW(MC_TLM_INSERTITEM)
1153 
1154 #define MC_TLM_SETITEM MCTRL_NAME_AW(MC_TLM_SETITEM)
1155 
1156 #define MC_TLM_GETITEM MCTRL_NAME_AW(MC_TLM_GETITEM)
1157 
1158 #define MC_TLM_SETSUBITEM MCTRL_NAME_AW(MC_TLM_SETSUBITEM)
1159 
1160 #define MC_TLM_GETSUBITEM MCTRL_NAME_AW(MC_TLM_GETSUBITEM)
1161 
1165 #ifdef __cplusplus
1166 } /* extern "C" */
1167 #endif
1168 
1169 #endif /* MCTRL_TREELIST_H */