mCtrl  0.9.3
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_CHECKBOXES 0x1000
210 #define MC_TLS_EDITLABELS 0x2000
211 #endif
212 
221 
223 #define MC_TLCF_FORMAT (1 << 0)
224 
225 #define MC_TLCF_WIDTH (1 << 1)
226 
228 #define MC_TLCF_TEXT (1 << 2)
229 
230 #define MC_TLCF_IMAGE (1 << 3)
231 
232 #define MC_TLCF_ORDER (1 << 4)
233 
242 
244 #define MC_TLFMT_LEFT 0x0
245 
246 #define MC_TLFMT_RIGHT 0x1
247 
248 #define MC_TLFMT_CENTER 0x2
249 
250 #define MC_TLFMT_JUSTIFYMASK 0x3
251 
260 
266 #define MC_TLI_ROOT ((MC_HTREELISTITEM)(ULONG_PTR) -0x10000)
267 
273 #define MC_TLI_FIRST ((MC_HTREELISTITEM)(ULONG_PTR) -0xffff)
274 
280 #define MC_TLI_LAST ((MC_HTREELISTITEM)(ULONG_PTR) -0xfffe)
281 
290 
292 #define MC_TLIF_STATE (1 << 0)
293 
294 #define MC_TLIF_TEXT (1 << 1)
295 
296 #define MC_TLIF_LPARAM (1 << 2)
297 
298 #define MC_TLIF_IMAGE (1 << 3)
299 
300 #define MC_TLIF_SELECTEDIMAGE (1 << 4)
301 
302 #define MC_TLIF_EXPANDEDIMAGE (1 << 5)
303 
304 #define MC_TLIF_CHILDREN (1 << 6)
305 
306 #define MC_TLIF_TEXTCOLOR (1 << 7)
307 
308 #define MC_TLIF_BKCOLOR (1 << 8)
309 
317 
319 #define MC_TLIS_SELECTED (1 << 1)
320 
321 #define MC_TLIS_EXPANDED (1 << 5)
322 
326 
327 
333 
336 #define MC_TLSIF_TEXT (1 << 1)
337 
346 
348 #define MC_TLHT_NOWHERE (1 << 0)
349 
350 #define MC_TLHT_ONITEMICON (1 << 1)
351 
352 #define MC_TLHT_ONITEMSTATEICON (1 << 2)
353 
354 #define MC_TLHT_ONITEMLABEL (1 << 3)
355 
356 #define MC_TLHT_ONITEM (MC_TLHT_ONITEMICON | MC_TLHT_ONITEMSTATEICON | MC_TLHT_ONITEMLABEL)
357 
358 #define MC_TLHT_ONITEMINDENT (1 << 4)
359 
360 #define MC_TLHT_ONITEMBUTTON (1 << 5)
361 
362 #define MC_TLHT_ONITEMRIGHT (1 << 6)
363 
365 #define MC_TLHT_ONITEMLEFT (1 << 7)
366 
367 #define MC_TLHT_ABOVE (1 << 8)
368 
369 #define MC_TLHT_BELOW (1 << 9)
370 
371 #define MC_TLHT_TORIGHT (1 << 10)
372 
373 #define MC_TLHT_TOLEFT (1 << 11)
374 
383 
385 #define MC_TLE_COLLAPSE 0x1
386 
387 #define MC_TLE_EXPAND 0x2
388 
389 #define MC_TLE_TOGGLE 0x3
390 
399 
401 #define MC_TLGN_ROOT 0x0
402 
404 #define MC_TLGN_NEXT 0x1
405 
407 #define MC_TLGN_PREVIOUS 0x2
408 
410 #define MC_TLGN_PARENT 0x3
411 
413 #define MC_TLGN_CHILD 0x4
414 
417 #define MC_TLGN_FIRSTVISIBLE 0x5
418 
422 #define MC_TLGN_NEXTVISIBLE 0x6
423 
429 #define MC_TLGN_PREVIOUSVISIBLE 0x7
430 
431 #define MC_TLGN_CARET 0x9
432 
436 #define MC_TLGN_LASTVISIBLE 0xa
437 
445 
450 typedef struct MC_TLCOLUMNW_tag {
453  UINT fMask;
457  int fmt;
459  int cx;
461  WCHAR* pszText;
465  int iImage;
467  int iOrder;
468 } MC_TLCOLUMNW;
469 
474 typedef struct MC_TLCOLUMNA_tag {
477  UINT fMask;
481  int fmt;
483  int cx;
485  char* pszText;
489  int iImage;
491  int iOrder;
492 } MC_TLCOLUMNA;
493 
497 typedef void* MC_HTREELISTITEM;
498 
499 
504 typedef struct MC_TLITEMW_tag {
507  UINT fMask;
509  UINT state;
512  UINT stateMask;
514  WCHAR* pszText;
519  LPARAM lParam;
521  int iImage;
533  COLORREF textColor;
538  COLORREF bkColor;
539 } MC_TLITEMW;
540 
545 typedef struct MC_TLITEMA_tag {
548  UINT fMask;
550  UINT state;
553  UINT stateMask;
555  char* pszText;
560  LPARAM lParam;
562  int iImage;
574  COLORREF textColor;
579  COLORREF bkColor;
580 } MC_TLITEMA;
581 
586 typedef struct MC_TLSUBITEMW_tag {
589  UINT fMask;
591  int iSubItem;
593  WCHAR* pszText;
597 } MC_TLSUBITEMW;
598 
603 typedef struct MC_TLSUBITEMA_tag {
606  UINT fMask;
608  int iSubItem;
610  char* pszText;
614 } MC_TLSUBITEMA;
615 
620 typedef struct MC_TLINSERTSTRUCTW_tag {
622  MC_HTREELISTITEM hParent;
625  MC_HTREELISTITEM hInsertAfter;
629 
634 typedef struct MC_TLINSERTSTRUCTA_tag {
636  MC_HTREELISTITEM hParent;
639  MC_HTREELISTITEM hInsertAfter;
643 
647 typedef struct MC_TLHITTESTINFO_tag {
649  POINT pt;
651  UINT flags;
653  MC_HTREELISTITEM hItem;
656  int iSubItem;
658 
672 typedef struct MC_NMTREELIST_tag {
674  NMHDR hdr;
676  UINT action;
678  MC_HTREELISTITEM hItemOld;
680  LPARAM lParamOld;
682  MC_HTREELISTITEM hItemNew;
684  LPARAM lParamNew;
685 } MC_NMTREELIST;
686 
694 
701 #define MC_TLM_INSERTCOLUMNW (MC_TLM_FIRST + 0)
702 
709 #define MC_TLM_INSERTCOLUMNA (MC_TLM_FIRST + 1)
710 
717 #define MC_TLM_SETCOLUMNW (MC_TLM_FIRST + 2)
718 
725 #define MC_TLM_SETCOLUMNA (MC_TLM_FIRST + 3)
726 
733 #define MC_TLM_GETCOLUMNW (MC_TLM_FIRST + 4)
734 
741 #define MC_TLM_GETCOLUMNA (MC_TLM_FIRST + 5)
742 
749 #define MC_TLM_DELETECOLUMN (MC_TLM_FIRST + 6)
750 
758 #define MC_TLM_SETCOLUMNORDERARRAY (MC_TLM_FIRST + 7)
759 
768 #define MC_TLM_GETCOLUMNORDERARRAY (MC_TLM_FIRST + 8)
769 
776 #define MC_TLM_SETCOLUMNWIDTH (MC_TLM_FIRST + 9)
777 
784 #define MC_TLM_GETCOLUMNWIDTH (MC_TLM_FIRST + 10)
785 
799 #define MC_TLM_INSERTITEMW (MC_TLM_FIRST + 11)
800 
814 #define MC_TLM_INSERTITEMA (MC_TLM_FIRST + 12)
815 
823 #define MC_TLM_SETITEMW (MC_TLM_FIRST + 13)
824 
832 #define MC_TLM_SETITEMA (MC_TLM_FIRST + 14)
833 
848 #define MC_TLM_GETITEMW (MC_TLM_FIRST + 15)
849 
864 #define MC_TLM_GETITEMA (MC_TLM_FIRST + 16)
865 
877 #define MC_TLM_DELETEITEM (MC_TLM_FIRST + 17)
878 
890 #define MC_TLM_SETITEMHEIGHT (MC_TLM_FIRST + 18)
891 
898 #define MC_TLM_GETITEMHEIGHT (MC_TLM_FIRST + 19)
899 
907 #define MC_TLM_SETSUBITEMW (MC_TLM_FIRST + 20)
908 
916 #define MC_TLM_SETSUBITEMA (MC_TLM_FIRST + 21)
917 
933 #define MC_TLM_GETSUBITEMW (MC_TLM_FIRST + 22)
934 
950 #define MC_TLM_GETSUBITEMA (MC_TLM_FIRST + 23)
951 
958 #define MC_TLM_SETINDENT (MC_TLM_FIRST + 24)
959 
966 #define MC_TLM_GETINDENT (MC_TLM_FIRST + 25)
967 
976 #define MC_TLM_HITTEST (MC_TLM_FIRST + 26)
977 
984 #define MC_TLM_EXPAND (MC_TLM_FIRST + 27)
985 
994 #define MC_TLM_GETNEXTITEM (MC_TLM_FIRST + 28)
995 
1002 #define MC_TLM_GETVISIBLECOUNT (MC_TLM_FIRST + 29)
1003 
1012 #define MC_TLM_ENSUREVISIBLE (MC_TLM_FIRST + 30)
1013 
1025 #define MC_TLM_SETIMAGELIST (MC_TLM_FIRST + 31)
1026 
1034 #define MC_TLM_GETIMAGELIST (MC_TLM_FIRST + 32)
1035 
1043 
1044 
1056 #define MC_TLN_DELETEITEM (MC_TLN_FIRST + 0)
1057 
1072 #define MC_TLN_SELCHANGING (MC_TLN_FIRST + 1)
1073 
1087 #define MC_TLN_SELCHANGED (MC_TLN_FIRST + 2)
1088 
1103 #define MC_TLN_EXPANDING (MC_TLN_FIRST + 3)
1104 
1118 #define MC_TLN_EXPANDED (MC_TLN_FIRST + 4)
1119 
1127 
1129 #define MC_WC_TREELIST MCTRL_NAME_AW(MC_WC_TREELIST)
1130 
1131 #define MC_TLCOLUMN MCTRL_NAME_AW(MC_TLCOLUMN)
1132 
1133 #define MC_TLITEM MCTRL_NAME_AW(MC_TLITEM)
1134 
1135 #define MC_TLSUBITEM MCTRL_NAME_AW(MC_TLSUBITEM)
1136 
1137 #define MC_TLINSERTSTRUCT MCTRL_NAME_AW(MC_TLINSERTSTRUCT)
1138 
1139 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1140 
1141 #define MC_TLM_INSERTCOLUMN MCTRL_NAME_AW(MC_TLM_INSERTCOLUMN)
1142 
1143 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1144 
1145 #define MC_TLM_GETCOLUMN MCTRL_NAME_AW(MC_TLM_GETCOLUMN)
1146 
1147 #define MC_TLM_INSERTITEM MCTRL_NAME_AW(MC_TLM_INSERTITEM)
1148 
1149 #define MC_TLM_SETITEM MCTRL_NAME_AW(MC_TLM_SETITEM)
1150 
1151 #define MC_TLM_GETITEM MCTRL_NAME_AW(MC_TLM_GETITEM)
1152 
1153 #define MC_TLM_SETSUBITEM MCTRL_NAME_AW(MC_TLM_SETSUBITEM)
1154 
1155 #define MC_TLM_GETSUBITEM MCTRL_NAME_AW(MC_TLM_GETSUBITEM)
1156 
1160 #ifdef __cplusplus
1161 } /* extern "C" */
1162 #endif
1163 
1164 #endif /* MCTRL_TREELIST_H */