mCtrl  0.9.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 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 
116 
123 
128 
135 
137 #define MC_WC_TREELISTW L"mCtrl.treelist"
138 
139 #define MC_WC_TREELISTA "mCtrl.treelist"
140 
148 
152 #define MC_TLS_HASBUTTONS 0x0001
153 
154 #define MC_TLS_HASLINES 0x0002
155 
158 #define MC_TLS_LINESATROOT 0x0004
159 #if 0 /* TODO */
160 #define MC_TLS_GRIDLINES 0x0008
161 #endif
162 
163 #define MC_TLS_SHOWSELALWAYS 0x0010
164 
166 #define MC_TLS_FULLROWSELECT 0x0020
167 
169 #define MC_TLS_NONEVENHEIGHT 0x0040
170 
171 #define MC_TLS_DOUBLEBUFFER 0x0080
172 
173 #define MC_TLS_NOCOLUMNHEADER 0x0100
174 
176 #define MC_TLS_HEADERDRAGDROP 0x0200
177 
179 #define MC_TLS_SINGLEEXPAND 0x0400
180 #if 0 /* TODO */
181 #define MC_TLS_NOTOOLTIPS 0x0800
182 #define MC_TLS_SHAREDIMAGELISTS 0x1000
183 #define MC_TLS_CHECKBOXES 0x2000
184 #define MC_TLS_EDITLABELS 0x4000
185 #endif
186 
195 
197 #define MC_TLCF_FORMAT (1 << 0)
198 
199 #define MC_TLCF_WIDTH (1 << 1)
200 
202 #define MC_TLCF_TEXT (1 << 2)
203 
204 #define MC_TLCF_IMAGE (1 << 3)
205 
206 #define MC_TLCF_ORDER (1 << 4)
207 
216 
218 #define MC_TLFMT_LEFT 0x0
219 
220 #define MC_TLFMT_RIGHT 0x1
221 
222 #define MC_TLFMT_CENTER 0x2
223 
224 #define MC_TLFMT_JUSTIFYMASK 0x3
225 
234 
240 #define MC_TLI_ROOT ((MC_HTREELISTITEM)(ULONG_PTR) -0x10000)
241 
247 #define MC_TLI_FIRST ((MC_HTREELISTITEM)(ULONG_PTR) -0xffff)
248 
254 #define MC_TLI_LAST ((MC_HTREELISTITEM)(ULONG_PTR) -0xfffe)
255 
264 
266 #define MC_TLIF_STATE (1 << 0)
267 
268 #define MC_TLIF_TEXT (1 << 1)
269 
270 #define MC_TLIF_LPARAM (1 << 2)
271 
272 #define MC_TLIF_IMAGE (1 << 3)
273 
274 #define MC_TLIF_SELECTEDIMAGE (1 << 4)
275 
276 #define MC_TLIF_EXPANDEDIMAGE (1 << 5)
277 
286 
288 #define MC_TLIS_SELECTED (1 << 1)
289 
290 #define MC_TLIS_EXPANDED (1 << 5)
291 
300 
303 #define MC_TLSIF_TEXT (1 << 1)
304 
313 
315 #define MC_TLHT_NOWHERE (1 << 0)
316 
317 #define MC_TLHT_ONITEMICON (1 << 1)
318 
319 #define MC_TLHT_ONITEMSTATEICON (1 << 2)
320 
321 #define MC_TLHT_ONITEMLABEL (1 << 3)
322 
323 #define MC_TLHT_ONITEM (MC_TLHT_ONITEMICON | MC_TLHT_ONITEMSTATEICON | MC_TLHT_ONITEMLABEL)
324 
325 #define MC_TLHT_ONITEMINDENT (1 << 4)
326 
327 #define MC_TLHT_ONITEMBUTTON (1 << 5)
328 
329 #define MC_TLHT_ONITEMRIGHT (1 << 6)
330 
332 #define MC_TLHT_ONITEMLEFT (1 << 7)
333 
334 #define MC_TLHT_ABOVE (1 << 8)
335 
336 #define MC_TLHT_BELOW (1 << 9)
337 
338 #define MC_TLHT_TORIGHT (1 << 10)
339 
340 #define MC_TLHT_TOLEFT (1 << 11)
341 
350 
352 #define MC_TLE_COLLAPSE 0x1
353 
354 #define MC_TLE_EXPAND 0x2
355 
356 #define MC_TLE_TOGGLE 0x3
357 
366 
368 #define MC_TLGN_ROOT 0x0
369 
371 #define MC_TLGN_NEXT 0x1
372 
374 #define MC_TLGN_PREVIOUS 0x2
375 
377 #define MC_TLGN_PARENT 0x3
378 
380 #define MC_TLGN_CHILD 0x4
381 
384 #define MC_TLGN_FIRSTVISIBLE 0x5
385 
389 #define MC_TLGN_NEXTVISIBLE 0x6
390 
396 #define MC_TLGN_PREVIOUSVISIBLE 0x7
397 
398 #define MC_TLGN_CARET 0x9
399 
403 #define MC_TLGN_LASTVISIBLE 0xa
404 
412 
417 typedef struct MC_TLCOLUMNW_tag {
420  UINT fMask;
424  int fmt;
426  int cx;
428  WCHAR* pszText;
432  int iImage;
434  int iOrder;
435 } MC_TLCOLUMNW;
436 
441 typedef struct MC_TLCOLUMNA_tag {
444  UINT fMask;
448  int fmt;
450  int cx;
452  char* pszText;
456  int iImage;
458  int iOrder;
459 } MC_TLCOLUMNA;
460 
464 typedef void* MC_HTREELISTITEM;
465 
466 
471 typedef struct MC_TLITEMW_tag {
474  UINT fMask;
476  UINT state;
479  UINT stateMask;
481  WCHAR* pszText;
486  LPARAM lParam;
488  int iImage;
493 } MC_TLITEMW;
494 
499 typedef struct MC_TLITEMA_tag {
502  UINT fMask;
504  UINT state;
507  UINT stateMask;
509  char* pszText;
514  LPARAM lParam;
516  int iImage;
521 } MC_TLITEMA;
522 
527 typedef struct MC_TLSUBITEMW_tag {
530  UINT fMask;
532  int iSubItem;
534  WCHAR* pszText;
538 } MC_TLSUBITEMW;
539 
544 typedef struct MC_TLSUBITEMA_tag {
547  UINT fMask;
549  int iSubItem;
551  char* pszText;
555 } MC_TLSUBITEMA;
556 
561 typedef struct MC_TLINSERTSTRUCTW_tag {
563  MC_HTREELISTITEM hParent;
566  MC_HTREELISTITEM hInsertAfter;
570 
575 typedef struct MC_TLINSERTSTRUCTA_tag {
577  MC_HTREELISTITEM hParent;
580  MC_HTREELISTITEM hInsertAfter;
584 
588 typedef struct MC_TLHITTESTINFO_tag {
590  POINT pt;
592  UINT flags;
594  MC_HTREELISTITEM hItem;
597  int iSubItem;
599 
607 
614 #define MC_TLM_INSERTCOLUMNW (MC_TLM_FIRST + 0)
615 
622 #define MC_TLM_INSERTCOLUMNA (MC_TLM_FIRST + 1)
623 
630 #define MC_TLM_SETCOLUMNW (MC_TLM_FIRST + 2)
631 
638 #define MC_TLM_SETCOLUMNA (MC_TLM_FIRST + 3)
639 
646 #define MC_TLM_GETCOLUMNW (MC_TLM_FIRST + 4)
647 
654 #define MC_TLM_GETCOLUMNA (MC_TLM_FIRST + 5)
655 
662 #define MC_TLM_DELETECOLUMN (MC_TLM_FIRST + 6)
663 
671 #define MC_TLM_SETCOLUMNORDERARRAY (MC_TLM_FIRST + 7)
672 
681 #define MC_TLM_GETCOLUMNORDERARRAY (MC_TLM_FIRST + 8)
682 
689 #define MC_TLM_SETCOLUMNWIDTH (MC_TLM_FIRST + 9)
690 
697 #define MC_TLM_GETCOLUMNWIDTH (MC_TLM_FIRST + 10)
698 
712 #define MC_TLM_INSERTITEMW (MC_TLM_FIRST + 11)
713 
727 #define MC_TLM_INSERTITEMA (MC_TLM_FIRST + 12)
728 
736 #define MC_TLM_SETITEMW (MC_TLM_FIRST + 13)
737 
745 #define MC_TLM_SETITEMA (MC_TLM_FIRST + 14)
746 
761 #define MC_TLM_GETITEMW (MC_TLM_FIRST + 15)
762 
777 #define MC_TLM_GETITEMA (MC_TLM_FIRST + 16)
778 
790 #define MC_TLM_DELETEITEM (MC_TLM_FIRST + 17)
791 
803 #define MC_TLM_SETITEMHEIGHT (MC_TLM_FIRST + 18)
804 
811 #define MC_TLM_GETITEMHEIGHT (MC_TLM_FIRST + 19)
812 
820 #define MC_TLM_SETSUBITEMW (MC_TLM_FIRST + 20)
821 
829 #define MC_TLM_SETSUBITEMA (MC_TLM_FIRST + 21)
830 
846 #define MC_TLM_GETSUBITEMW (MC_TLM_FIRST + 22)
847 
863 #define MC_TLM_GETSUBITEMA (MC_TLM_FIRST + 23)
864 
871 #define MC_TLM_SETINDENT (MC_TLM_FIRST + 24)
872 
879 #define MC_TLM_GETINDENT (MC_TLM_FIRST + 25)
880 
889 #define MC_TLM_HITTEST (MC_TLM_FIRST + 26)
890 
897 #define MC_TLM_EXPAND (MC_TLM_FIRST + 27)
898 
907 #define MC_TLM_GETNEXTITEM (MC_TLM_FIRST + 28)
908 
915 #define MC_TLM_GETVISIBLECOUNT (MC_TLM_FIRST + 29)
916 
925 #define MC_TLM_ENSUREVISIBLE (MC_TLM_FIRST + 30)
926 
934 
936 #define MC_WC_TREELIST MCTRL_NAME_AW(MC_WC_TREELIST)
937 
938 #define MC_TLCOLUMN MCTRL_NAME_AW(MC_TLCOLUMN)
939 
940 #define MC_TLITEM MCTRL_NAME_AW(MC_TLITEM)
941 
942 #define MC_TLSUBITEM MCTRL_NAME_AW(MC_TLSUBITEM)
943 
944 #define MC_TLINSERTSTRUCT MCTRL_NAME_AW(MC_TLINSERTSTRUCT)
945 
946 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
947 
948 #define MC_TLM_INSERTCOLUMN MCTRL_NAME_AW(MC_TLM_INSERTCOLUMN)
949 
950 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
951 
952 #define MC_TLM_GETCOLUMN MCTRL_NAME_AW(MC_TLM_GETCOLUMN)
953 
954 #define MC_TLM_INSERTITEM MCTRL_NAME_AW(MC_TLM_INSERTITEM)
955 
956 #define MC_TLM_SETITEM MCTRL_NAME_AW(MC_TLM_SETITEM)
957 
958 #define MC_TLM_GETITEM MCTRL_NAME_AW(MC_TLM_GETITEM)
959 
960 #define MC_TLM_SETSUBITEM MCTRL_NAME_AW(MC_TLM_SETSUBITEM)
961 
962 #define MC_TLM_GETSUBITEM MCTRL_NAME_AW(MC_TLM_GETSUBITEM)
963 
967 #ifdef __cplusplus
968 } /* extern "C" */
969 #endif
970 
971 #endif /* MCTRL_TREELIST_H */