mCtrl  0.9.5
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 
171 
178 
183 
190 
192 #define MC_WC_TREELISTW L"mCtrl.treelist"
193 
194 #define MC_WC_TREELISTA "mCtrl.treelist"
195 
203 
207 #define MC_TLS_HASBUTTONS 0x0001
208 
209 #define MC_TLS_HASLINES 0x0002
210 
213 #define MC_TLS_LINESATROOT 0x0004
214 
215 #define MC_TLS_GRIDLINES 0x0008
216 
217 #define MC_TLS_SHOWSELALWAYS 0x0010
218 
220 #define MC_TLS_FULLROWSELECT 0x0020
221 
223 #define MC_TLS_NONEVENHEIGHT 0x0040
224 
225 #define MC_TLS_DOUBLEBUFFER 0x0080
226 
227 #define MC_TLS_NOCOLUMNHEADER 0x0100
228 
230 #define MC_TLS_HEADERDRAGDROP 0x0200
231 
233 #define MC_TLS_SINGLEEXPAND 0x0400
234 #if 0 /* TODO */
235 #define MC_TLS_NOTOOLTIPS 0x0800
236 #define MC_TLS_CHECKBOXES 0x1000
237 #define MC_TLS_EDITLABELS 0x2000
238 #define MC_TLS_EDITSUBLABELS 0x4000
239 #endif
240 
249 
251 #define MC_TLCF_FORMAT (1 << 0)
252 
253 #define MC_TLCF_WIDTH (1 << 1)
254 
256 #define MC_TLCF_TEXT (1 << 2)
257 
258 #define MC_TLCF_IMAGE (1 << 3)
259 
260 #define MC_TLCF_ORDER (1 << 4)
261 
270 
272 #define MC_TLFMT_LEFT 0x0
273 
274 #define MC_TLFMT_RIGHT 0x1
275 
276 #define MC_TLFMT_CENTER 0x2
277 
278 #define MC_TLFMT_JUSTIFYMASK 0x3
279 
288 
294 #define MC_TLI_ROOT ((MC_HTREELISTITEM)(ULONG_PTR) -0x10000)
295 
301 #define MC_TLI_FIRST ((MC_HTREELISTITEM)(ULONG_PTR) -0xffff)
302 
308 #define MC_TLI_LAST ((MC_HTREELISTITEM)(ULONG_PTR) -0xfffe)
309 
318 
320 #define MC_TLIF_STATE (1 << 0)
321 
322 #define MC_TLIF_TEXT (1 << 1)
323 
324 #define MC_TLIF_PARAM (1 << 2)
325 
327 #define MC_TLIF_LPARAM (1 << 2)
328 
329 #define MC_TLIF_IMAGE (1 << 3)
330 
331 #define MC_TLIF_SELECTEDIMAGE (1 << 4)
332 
333 #define MC_TLIF_EXPANDEDIMAGE (1 << 5)
334 
335 #define MC_TLIF_CHILDREN (1 << 6)
336 
344 
346 #define MC_TLIS_SELECTED (1 << 1)
347 
348 #define MC_TLIS_EXPANDED (1 << 5)
349 
353 
354 
360 
363 #define MC_TLSIF_TEXT (1 << 1)
364 
373 
375 #define MC_TLHT_NOWHERE (1 << 0)
376 
377 #define MC_TLHT_ONITEMICON (1 << 1)
378 
379 #define MC_TLHT_ONITEMSTATEICON (1 << 2)
380 
381 #define MC_TLHT_ONITEMLABEL (1 << 3)
382 
383 #define MC_TLHT_ONITEM (MC_TLHT_ONITEMICON | MC_TLHT_ONITEMSTATEICON | MC_TLHT_ONITEMLABEL)
384 
385 #define MC_TLHT_ONITEMINDENT (1 << 4)
386 
387 #define MC_TLHT_ONITEMBUTTON (1 << 5)
388 
389 #define MC_TLHT_ONITEMRIGHT (1 << 6)
390 
392 #define MC_TLHT_ONITEMLEFT (1 << 7)
393 
394 #define MC_TLHT_ABOVE (1 << 8)
395 
396 #define MC_TLHT_BELOW (1 << 9)
397 
398 #define MC_TLHT_TORIGHT (1 << 10)
399 
400 #define MC_TLHT_TOLEFT (1 << 11)
401 
410 
412 #define MC_TLE_COLLAPSE 0x1
413 
414 #define MC_TLE_EXPAND 0x2
415 
416 #define MC_TLE_TOGGLE 0x3
417 
419 #define MC_TLE_COLLAPSERESET 0x8000
420 
429 
431 #define MC_TLGN_ROOT 0x0
432 
434 #define MC_TLGN_NEXT 0x1
435 
437 #define MC_TLGN_PREVIOUS 0x2
438 
440 #define MC_TLGN_PARENT 0x3
441 
443 #define MC_TLGN_CHILD 0x4
444 
447 #define MC_TLGN_FIRSTVISIBLE 0x5
448 
452 #define MC_TLGN_NEXTVISIBLE 0x6
453 
459 #define MC_TLGN_PREVIOUSVISIBLE 0x7
460 
461 #define MC_TLGN_CARET 0x9
462 
466 #define MC_TLGN_LASTVISIBLE 0xa
467 
475 
480 typedef struct MC_TLCOLUMNW_tag {
483  UINT fMask;
487  int fmt;
489  int cx;
491  WCHAR* pszText;
495  int iImage;
497  int iOrder;
498 } MC_TLCOLUMNW;
499 
504 typedef struct MC_TLCOLUMNA_tag {
507  UINT fMask;
511  int fmt;
513  int cx;
515  char* pszText;
519  int iImage;
521  int iOrder;
522 } MC_TLCOLUMNA;
523 
527 typedef void* MC_HTREELISTITEM;
528 
529 
534 typedef struct MC_TLITEMW_tag {
537  UINT fMask;
539  UINT state;
542  UINT stateMask;
544  WCHAR* pszText;
549  LPARAM lParam;
551  int iImage;
560 } MC_TLITEMW;
561 
566 typedef struct MC_TLITEMA_tag {
569  UINT fMask;
571  UINT state;
574  UINT stateMask;
576  char* pszText;
581  LPARAM lParam;
583  int iImage;
592 } MC_TLITEMA;
593 
598 typedef struct MC_TLSUBITEMW_tag {
601  UINT fMask;
603  int iSubItem;
605  WCHAR* pszText;
609 } MC_TLSUBITEMW;
610 
615 typedef struct MC_TLSUBITEMA_tag {
618  UINT fMask;
620  int iSubItem;
622  char* pszText;
626 } MC_TLSUBITEMA;
627 
632 typedef struct MC_TLINSERTSTRUCTW_tag {
634  MC_HTREELISTITEM hParent;
637  MC_HTREELISTITEM hInsertAfter;
641 
646 typedef struct MC_TLINSERTSTRUCTA_tag {
648  MC_HTREELISTITEM hParent;
651  MC_HTREELISTITEM hInsertAfter;
655 
659 typedef struct MC_TLHITTESTINFO_tag {
661  POINT pt;
663  UINT flags;
665  MC_HTREELISTITEM hItem;
668  int iSubItem;
670 
684 typedef struct MC_NMTREELIST_tag {
686  NMHDR hdr;
688  UINT action;
690  MC_HTREELISTITEM hItemOld;
692  LPARAM lParamOld;
694  MC_HTREELISTITEM hItemNew;
696  LPARAM lParamNew;
697 } MC_NMTREELIST;
698 
702 typedef struct MC_NMTLCUSTOMDRAW_tag {
707  int iLevel;
710  int iSubItem;
712  COLORREF clrText;
714  COLORREF clrTextBk;
716 
721 typedef struct MC_NMTLDISPINFOW_tag {
723  NMHDR hdr;
725  MC_HTREELISTITEM hItem;
729 
734 typedef struct MC_NMTLDISPINFOA_tag {
736  NMHDR hdr;
738  MC_HTREELISTITEM hItem;
742 
747 typedef struct MC_NMTLSUBDISPINFOW_tag {
749  NMHDR hdr;
751  MC_HTREELISTITEM hItem;
753  LPARAM lItemParam;
757 
762 typedef struct MC_NMTLSUBDISPINFOA_tag {
764  NMHDR hdr;
766  MC_HTREELISTITEM hItem;
768  LPARAM lItemParam;
772 
780 
787 #define MC_TLM_INSERTCOLUMNW (MC_TLM_FIRST + 0)
788 
795 #define MC_TLM_INSERTCOLUMNA (MC_TLM_FIRST + 1)
796 
803 #define MC_TLM_SETCOLUMNW (MC_TLM_FIRST + 2)
804 
811 #define MC_TLM_SETCOLUMNA (MC_TLM_FIRST + 3)
812 
819 #define MC_TLM_GETCOLUMNW (MC_TLM_FIRST + 4)
820 
827 #define MC_TLM_GETCOLUMNA (MC_TLM_FIRST + 5)
828 
835 #define MC_TLM_DELETECOLUMN (MC_TLM_FIRST + 6)
836 
844 #define MC_TLM_SETCOLUMNORDERARRAY (MC_TLM_FIRST + 7)
845 
854 #define MC_TLM_GETCOLUMNORDERARRAY (MC_TLM_FIRST + 8)
855 
862 #define MC_TLM_SETCOLUMNWIDTH (MC_TLM_FIRST + 9)
863 
870 #define MC_TLM_GETCOLUMNWIDTH (MC_TLM_FIRST + 10)
871 
885 #define MC_TLM_INSERTITEMW (MC_TLM_FIRST + 11)
886 
900 #define MC_TLM_INSERTITEMA (MC_TLM_FIRST + 12)
901 
909 #define MC_TLM_SETITEMW (MC_TLM_FIRST + 13)
910 
918 #define MC_TLM_SETITEMA (MC_TLM_FIRST + 14)
919 
934 #define MC_TLM_GETITEMW (MC_TLM_FIRST + 15)
935 
950 #define MC_TLM_GETITEMA (MC_TLM_FIRST + 16)
951 
963 #define MC_TLM_DELETEITEM (MC_TLM_FIRST + 17)
964 
976 #define MC_TLM_SETITEMHEIGHT (MC_TLM_FIRST + 18)
977 
984 #define MC_TLM_GETITEMHEIGHT (MC_TLM_FIRST + 19)
985 
993 #define MC_TLM_SETSUBITEMW (MC_TLM_FIRST + 20)
994 
1002 #define MC_TLM_SETSUBITEMA (MC_TLM_FIRST + 21)
1003 
1019 #define MC_TLM_GETSUBITEMW (MC_TLM_FIRST + 22)
1020 
1036 #define MC_TLM_GETSUBITEMA (MC_TLM_FIRST + 23)
1037 
1044 #define MC_TLM_SETINDENT (MC_TLM_FIRST + 24)
1045 
1052 #define MC_TLM_GETINDENT (MC_TLM_FIRST + 25)
1053 
1062 #define MC_TLM_HITTEST (MC_TLM_FIRST + 26)
1063 
1070 #define MC_TLM_EXPAND (MC_TLM_FIRST + 27)
1071 
1080 #define MC_TLM_GETNEXTITEM (MC_TLM_FIRST + 28)
1081 
1088 #define MC_TLM_GETVISIBLECOUNT (MC_TLM_FIRST + 29)
1089 
1098 #define MC_TLM_ENSUREVISIBLE (MC_TLM_FIRST + 30)
1099 
1112 #define MC_TLM_SETIMAGELIST (MC_TLM_FIRST + 31)
1113 
1121 #define MC_TLM_GETIMAGELIST (MC_TLM_FIRST + 32)
1122 
1130 
1142 #define MC_TLN_DELETEITEM (MC_TLN_FIRST + 0)
1143 
1158 #define MC_TLN_SELCHANGING (MC_TLN_FIRST + 1)
1159 
1173 #define MC_TLN_SELCHANGED (MC_TLN_FIRST + 2)
1174 
1189 #define MC_TLN_EXPANDING (MC_TLN_FIRST + 3)
1190 
1204 #define MC_TLN_EXPANDED (MC_TLN_FIRST + 4)
1205 
1206 #if 0
1207 #define MC_TLN_SETDISPINFOW (MC_TLN_FIRST + 5)
1208 #define MC_TLN_SETDISPINFOA (MC_TLN_FIRST + 6)
1209 #endif
1210 
1224 #define MC_TLN_GETDISPINFOW (MC_TLN_FIRST + 7)
1225 
1239 #define MC_TLN_GETDISPINFOA (MC_TLN_FIRST + 8)
1240 
1241 #if 0
1242 #define MC_TLN_SETSUBDISPINFOW (MC_TLN_FIRST + 9)
1243 #define MC_TLN_SETSUBDISPINFOA (MC_TLN_FIRST + 10)
1244 #endif
1245 
1246 #define MC_TLN_GETSUBDISPINFOW (MC_TLN_FIRST + 11)
1247 #define MC_TLN_GETSUBDISPINFOA (MC_TLN_FIRST + 12)
1248 
1256 
1258 #define MC_WC_TREELIST MCTRL_NAME_AW(MC_WC_TREELIST)
1259 
1260 #define MC_TLCOLUMN MCTRL_NAME_AW(MC_TLCOLUMN)
1261 
1262 #define MC_TLITEM MCTRL_NAME_AW(MC_TLITEM)
1263 
1264 #define MC_TLSUBITEM MCTRL_NAME_AW(MC_TLSUBITEM)
1265 
1266 #define MC_TLINSERTSTRUCT MCTRL_NAME_AW(MC_TLINSERTSTRUCT)
1267 
1268 #define MC_NMTLDISPINFO MCTRL_NAME_AW(MC_NMTLDISPINFO)
1269 
1270 #define MC_NMTLSUBDISPINFO MCTRL_NAME_AW(MC_NMTLSUBDISPINFO)
1271 
1272 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1273 
1274 #define MC_TLM_INSERTCOLUMN MCTRL_NAME_AW(MC_TLM_INSERTCOLUMN)
1275 
1276 #define MC_TLM_SETCOLUMN MCTRL_NAME_AW(MC_TLM_SETCOLUMN)
1277 
1278 #define MC_TLM_GETCOLUMN MCTRL_NAME_AW(MC_TLM_GETCOLUMN)
1279 
1280 #define MC_TLM_INSERTITEM MCTRL_NAME_AW(MC_TLM_INSERTITEM)
1281 
1282 #define MC_TLM_SETITEM MCTRL_NAME_AW(MC_TLM_SETITEM)
1283 
1284 #define MC_TLM_GETITEM MCTRL_NAME_AW(MC_TLM_GETITEM)
1285 
1286 #define MC_TLM_SETSUBITEM MCTRL_NAME_AW(MC_TLM_SETSUBITEM)
1287 
1288 #define MC_TLM_GETSUBITEM MCTRL_NAME_AW(MC_TLM_GETSUBITEM)
1289 
1290 #define MC_TLN_SETDISPINFO MCTRL_NAME_AW(MC_TLN_SETDISPINFO)
1291 
1292 #define MC_TLN_GETDISPINFO MCTRL_NAME_AW(MC_TLN_GETDISPINFO)
1293 
1294 #define MC_TLN_SETSUBDISPINFO MCTRL_NAME_AW(MC_TLN_SETSUBDISPINFO)
1295 
1296 #define MC_TLN_GETSUBDISPINFO MCTRL_NAME_AW(MC_TLN_GETSUBDISPINFO)
1297 
1301 #ifdef __cplusplus
1302 } /* extern "C" */
1303 #endif
1304 
1305 #endif /* MCTRL_TREELIST_H */