blob: b2978a4d4febab0c4ddf7eaf2d5008f1e2ad398b [file] [log] [blame]
Alexandre Julliard642d3131998-07-12 19:29:36 +00001/*
2 * Treeview class extra info
3 *
4 * Copyright 1998 Eric Kohl
Alexandre Julliardd30dfd21998-09-27 18:28:36 +00005 * Copyright 1998 Alex Priem
Alexandre Julliard642d3131998-07-12 19:29:36 +00006 */
7
8#ifndef __WINE_TREEVIEW_H
9#define __WINE_TREEVIEW_H
10
Sylvain St.Germain99b118a1999-03-25 10:55:01 +000011#include "commctrl.h"
12
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000013#define MINIMUM_INDENT 10
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000014#define TV_REFRESH_DELAY 100 /* 100 ms delay between two refreshes */
Alex Priemd2d7f961999-01-30 13:02:30 +000015#define TV_DEFAULTITEMHEIGHT 16
16#define TVITEM_ALLOC 16 /* default nr of items to allocate at first try */
17
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000018
19/* internal structures */
20
21typedef struct {
Sylvain St.Germain02300ae1999-03-16 10:38:44 +000022 UINT mask;
23 HTREEITEM hItem;
24 UINT state;
25 UINT stateMask;
26 LPSTR pszText;
27 int cchTextMax;
28 int iImage;
29 int iSelectedImage;
30 int cChildren;
31 LPARAM lParam;
32 int iIntegral;
33 int iLevel; /* indentation level:0=root level */
34 COLORREF clrText;
35 HTREEITEM parent; /* handle to parent or 0 if at root*/
36 HTREEITEM firstChild; /* handle to first child or 0 if no child*/
37 HTREEITEM sibling; /* handle to next item in list, 0 if last */
38 HTREEITEM upsibling; /* handle to previous item in list, 0 if first */
39 int visible;
40 RECT rect;
41 RECT text;
42 RECT expandBox; /* expand box (+/-) coordinate */
Alex Prieme6e71ad1999-11-28 19:50:01 +000043 RECT bitmap;
44 RECT statebitmap;
Alexandre Julliardd30dfd21998-09-27 18:28:36 +000045} TREEVIEW_ITEM;
46
47
Alexandre Julliard642d3131998-07-12 19:29:36 +000048typedef struct tagTREEVIEW_INFO
49{
Sylvain St.Germain02300ae1999-03-16 10:38:44 +000050 UINT uInternalStatus;
51 UINT bAutoSize; /* merge with uInternalStatus */
52 INT Timer;
53 UINT uNumItems; /* number of valid TREEVIEW_ITEMs */
54 UINT uNumPtrsAlloced;
55 HTREEITEM uMaxHandle; /* needed for delete_item */
56 HTREEITEM TopRootItem; /* handle to first item in treeview */
57 INT cdmode; /* last custom draw setting */
Eric Kohlf9b58071999-07-31 13:09:40 +000058 UINT uScrollTime; /* max. time for scrolling in milliseconds*/
Sylvain St.Germain02300ae1999-03-16 10:38:44 +000059 UINT uItemHeight; /* item height, -1 for default item height */
60 UINT uRealItemHeight;/* current item height in pixels */
61 UINT uVisibleHeight; /* visible height of treeview in pixels */
62 UINT uTotalHeight; /* total height of treeview in pixels */
63 UINT uVisibleWidth;
64 UINT uTotalWidth;
65 UINT uIndent; /* indentation in pixels */
66 HTREEITEM selectedItem; /* handle to selected item or 0 if none */
67 HTREEITEM focusItem; /* handle to item that has focus, 0 if none */
68 HTREEITEM hotItem; /* handle currently under cursor, 0 if none */
69 HTREEITEM editItem; /* handle to item currently editted, 0 if none */
70 HTREEITEM firstVisible; /* handle to first visible item */
71 HTREEITEM dropItem; /* handle to item selected by drag cursor */
Alex Prieme6e71ad1999-11-28 19:50:01 +000072 HTREEITEM insertMarkItem; /* item after which insertion mark is placed */
73 BOOL insertBeforeorAfter; /* flag used by TVM_SETINSERTMARK */
Sylvain St.Germain02300ae1999-03-16 10:38:44 +000074 HIMAGELIST dragList; /* Bitmap of dragged item */
75 INT cx,cy; /* current x/y place in list */
76 COLORREF clrBk;
77 COLORREF clrText;
Alex Prieme74f2191999-07-18 18:31:05 +000078 COLORREF clrLine;
Alex Prieme6e71ad1999-11-28 19:50:01 +000079 COLORREF clrInsertMark;
Sylvain St.Germain02300ae1999-03-16 10:38:44 +000080 HFONT hFont;
81 HFONT hBoldFont;
82 HWND hwndToolTip;
83 HWND hwndEdit;
84 WNDPROC wpEditOrig; /* needed for subclassing edit control */
85 HIMAGELIST himlNormal;
86 HIMAGELIST himlState;
Sylvain St.Germain99b118a1999-03-25 10:55:01 +000087 LPTVSORTCB pCallBackSort; /* ptr to TVSORTCB struct for callback sorting */
Sylvain St.Germain02300ae1999-03-16 10:38:44 +000088 TREEVIEW_ITEM *items; /* itemlist */
89 INT *freeList; /* bitmap indicating which elements are valid */
90 /* 1=valid, 0=free; */
91 /* size of list= uNumPtrsAlloced/32 */
Alexandre Julliard642d3131998-07-12 19:29:36 +000092} TREEVIEW_INFO;
93
94
Alex Priemd2d7f961999-01-30 13:02:30 +000095
96/* bitflags for infoPtr->uInternalStatus */
97
98#define TV_HSCROLL 0x01 /* treeview too large to fit in window */
99#define TV_VSCROLL 0x02 /* (horizontal/vertical) */
100#define TV_LDRAG 0x04 /* Lbutton pushed to start drag */
101#define TV_LDRAGGING 0x08 /* Lbutton pushed, mouse moved. */
102#define TV_RDRAG 0x10 /* dito Rbutton */
103#define TV_RDRAGGING 0x20
104
105/* bitflags for infoPtr->timer */
106
107#define TV_REFRESH_TIMER 1
108#define TV_EDIT_TIMER 2
109#define TV_REFRESH_TIMER_SET 1
110#define TV_EDIT_TIMER_SET 2
111
112
Eric Kohl9d8e8641998-10-24 10:49:27 +0000113extern VOID TREEVIEW_Register (VOID);
114extern VOID TREEVIEW_Unregister (VOID);
Alexandre Julliard642d3131998-07-12 19:29:36 +0000115
116#endif /* __WINE_TREEVIEW_H */