mCtrl  0.11.1
treelist.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Martin Mitas
3  *
4  * This library is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation; either version 2.1 of the License, or
7  * (at your option) any later version.
8  *
9  * This library 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 Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; 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 #include <mCtrl/_common.h>
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 
184 
191 
196 
203 
205 #define MC_WC_TREELISTW L"mCtrl.treelist"
206 
207 #define MC_WC_TREELISTA "mCtrl.treelist"
208 
216 
220 #define MC_TLS_HASBUTTONS 0x0001
221 
222 #define MC_TLS_HASLINES 0x0002
223 
226 #define MC_TLS_LINESATROOT 0x0004
227 
228 #define MC_TLS_GRIDLINES 0x0008
229 
230 #define MC_TLS_SHOWSELALWAYS 0x0010
231 
233 #define MC_TLS_FULLROWSELECT 0x0020
234 
236 #define MC_TLS_NONEVENHEIGHT 0x0040
237 
238 #define MC_TLS_DOUBLEBUFFER 0x0080
239 
240 #define MC_TLS_NOCOLUMNHEADER 0x0100
241 
243 #define MC_TLS_HEADERDRAGDROP 0x0200
244 
249 #define MC_TLS_SINGLEEXPAND 0x0400
250 
253 #define MC_TLS_MULTISELECT 0x0800
254 
255 #define MC_TLS_NOTOOLTIPS 0x1000
256 
257 #if 0 /* TODO */
258 #define MC_TLS_CHECKBOXES 0x2000
259 #define MC_TLS_EDITLABELS 0x4000
260 #define MC_TLS_EDITSUBLABELS 0x8000
261 #endif
262 
271 
273 #define MC_TLCF_FORMAT (1 << 0)
274 
275 #define MC_TLCF_WIDTH (1 << 1)
276 
278 #define MC_TLCF_TEXT (1 << 2)
279 
280 #define MC_TLCF_IMAGE (1 << 3)
281 
282 #define MC_TLCF_ORDER (1 << 4)
283 
292 
294 #define MC_TLFMT_LEFT 0x0
295 
296 #define MC_TLFMT_RIGHT 0x1
297 
298 #define MC_TLFMT_CENTER 0x2
299 
300 #define MC_TLFMT_JUSTIFYMASK 0x3
301 
310 
316 #define MC_TLI_ROOT ((MC_HTREELISTITEM)(ULONG_PTR) -0x10000)
317 
323 #define MC_TLI_FIRST ((MC_HTREELISTITEM)(ULONG_PTR) -0xffff)
324 
330 #define MC_TLI_LAST ((MC_HTREELISTITEM)(ULONG_PTR) -0xfffe)
331 
340 
342 #define MC_TLIF_STATE (1 << 0)
343 
344 #define MC_TLIF_TEXT (1 << 1)
345 
346 #define MC_TLIF_PARAM (1 << 2)
347 
349 #define MC_TLIF_LPARAM (1 << 2)
350 
351 #define MC_TLIF_IMAGE (1 << 3)
352 
353 #define MC_TLIF_SELECTEDIMAGE (1 << 4)
354 
355 #define MC_TLIF_EXPANDEDIMAGE (1 << 5)
356 
357 #define MC_TLIF_CHILDREN (1 << 6)
358 
366 
368 #define MC_TLIS_SELECTED (1 << 1)
369 
370 #define MC_TLIS_EXPANDED (1 << 5)
371 
375 
376 
382 
385 #define MC_TLSIF_TEXT (1 << 1)
386 
395 
397 #define MC_TLHT_NOWHERE (1 << 0)
398 
399 #define MC_TLHT_ONITEMICON (1 << 1)
400 
401 #define MC_TLHT_ONITEMSTATEICON (1 << 2)
402 
403 #define MC_TLHT_ONITEMLABEL (1 << 3)
404 
405 #define MC_TLHT_ONITEM (MC_TLHT_ONITEMICON | MC_TLHT_ONITEMSTATEICON | MC_TLHT_ONITEMLABEL)
406 
407 #define MC_TLHT_ONITEMINDENT (1 << 4)
408 
409 #define MC_TLHT_ONITEMBUTTON (1 << 5)
410 
411 #define MC_TLHT_ONITEMRIGHT (1 << 6)
412 
414 #define MC_TLHT_ONITEMLEFT (1 << 7)
415 
416 #define MC_TLHT_ABOVE (1 << 8)
417 
418 #define MC_TLHT_BELOW (1 << 9)
419 
420 #define MC_TLHT_TORIGHT (1 << 10)
421 
422 #define MC_TLHT_TOLEFT (1 << 11)
423 
432 
434 #define MC_TLE_COLLAPSE 0x1
435 
436 #define MC_TLE_EXPAND 0x2
437 
438 #define MC_TLE_TOGGLE 0x3
439 
441 #define MC_TLE_COLLAPSERESET 0x8000
442 
451 
453 #define MC_TLGN_ROOT 0x0
454 
456 #define MC_TLGN_NEXT 0x1
457 
459 #define MC_TLGN_PREVIOUS 0x2
460 
462 #define MC_TLGN_PARENT 0x3
463 
465 #define MC_TLGN_CHILD 0x4
466 
469 #define MC_TLGN_FIRSTVISIBLE 0x5
470 
474 #define MC_TLGN_NEXTVISIBLE 0x6
475 
481 #define MC_TLGN_PREVIOUSVISIBLE 0x7
482 
488 #define MC_TLGN_CARET 0x9
489 
493 #define MC_TLGN_LASTVISIBLE 0xa
494 
503 
506 #define MC_TLIR_BOUNDS 0
507 
508 #define MC_TLIR_ICON 1
509 
510 #define MC_TLIR_LABEL 2
511 
513 #define MC_TLIR_SELECTBOUNDS 3
514 
522 
527 typedef struct MC_TLCOLUMNW_tag {
530  UINT fMask;
534  int fmt;
536  int cx;
538  WCHAR* pszText;
542  int iImage;
544  int iOrder;
545 } MC_TLCOLUMNW;
546 
551 typedef struct MC_TLCOLUMNA_tag {
554  UINT fMask;
558  int fmt;
560  int cx;
562  char* pszText;
566  int iImage;
568  int iOrder;
569 } MC_TLCOLUMNA;
570 
574 typedef void* MC_HTREELISTITEM;
575 
576 
581 typedef struct MC_TLITEMW_tag {
584  UINT fMask;
586  UINT state;
589  UINT stateMask;
591  WCHAR* pszText;
596  LPARAM lParam;
598  int iImage;
607 } MC_TLITEMW;
608 
613 typedef struct MC_TLITEMA_tag {
616  UINT fMask;
618  UINT state;
621  UINT stateMask;
623  char* pszText;
628  LPARAM lParam;
630  int iImage;
639 } MC_TLITEMA;
640 
645 typedef struct MC_TLSUBITEMW_tag {
648  UINT fMask;
650  int iSubItem;
652  WCHAR* pszText;
656 } MC_TLSUBITEMW;
657 
662 typedef struct MC_TLSUBITEMA_tag {
665  UINT fMask;
667  int iSubItem;
669  char* pszText;
673 } MC_TLSUBITEMA;
674 
679 typedef struct MC_TLINSERTSTRUCTW_tag {
681  MC_HTREELISTITEM hParent;
684  MC_HTREELISTITEM hInsertAfter;
688 
693 typedef struct MC_TLINSERTSTRUCTA_tag {
695  MC_HTREELISTITEM hParent;
698  MC_HTREELISTITEM hInsertAfter;
702 
706 typedef struct MC_TLHITTESTINFO_tag {
708  POINT pt;
710  UINT flags;
712  MC_HTREELISTITEM hItem;
715  int iSubItem;
717 
731 typedef struct MC_NMTREELIST_tag {
733  NMHDR hdr;
735  UINT action;
737  MC_HTREELISTITEM hItemOld;
739  LPARAM lParamOld;
741  MC_HTREELISTITEM hItemNew;
743  LPARAM lParamNew;
744 } MC_NMTREELIST;
745 
749 typedef struct MC_NMTLCUSTOMDRAW_tag {
754  int iLevel;
757  int iSubItem;
759  COLORREF clrText;
761  COLORREF clrTextBk;
763 
768 typedef struct MC_NMTLDISPINFOW_tag {
770  NMHDR hdr;
772  MC_HTREELISTITEM hItem;
776 
781 typedef struct MC_NMTLDISPINFOA_tag {
783  NMHDR hdr;
785  MC_HTREELISTITEM hItem;
789 
794 typedef struct MC_NMTLSUBDISPINFOW_tag {
796  NMHDR hdr;
798  MC_HTREELISTITEM hItem;
800  LPARAM lItemParam;
804 
809 typedef struct MC_NMTLSUBDISPINFOA_tag {
811  NMHDR hdr;
813  MC_HTREELISTITEM hItem;
815  LPARAM lItemParam;
819 
827 
834 #define MC_TLM_INSERTCOLUMNW (MC_TLM_FIRST + 0)
835 
842 #define MC_TLM_INSERTCOLUMNA (MC_TLM_FIRST + 1)
843 
850 #define MC_TLM_SETCOLUMNW (MC_TLM_FIRST + 2)
851 
858 #define MC_TLM_SETCOLUMNA (MC_TLM_FIRST + 3)
859 
866 #define MC_TLM_GETCOLUMNW (MC_TLM_FIRST + 4)
867 
874 #define MC_TLM_GETCOLUMNA (MC_TLM_FIRST + 5)
875 
882 #define MC_TLM_DELETECOLUMN (MC_TLM_FIRST + 6)
883 
891 #define MC_TLM_SETCOLUMNORDERARRAY (MC_TLM_FIRST + 7)
892 
901 #define MC_TLM_GETCOLUMNORDERARRAY (MC_TLM_FIRST + 8)
902 
909 #define MC_TLM_SETCOLUMNWIDTH (MC_TLM_FIRST + 9)
910 
917 #define MC_TLM_GETCOLUMNWIDTH (MC_TLM_FIRST + 10)
918 
933 #define MC_TLM_INSERTITEMW (MC_TLM_FIRST + 11)
934 
949 #define MC_TLM_INSERTITEMA (MC_TLM_FIRST + 12)
950 
958 #define MC_TLM_SETITEMW (MC_TLM_FIRST + 13)
959 
967 #define MC_TLM_SETITEMA (MC_TLM_FIRST + 14)
968 
983 #define MC_TLM_GETITEMW (MC_TLM_FIRST + 15)
984 
999 #define MC_TLM_GETITEMA (MC_TLM_FIRST + 16)
1000 
1012 #define MC_TLM_DELETEITEM (MC_TLM_FIRST + 17)
1013 
1025 #define MC_TLM_SETITEMHEIGHT (MC_TLM_FIRST + 18)
1026 
1033 #define MC_TLM_GETITEMHEIGHT (MC_TLM_FIRST + 19)
1034 
1042 #define MC_TLM_SETSUBITEMW (MC_TLM_FIRST + 20)
1043 
1051 #define MC_TLM_SETSUBITEMA (MC_TLM_FIRST + 21)
1052 
1068 #define MC_TLM_GETSUBITEMW (MC_TLM_FIRST + 22)
1069 
1085 #define MC_TLM_GETSUBITEMA (MC_TLM_FIRST + 23)
1086 
1093 #define MC_TLM_SETINDENT (MC_TLM_FIRST + 24)
1094 
1101 #define MC_TLM_GETINDENT (MC_TLM_FIRST + 25)
1102 
1111 #define MC_TLM_HITTEST (MC_TLM_FIRST + 26)
1112 
1119 #define MC_TLM_EXPAND (MC_TLM_FIRST + 27)
1120 
1129 #define MC_TLM_GETNEXTITEM (MC_TLM_FIRST + 28)
1130 
1137 #define MC_TLM_GETVISIBLECOUNT (MC_TLM_FIRST + 29)
1138 
1147 #define MC_TLM_ENSUREVISIBLE (MC_TLM_FIRST + 30)
1148 
1161 #define MC_TLM_SETIMAGELIST (MC_TLM_FIRST + 31)
1162 
1170 #define MC_TLM_GETIMAGELIST (MC_TLM_FIRST + 32)
1171 
1179 #define MC_TLM_GETSELECTEDCOUNT (MC_TLM_FIRST + 33)
1180 
1190 #define MC_TLM_GETITEMRECT (MC_TLM_FIRST + 34)
1191 
1201 #define MC_TLM_GETSUBITEMRECT (MC_TLM_FIRST + 35)
1202 
1203 /*
1204  * @brief Associate a tooltip window with the control.
1205  * @param[in] wParam (@c HWND) Handle of the tooltip window.
1206  * @param lParam Reserved, set to zero.
1207  * @return (@c HWND) Handle of previous tooltip window or @c NULL if no tooltip
1208  * was associated with the control.
1209  * @sa MC_TLS_NOTOOLTIPS
1210  */
1211 #define MC_TLM_SETTOOLTIPS (MC_TLM_FIRST + 36)
1212 
1220 #define MC_TLM_GETTOOLTIPS (MC_TLM_FIRST + 37)
1221 
1229 
1241 #define MC_TLN_DELETEITEM (MC_TLN_FIRST + 0)
1242 
1262 #define MC_TLN_SELCHANGING (MC_TLN_FIRST + 1)
1263 
1282 #define MC_TLN_SELCHANGED (MC_TLN_FIRST + 2)
1283 
1298 #define MC_TLN_EXPANDING (MC_TLN_FIRST + 3)
1299 
1313 #define MC_TLN_EXPANDED (MC_TLN_FIRST + 4)
1314 
1315 #if 0
1316 #define MC_TLN_SETDISPINFOW (MC_TLN_FIRST + 5)
1317 #define MC_TLN_SETDISPINFOA (MC_TLN_FIRST + 6)
1318 #endif
1319 
1343 #define MC_TLN_GETDISPINFOW (MC_TLN_FIRST + 7)
1344 
1368 #define MC_TLN_GETDISPINFOA (MC_TLN_FIRST + 8)
1369 
1370 #if 0
1371 #define MC_TLN_SETSUBDISPINFOW (MC_TLN_FIRST + 9)
1372 #define MC_TLN_SETSUBDISPINFOA (MC_TLN_FIRST + 10)
1373 #endif
1374 
1398 #define MC_TLN_GETSUBDISPINFOW (MC_TLN_FIRST + 11)
1399 
1423 #define MC_TLN_GETSUBDISPINFOA (MC_TLN_FIRST + 12)
1424 
1432 
1434 #define MC_WC_TREELIST MCTRL_NAME_AW(MC_WC_TREELIST)
1435 
1436 #define MC_TLCOLUMN MCTRL_NAME_AW(MC_TLCOLUMN)
1437 
1438 #define MC_TLITEM MCTRL_NAME_AW(MC_TLITEM)
1439 
1440 #define MC_TLSUBITEM MCTRL_NAME_AW(MC_TLSUBITEM)
1441 
1442 #define MC_TLINSERTSTRUCT MCTRL_NAME_AW(MC_TLINSERTSTRUCT)
1443 
1444 #define MC_NMTLDISPINFO MCTRL_NAME_AW(MC_NMTLDISPINFO)
1445 
1446 #define MC_NMTLSUBDISPINFO MCTRL_NAME_AW(MC_NMTLSUBDISPINFO)
1447 
1448 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1449 
1450 #define MC_TLM_INSERTCOLUMN MCTRL_NAME_AW(MC_TLM_INSERTCOLUMN)
1451 
1452 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1453 
1454 #define MC_TLM_GETCOLUMN MCTRL_NAME_AW(MC_TLM_GETCOLUMN)
1455 
1456 #define MC_TLM_INSERTITEM MCTRL_NAME_AW(MC_TLM_INSERTITEM)
1457 
1458 #define MC_TLM_SETITEM MCTRL_NAME_AW(MC_TLM_SETITEM)
1459 
1460 #define MC_TLM_GETITEM MCTRL_NAME_AW(MC_TLM_GETITEM)
1461 
1462 #define MC_TLM_SETSUBITEM MCTRL_NAME_AW(MC_TLM_SETSUBITEM)
1463 
1464 #define MC_TLM_GETSUBITEM MCTRL_NAME_AW(MC_TLM_GETSUBITEM)
1465 
1466 #define MC_TLN_SETDISPINFO MCTRL_NAME_AW(MC_TLN_SETDISPINFO)
1467 
1468 #define MC_TLN_GETDISPINFO MCTRL_NAME_AW(MC_TLN_GETDISPINFO)
1469 
1470 #define MC_TLN_SETSUBDISPINFO MCTRL_NAME_AW(MC_TLN_SETSUBDISPINFO)
1471 
1472 #define MC_TLN_GETSUBDISPINFO MCTRL_NAME_AW(MC_TLN_GETSUBDISPINFO)
1473 
1477 #ifdef __cplusplus
1478 } /* extern "C" */
1479 #endif
1480 
1481 #endif /* MCTRL_TREELIST_H */
int iImage
Definition: treelist.h:598
#define MCTRL_API
Definition: _defs.h:46
int cchTextMax
Definition: treelist.h:540
MC_TLITEMA item
Definition: treelist.h:787
int iLevel
Definition: treelist.h:754
MC_HTREELISTITEM hParent
Definition: treelist.h:681
MC_HTREELISTITEM hItem
Definition: treelist.h:813
int cx
Definition: treelist.h:560
NMHDR hdr
Definition: treelist.h:811
Structure used by notifications MC_TLN_GETSUBDISPINFO and MC_TLN_SETSUBDISPINFO (ANSI variant)...
Definition: treelist.h:809
Structure used by notifications MC_TLN_GETSUBDISPINFO and MC_TLN_SETSUBDISPINFO (Unicode variant)...
Definition: treelist.h:794
WCHAR * pszText
Definition: treelist.h:591
Structure used by notifications MC_TLN_GETDISPINFO and MC_TLN_SETDISPINFO (Unicode variant)...
Definition: treelist.h:768
Structure used by notifications MC_TLN_GETDISPINFO and MC_TLN_SETDISPINFO (ANSI variant).
Definition: treelist.h:781
Structure describing item of the tree-list view (Unicode variant).
Definition: treelist.h:581
Structure describing item of the tree-list view (ANSI variant).
Definition: treelist.h:613
void * MC_HTREELISTITEM
Opaque handle type representing item of the control.
Definition: treelist.h:574
UINT fMask
Definition: treelist.h:530
UINT action
Definition: treelist.h:735
int iOrder
Definition: treelist.h:568
void mcTreeList_Terminate(void)
int cchTextMax
Definition: treelist.h:564
NMHDR hdr
Definition: treelist.h:796
int iImage
Definition: treelist.h:630
MC_HTREELISTITEM hInsertAfter
Definition: treelist.h:684
int iSelectedImage
Definition: treelist.h:632
WCHAR * pszText
Definition: treelist.h:538
char * pszText
Definition: treelist.h:669
int cchTextMax
Definition: treelist.h:594
MC_HTREELISTITEM hItemNew
Definition: treelist.h:741
NMHDR hdr
Definition: treelist.h:783
Structure used by the standard notification NM_CUSTOMDRAW.
Definition: treelist.h:749
int iExpandedImage
Definition: treelist.h:634
MC_TLITEMW item
Definition: treelist.h:774
int iSelectedImage
Definition: treelist.h:600
UINT flags
Definition: treelist.h:710
int iExpandedImage
Definition: treelist.h:602
LPARAM lItemParam
Definition: treelist.h:800
MC_HTREELISTITEM hItem
Definition: treelist.h:712
Structure describing subitem of the tree-list view (ANSI variant).
Definition: treelist.h:662
UINT fMask
Definition: treelist.h:648
Structure describing subitem of the tree-list view (Unicode variant).
Definition: treelist.h:645
Structure used by many control notifications.
Definition: treelist.h:731
int fmt
Definition: treelist.h:534
LPARAM lParamNew
Definition: treelist.h:743
char * pszText
Definition: treelist.h:562
int cx
Definition: treelist.h:536
WCHAR * pszText
Definition: treelist.h:652
COLORREF clrText
Definition: treelist.h:759
LPARAM lParamOld
Definition: treelist.h:739
NMHDR hdr
Definition: treelist.h:733
MC_TLSUBITEMW subitem
Definition: treelist.h:802
int iImage
Definition: treelist.h:542
int cChildren
Definition: treelist.h:638
UINT state
Definition: treelist.h:618
UINT state
Definition: treelist.h:586
COLORREF clrTextBk
Definition: treelist.h:761
MC_HTREELISTITEM hItemOld
Definition: treelist.h:737
int cchTextMax
Definition: treelist.h:655
MC_HTREELISTITEM hParent
Definition: treelist.h:695
int iImage
Definition: treelist.h:566
MC_HTREELISTITEM hItem
Definition: treelist.h:798
int iSubItem
Definition: treelist.h:650
MC_HTREELISTITEM hInsertAfter
Definition: treelist.h:698
int iSubItem
Definition: treelist.h:667
int cchTextMax
Definition: treelist.h:672
MC_TLITEMW item
Definition: treelist.h:686
LPARAM lParam
Definition: treelist.h:628
BOOL mcTreeList_Initialize(void)
MC_NMCUSTOMDRAW nmcd
Definition: treelist.h:751
Equivalent of NMCUSTOMDRAWINFO from <commctrl.h>.
Definition: _common.h:108
Structure for message MC_MTM_HITTEST.
Definition: treelist.h:706
MC_TLITEMA item
Definition: treelist.h:700
LPARAM lParam
Definition: treelist.h:596
Structure describing column of the tree-list view (ANSI variant).
Definition: treelist.h:551
Structure describing column of the tree-list view (Unicode variant).
Definition: treelist.h:527
int cchTextMax
Definition: treelist.h:626
char * pszText
Definition: treelist.h:623
int iOrder
Definition: treelist.h:544
UINT stateMask
Definition: treelist.h:589
UINT stateMask
Definition: treelist.h:621
Structure used for inserting an item (Unicode variant).
Definition: treelist.h:679
Structure used for inserting an item (ANSI variant).
Definition: treelist.h:693
POINT pt
Definition: treelist.h:708
UINT fMask
Definition: treelist.h:616
MC_HTREELISTITEM hItem
Definition: treelist.h:785
UINT fMask
Definition: treelist.h:665
int fmt
Definition: treelist.h:558
UINT fMask
Definition: treelist.h:584
UINT fMask
Definition: treelist.h:554
MC_TLSUBITEMA subitem
Definition: treelist.h:817
MC_HTREELISTITEM hItem
Definition: treelist.h:772
int iSubItem
Definition: treelist.h:715
LPARAM lItemParam
Definition: treelist.h:815
int iSubItem
Definition: treelist.h:757
int cChildren
Definition: treelist.h:606
Common definitions.
Common constants and types.
NMHDR hdr
Definition: treelist.h:770