mCtrl  0.10.0
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 #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 #if 0 /* TODO */
256 #define MC_TLS_NOTOOLTIPS 0x1000
257 #define MC_TLS_CHECKBOXES 0x2000
258 #define MC_TLS_EDITLABELS 0x4000
259 #define MC_TLS_EDITSUBLABELS 0x8000
260 #endif
261 
270 
272 #define MC_TLCF_FORMAT (1 << 0)
273 
274 #define MC_TLCF_WIDTH (1 << 1)
275 
277 #define MC_TLCF_TEXT (1 << 2)
278 
279 #define MC_TLCF_IMAGE (1 << 3)
280 
281 #define MC_TLCF_ORDER (1 << 4)
282 
291 
293 #define MC_TLFMT_LEFT 0x0
294 
295 #define MC_TLFMT_RIGHT 0x1
296 
297 #define MC_TLFMT_CENTER 0x2
298 
299 #define MC_TLFMT_JUSTIFYMASK 0x3
300 
309 
315 #define MC_TLI_ROOT ((MC_HTREELISTITEM)(ULONG_PTR) -0x10000)
316 
322 #define MC_TLI_FIRST ((MC_HTREELISTITEM)(ULONG_PTR) -0xffff)
323 
329 #define MC_TLI_LAST ((MC_HTREELISTITEM)(ULONG_PTR) -0xfffe)
330 
339 
341 #define MC_TLIF_STATE (1 << 0)
342 
343 #define MC_TLIF_TEXT (1 << 1)
344 
345 #define MC_TLIF_PARAM (1 << 2)
346 
348 #define MC_TLIF_LPARAM (1 << 2)
349 
350 #define MC_TLIF_IMAGE (1 << 3)
351 
352 #define MC_TLIF_SELECTEDIMAGE (1 << 4)
353 
354 #define MC_TLIF_EXPANDEDIMAGE (1 << 5)
355 
356 #define MC_TLIF_CHILDREN (1 << 6)
357 
365 
367 #define MC_TLIS_SELECTED (1 << 1)
368 
369 #define MC_TLIS_EXPANDED (1 << 5)
370 
374 
375 
381 
384 #define MC_TLSIF_TEXT (1 << 1)
385 
394 
396 #define MC_TLHT_NOWHERE (1 << 0)
397 
398 #define MC_TLHT_ONITEMICON (1 << 1)
399 
400 #define MC_TLHT_ONITEMSTATEICON (1 << 2)
401 
402 #define MC_TLHT_ONITEMLABEL (1 << 3)
403 
404 #define MC_TLHT_ONITEM (MC_TLHT_ONITEMICON | MC_TLHT_ONITEMSTATEICON | MC_TLHT_ONITEMLABEL)
405 
406 #define MC_TLHT_ONITEMINDENT (1 << 4)
407 
408 #define MC_TLHT_ONITEMBUTTON (1 << 5)
409 
410 #define MC_TLHT_ONITEMRIGHT (1 << 6)
411 
413 #define MC_TLHT_ONITEMLEFT (1 << 7)
414 
415 #define MC_TLHT_ABOVE (1 << 8)
416 
417 #define MC_TLHT_BELOW (1 << 9)
418 
419 #define MC_TLHT_TORIGHT (1 << 10)
420 
421 #define MC_TLHT_TOLEFT (1 << 11)
422 
431 
433 #define MC_TLE_COLLAPSE 0x1
434 
435 #define MC_TLE_EXPAND 0x2
436 
437 #define MC_TLE_TOGGLE 0x3
438 
440 #define MC_TLE_COLLAPSERESET 0x8000
441 
450 
452 #define MC_TLGN_ROOT 0x0
453 
455 #define MC_TLGN_NEXT 0x1
456 
458 #define MC_TLGN_PREVIOUS 0x2
459 
461 #define MC_TLGN_PARENT 0x3
462 
464 #define MC_TLGN_CHILD 0x4
465 
468 #define MC_TLGN_FIRSTVISIBLE 0x5
469 
473 #define MC_TLGN_NEXTVISIBLE 0x6
474 
480 #define MC_TLGN_PREVIOUSVISIBLE 0x7
481 
487 #define MC_TLGN_CARET 0x9
488 
492 #define MC_TLGN_LASTVISIBLE 0xa
493 
501 
506 typedef struct MC_TLCOLUMNW_tag {
509  UINT fMask;
513  int fmt;
515  int cx;
517  WCHAR* pszText;
521  int iImage;
523  int iOrder;
524 } MC_TLCOLUMNW;
525 
530 typedef struct MC_TLCOLUMNA_tag {
533  UINT fMask;
537  int fmt;
539  int cx;
541  char* pszText;
545  int iImage;
547  int iOrder;
548 } MC_TLCOLUMNA;
549 
553 typedef void* MC_HTREELISTITEM;
554 
555 
560 typedef struct MC_TLITEMW_tag {
563  UINT fMask;
565  UINT state;
568  UINT stateMask;
570  WCHAR* pszText;
575  LPARAM lParam;
577  int iImage;
586 } MC_TLITEMW;
587 
592 typedef struct MC_TLITEMA_tag {
595  UINT fMask;
597  UINT state;
600  UINT stateMask;
602  char* pszText;
607  LPARAM lParam;
609  int iImage;
618 } MC_TLITEMA;
619 
624 typedef struct MC_TLSUBITEMW_tag {
627  UINT fMask;
629  int iSubItem;
631  WCHAR* pszText;
635 } MC_TLSUBITEMW;
636 
641 typedef struct MC_TLSUBITEMA_tag {
644  UINT fMask;
646  int iSubItem;
648  char* pszText;
652 } MC_TLSUBITEMA;
653 
658 typedef struct MC_TLINSERTSTRUCTW_tag {
660  MC_HTREELISTITEM hParent;
663  MC_HTREELISTITEM hInsertAfter;
667 
672 typedef struct MC_TLINSERTSTRUCTA_tag {
674  MC_HTREELISTITEM hParent;
677  MC_HTREELISTITEM hInsertAfter;
681 
685 typedef struct MC_TLHITTESTINFO_tag {
687  POINT pt;
689  UINT flags;
691  MC_HTREELISTITEM hItem;
694  int iSubItem;
696 
710 typedef struct MC_NMTREELIST_tag {
712  NMHDR hdr;
714  UINT action;
716  MC_HTREELISTITEM hItemOld;
718  LPARAM lParamOld;
720  MC_HTREELISTITEM hItemNew;
722  LPARAM lParamNew;
723 } MC_NMTREELIST;
724 
728 typedef struct MC_NMTLCUSTOMDRAW_tag {
733  int iLevel;
736  int iSubItem;
738  COLORREF clrText;
740  COLORREF clrTextBk;
742 
747 typedef struct MC_NMTLDISPINFOW_tag {
749  NMHDR hdr;
751  MC_HTREELISTITEM hItem;
755 
760 typedef struct MC_NMTLDISPINFOA_tag {
762  NMHDR hdr;
764  MC_HTREELISTITEM hItem;
768 
773 typedef struct MC_NMTLSUBDISPINFOW_tag {
775  NMHDR hdr;
777  MC_HTREELISTITEM hItem;
779  LPARAM lItemParam;
783 
788 typedef struct MC_NMTLSUBDISPINFOA_tag {
790  NMHDR hdr;
792  MC_HTREELISTITEM hItem;
794  LPARAM lItemParam;
798 
806 
813 #define MC_TLM_INSERTCOLUMNW (MC_TLM_FIRST + 0)
814 
821 #define MC_TLM_INSERTCOLUMNA (MC_TLM_FIRST + 1)
822 
829 #define MC_TLM_SETCOLUMNW (MC_TLM_FIRST + 2)
830 
837 #define MC_TLM_SETCOLUMNA (MC_TLM_FIRST + 3)
838 
845 #define MC_TLM_GETCOLUMNW (MC_TLM_FIRST + 4)
846 
853 #define MC_TLM_GETCOLUMNA (MC_TLM_FIRST + 5)
854 
861 #define MC_TLM_DELETECOLUMN (MC_TLM_FIRST + 6)
862 
870 #define MC_TLM_SETCOLUMNORDERARRAY (MC_TLM_FIRST + 7)
871 
880 #define MC_TLM_GETCOLUMNORDERARRAY (MC_TLM_FIRST + 8)
881 
888 #define MC_TLM_SETCOLUMNWIDTH (MC_TLM_FIRST + 9)
889 
896 #define MC_TLM_GETCOLUMNWIDTH (MC_TLM_FIRST + 10)
897 
912 #define MC_TLM_INSERTITEMW (MC_TLM_FIRST + 11)
913 
928 #define MC_TLM_INSERTITEMA (MC_TLM_FIRST + 12)
929 
937 #define MC_TLM_SETITEMW (MC_TLM_FIRST + 13)
938 
946 #define MC_TLM_SETITEMA (MC_TLM_FIRST + 14)
947 
962 #define MC_TLM_GETITEMW (MC_TLM_FIRST + 15)
963 
978 #define MC_TLM_GETITEMA (MC_TLM_FIRST + 16)
979 
991 #define MC_TLM_DELETEITEM (MC_TLM_FIRST + 17)
992 
1004 #define MC_TLM_SETITEMHEIGHT (MC_TLM_FIRST + 18)
1005 
1012 #define MC_TLM_GETITEMHEIGHT (MC_TLM_FIRST + 19)
1013 
1021 #define MC_TLM_SETSUBITEMW (MC_TLM_FIRST + 20)
1022 
1030 #define MC_TLM_SETSUBITEMA (MC_TLM_FIRST + 21)
1031 
1047 #define MC_TLM_GETSUBITEMW (MC_TLM_FIRST + 22)
1048 
1064 #define MC_TLM_GETSUBITEMA (MC_TLM_FIRST + 23)
1065 
1072 #define MC_TLM_SETINDENT (MC_TLM_FIRST + 24)
1073 
1080 #define MC_TLM_GETINDENT (MC_TLM_FIRST + 25)
1081 
1090 #define MC_TLM_HITTEST (MC_TLM_FIRST + 26)
1091 
1098 #define MC_TLM_EXPAND (MC_TLM_FIRST + 27)
1099 
1108 #define MC_TLM_GETNEXTITEM (MC_TLM_FIRST + 28)
1109 
1116 #define MC_TLM_GETVISIBLECOUNT (MC_TLM_FIRST + 29)
1117 
1126 #define MC_TLM_ENSUREVISIBLE (MC_TLM_FIRST + 30)
1127 
1140 #define MC_TLM_SETIMAGELIST (MC_TLM_FIRST + 31)
1141 
1149 #define MC_TLM_GETIMAGELIST (MC_TLM_FIRST + 32)
1150 
1158 #define MC_TLM_GETSELECTEDCOUNT (MC_TLM_FIRST + 33)
1159 
1167 
1179 #define MC_TLN_DELETEITEM (MC_TLN_FIRST + 0)
1180 
1200 #define MC_TLN_SELCHANGING (MC_TLN_FIRST + 1)
1201 
1220 #define MC_TLN_SELCHANGED (MC_TLN_FIRST + 2)
1221 
1236 #define MC_TLN_EXPANDING (MC_TLN_FIRST + 3)
1237 
1251 #define MC_TLN_EXPANDED (MC_TLN_FIRST + 4)
1252 
1253 #if 0
1254 #define MC_TLN_SETDISPINFOW (MC_TLN_FIRST + 5)
1255 #define MC_TLN_SETDISPINFOA (MC_TLN_FIRST + 6)
1256 #endif
1257 
1281 #define MC_TLN_GETDISPINFOW (MC_TLN_FIRST + 7)
1282 
1306 #define MC_TLN_GETDISPINFOA (MC_TLN_FIRST + 8)
1307 
1308 #if 0
1309 #define MC_TLN_SETSUBDISPINFOW (MC_TLN_FIRST + 9)
1310 #define MC_TLN_SETSUBDISPINFOA (MC_TLN_FIRST + 10)
1311 #endif
1312 
1336 #define MC_TLN_GETSUBDISPINFOW (MC_TLN_FIRST + 11)
1337 
1361 #define MC_TLN_GETSUBDISPINFOA (MC_TLN_FIRST + 12)
1362 
1370 
1372 #define MC_WC_TREELIST MCTRL_NAME_AW(MC_WC_TREELIST)
1373 
1374 #define MC_TLCOLUMN MCTRL_NAME_AW(MC_TLCOLUMN)
1375 
1376 #define MC_TLITEM MCTRL_NAME_AW(MC_TLITEM)
1377 
1378 #define MC_TLSUBITEM MCTRL_NAME_AW(MC_TLSUBITEM)
1379 
1380 #define MC_TLINSERTSTRUCT MCTRL_NAME_AW(MC_TLINSERTSTRUCT)
1381 
1382 #define MC_NMTLDISPINFO MCTRL_NAME_AW(MC_NMTLDISPINFO)
1383 
1384 #define MC_NMTLSUBDISPINFO MCTRL_NAME_AW(MC_NMTLSUBDISPINFO)
1385 
1386 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1387 
1388 #define MC_TLM_INSERTCOLUMN MCTRL_NAME_AW(MC_TLM_INSERTCOLUMN)
1389 
1390 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1391 
1392 #define MC_TLM_GETCOLUMN MCTRL_NAME_AW(MC_TLM_GETCOLUMN)
1393 
1394 #define MC_TLM_INSERTITEM MCTRL_NAME_AW(MC_TLM_INSERTITEM)
1395 
1396 #define MC_TLM_SETITEM MCTRL_NAME_AW(MC_TLM_SETITEM)
1397 
1398 #define MC_TLM_GETITEM MCTRL_NAME_AW(MC_TLM_GETITEM)
1399 
1400 #define MC_TLM_SETSUBITEM MCTRL_NAME_AW(MC_TLM_SETSUBITEM)
1401 
1402 #define MC_TLM_GETSUBITEM MCTRL_NAME_AW(MC_TLM_GETSUBITEM)
1403 
1404 #define MC_TLN_SETDISPINFO MCTRL_NAME_AW(MC_TLN_SETDISPINFO)
1405 
1406 #define MC_TLN_GETDISPINFO MCTRL_NAME_AW(MC_TLN_GETDISPINFO)
1407 
1408 #define MC_TLN_SETSUBDISPINFO MCTRL_NAME_AW(MC_TLN_SETSUBDISPINFO)
1409 
1410 #define MC_TLN_GETSUBDISPINFO MCTRL_NAME_AW(MC_TLN_GETSUBDISPINFO)
1411 
1415 #ifdef __cplusplus
1416 } /* extern "C" */
1417 #endif
1418 
1419 #endif /* MCTRL_TREELIST_H */
int iImage
Definition: treelist.h:577
#define MCTRL_API
Definition: _defs.h:46
int cchTextMax
Definition: treelist.h:519
MC_TLITEMA item
Definition: treelist.h:766
int iLevel
Definition: treelist.h:733
MC_HTREELISTITEM hParent
Definition: treelist.h:660
MC_HTREELISTITEM hItem
Definition: treelist.h:792
int cx
Definition: treelist.h:539
NMHDR hdr
Definition: treelist.h:790
Structure used by notifications MC_TLN_GETSUBDISPINFO and MC_TLN_SETSUBDISPINFO (ANSI variant)...
Definition: treelist.h:788
Structure used by notifications MC_TLN_GETSUBDISPINFO and MC_TLN_SETSUBDISPINFO (Unicode variant)...
Definition: treelist.h:773
WCHAR * pszText
Definition: treelist.h:570
Structure used by notifications MC_TLN_GETDISPINFO and MC_TLN_SETDISPINFO (Unicode variant)...
Definition: treelist.h:747
Structure used by notifications MC_TLN_GETDISPINFO and MC_TLN_SETDISPINFO (ANSI variant).
Definition: treelist.h:760
Structure describing item of the tree-list view (Unicode variant).
Definition: treelist.h:560
Structure describing item of the tree-list view (ANSI variant).
Definition: treelist.h:592
void * MC_HTREELISTITEM
Opaque handle type representing item of the control.
Definition: treelist.h:553
UINT fMask
Definition: treelist.h:509
UINT action
Definition: treelist.h:714
int iOrder
Definition: treelist.h:547
void mcTreeList_Terminate(void)
int cchTextMax
Definition: treelist.h:543
NMHDR hdr
Definition: treelist.h:775
int iImage
Definition: treelist.h:609
MC_HTREELISTITEM hInsertAfter
Definition: treelist.h:663
int iSelectedImage
Definition: treelist.h:611
WCHAR * pszText
Definition: treelist.h:517
char * pszText
Definition: treelist.h:648
int cchTextMax
Definition: treelist.h:573
MC_HTREELISTITEM hItemNew
Definition: treelist.h:720
NMHDR hdr
Definition: treelist.h:762
Structure used by the standard notification NM_CUSTOMDRAW.
Definition: treelist.h:728
int iExpandedImage
Definition: treelist.h:613
MC_TLITEMW item
Definition: treelist.h:753
int iSelectedImage
Definition: treelist.h:579
UINT flags
Definition: treelist.h:689
int iExpandedImage
Definition: treelist.h:581
LPARAM lItemParam
Definition: treelist.h:779
MC_HTREELISTITEM hItem
Definition: treelist.h:691
Structure describing subitem of the tree-list view (ANSI variant).
Definition: treelist.h:641
UINT fMask
Definition: treelist.h:627
Structure describing subitem of the tree-list view (Unicode variant).
Definition: treelist.h:624
Structure used by many control notifications.
Definition: treelist.h:710
int fmt
Definition: treelist.h:513
LPARAM lParamNew
Definition: treelist.h:722
char * pszText
Definition: treelist.h:541
int cx
Definition: treelist.h:515
WCHAR * pszText
Definition: treelist.h:631
COLORREF clrText
Definition: treelist.h:738
LPARAM lParamOld
Definition: treelist.h:718
NMHDR hdr
Definition: treelist.h:712
MC_TLSUBITEMW subitem
Definition: treelist.h:781
int iImage
Definition: treelist.h:521
int cChildren
Definition: treelist.h:617
UINT state
Definition: treelist.h:597
UINT state
Definition: treelist.h:565
COLORREF clrTextBk
Definition: treelist.h:740
MC_HTREELISTITEM hItemOld
Definition: treelist.h:716
int cchTextMax
Definition: treelist.h:634
MC_HTREELISTITEM hParent
Definition: treelist.h:674
int iImage
Definition: treelist.h:545
MC_HTREELISTITEM hItem
Definition: treelist.h:777
int iSubItem
Definition: treelist.h:629
MC_HTREELISTITEM hInsertAfter
Definition: treelist.h:677
int iSubItem
Definition: treelist.h:646
int cchTextMax
Definition: treelist.h:651
MC_TLITEMW item
Definition: treelist.h:665
LPARAM lParam
Definition: treelist.h:607
BOOL mcTreeList_Initialize(void)
MC_NMCUSTOMDRAW nmcd
Definition: treelist.h:730
Equivalent of NMCUSTOMDRAWINFO from .
Definition: _common.h:108
Structure for message MC_MTM_HITTEST.
Definition: treelist.h:685
MC_TLITEMA item
Definition: treelist.h:679
LPARAM lParam
Definition: treelist.h:575
Structure describing column of the tree-list view (ANSI variant).
Definition: treelist.h:530
Structure describing column of the tree-list view (Unicode variant).
Definition: treelist.h:506
int cchTextMax
Definition: treelist.h:605
char * pszText
Definition: treelist.h:602
int iOrder
Definition: treelist.h:523
UINT stateMask
Definition: treelist.h:568
UINT stateMask
Definition: treelist.h:600
Structure used for inserting an item (Unicode variant).
Definition: treelist.h:658
Structure used for inserting an item (ANSI variant).
Definition: treelist.h:672
POINT pt
Definition: treelist.h:687
UINT fMask
Definition: treelist.h:595
MC_HTREELISTITEM hItem
Definition: treelist.h:764
UINT fMask
Definition: treelist.h:644
int fmt
Definition: treelist.h:537
UINT fMask
Definition: treelist.h:563
UINT fMask
Definition: treelist.h:533
MC_TLSUBITEMA subitem
Definition: treelist.h:796
MC_HTREELISTITEM hItem
Definition: treelist.h:751
int iSubItem
Definition: treelist.h:694
LPARAM lItemParam
Definition: treelist.h:794
int iSubItem
Definition: treelist.h:736
int cChildren
Definition: treelist.h:585
Common definitions.
Common constants and types.
NMHDR hdr
Definition: treelist.h:749