STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
TREEVIEW.h
Go to the documentation of this file.
1 /*********************************************************************
2 * SEGGER Microcontroller GmbH & Co. KG *
3 * Solutions for real time microcontroller applications *
4 **********************************************************************
5 * *
6 * (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
7 * *
8 * Internet: www.segger.com Support: support@segger.com *
9 * *
10 **********************************************************************
11 
12 ** emWin V5.28 - Graphical user interface for embedded applications **
13 All Intellectual Property rights in the Software belongs to SEGGER.
14 emWin is protected by international copyright laws. Knowledge of the
15 source code may not be used to write a similar product. This file may
16 only be used in accordance with the following terms:
17 
18 The software has been licensed to STMicroelectronics International
19 N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
20 les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
21 purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
22 troller products commercialized by Licensee only, sublicensed and dis_
23 tributed under the terms and conditions of the End User License Agree_
24 ment supplied by STMicroelectronics International N.V.
25 Full source code is available at: www.segger.com
26 
27 We appreciate your understanding and fairness.
28 ----------------------------------------------------------------------
29 File : TREEVIEW.h
30 Purpose : TREEVIEW include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef TREEVIEW_H
35 #define TREEVIEW_H
36 
37 #include "WM.h"
38 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
39 #include "WIDGET.h"
40 
41 #if GUI_WINSUPPORT
42 
43 #if defined(__cplusplus)
44  extern "C" { /* Make sure we have C-declarations in C++ programs */
45 #endif
46 
47 /*********************************************************************
48 *
49 * Defines
50 *
51 **********************************************************************
52 */
53 /* Status- and create flags */
54 #define TREEVIEW_CF_HIDELINES (1 << 0)
55 #define TREEVIEW_CF_ROWSELECT (1 << 1)
56 #define TREEVIEW_CF_AUTOSCROLLBAR_H (1 << 2)
57 #define TREEVIEW_CF_AUTOSCROLLBAR_V (1 << 3)
58 #define TREEVIEW_SF_HIDELINES TREEVIEW_CF_HIDELINES
59 #define TREEVIEW_SF_ROWSELECT TREEVIEW_CF_ROWSELECT
60 #define TREEVIEW_SF_AUTOSCROLLBAR_H TREEVIEW_CF_AUTOSCROLLBAR_H
61 #define TREEVIEW_SF_AUTOSCROLLBAR_V TREEVIEW_CF_AUTOSCROLLBAR_V
62 
63 /* Bitmap indices */
64 #define TREEVIEW_BI_CLOSED 0
65 #define TREEVIEW_BI_OPEN 1
66 #define TREEVIEW_BI_LEAF 2
67 #define TREEVIEW_BI_PLUS 3
68 #define TREEVIEW_BI_MINUS 4
69 #define TREEVIEW_BI_PM 5
70 
71 /* Color indices */
72 #define TREEVIEW_CI_UNSEL 0
73 #define TREEVIEW_CI_SEL 1
74 #define TREEVIEW_CI_DISABLED 2
75 
76 /* Relative positions (create) */
77 #define TREEVIEW_INSERT_ABOVE 0
78 #define TREEVIEW_INSERT_BELOW 1
79 #define TREEVIEW_INSERT_FIRST_CHILD 2
80 
81 /* Relative positions (retrieve) */
82 #define TREEVIEW_GET_FIRST 0
83 #define TREEVIEW_GET_LAST 1
84 #define TREEVIEW_GET_NEXT_SIBLING 2
85 #define TREEVIEW_GET_PREV_SIBLING 3
86 #define TREEVIEW_GET_FIRST_CHILD 4
87 #define TREEVIEW_GET_PARENT 5
88 
89 /* Item flags */
90 #define TREEVIEW_ITEM_TYPE_LEAF (0 << 0)
91 #define TREEVIEW_ITEM_TYPE_NODE (1 << 0)
92 
93 /* Selection mode */
94 #define TREEVIEW_SELMODE_ROW 1
95 #define TREEVIEW_SELMODE_TEXT 0
96 
97 /************************************************************
98 *
99 * Types
100 *
101 *************************************************************
102 */
103 typedef WM_HMEM TREEVIEW_Handle;
104 typedef WM_HMEM TREEVIEW_ITEM_Handle;
105 
106 typedef struct {
107  int IsNode;
108  int IsExpanded;
109  int HasLines;
110  int HasRowSelect;
111  int Level;
112 } TREEVIEW_ITEM_INFO;
113 
114 typedef struct {
115  GUI_COLOR ColorBk;
116  GUI_COLOR ColorText;
117  GUI_COLOR ColorTextBk;
118  GUI_COLOR ColorLines;
119  GUI_RECT rText;
120  TREEVIEW_ITEM_Handle hItem;
121  const GUI_FONT * pFont;
122  char * pText;
123  U8 NumLines;
124  I16 ax0[3];
125  I16 ay0[3];
126  I16 ax1[3];
127  I16 ay1[3];
128  U8 NumConnectors;
129  I16 axc[16];
130  const GUI_BITMAP * pBmPM;
131  const GUI_BITMAP * pBmOCL;
132  I16 xPosPM, xPosOCL;
133  U8 IndexPM;
134  U8 IndexOCL;
135 } TREEVIEW_ITEM_DRAW_INFO;
136 
137 /*********************************************************************
138 *
139 * Create functions
140 *
141 **********************************************************************
142 */
143 TREEVIEW_Handle TREEVIEW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
144 TREEVIEW_Handle TREEVIEW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
145 TREEVIEW_Handle TREEVIEW_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
146 
147 /*********************************************************************
148 *
149 * The callback ...
150 *
151 * Do not call it directly ! It is only to be used from within an
152 * overwritten callback.
153 */
154 void TREEVIEW_Callback(WM_MESSAGE * pMsg);
155 
156 /*********************************************************************
157 *
158 * Common functions
159 *
160 **********************************************************************
161 */
162 int TREEVIEW_AttachItem (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem, TREEVIEW_ITEM_Handle hItemAt, int Position);
163 void TREEVIEW_DecSel (TREEVIEW_Handle hObj);
164 TREEVIEW_ITEM_Handle TREEVIEW_GetItem (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem, int Flags);
165 TREEVIEW_ITEM_Handle TREEVIEW_GetSel (TREEVIEW_Handle hObj);
166 int TREEVIEW_GetUserData (TREEVIEW_Handle hObj, void * pDest, int NumBytes);
167 void TREEVIEW_IncSel (TREEVIEW_Handle hObj);
168 TREEVIEW_ITEM_Handle TREEVIEW_InsertItem (TREEVIEW_Handle hObj, int IsNode, TREEVIEW_ITEM_Handle hItemPrev, int Position, const char * s);
169 int TREEVIEW_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
170 void TREEVIEW_ScrollToSel (TREEVIEW_Handle hObj);
171 void TREEVIEW_SetAutoScrollH (TREEVIEW_Handle hObj, int State);
172 void TREEVIEW_SetAutoScrollV (TREEVIEW_Handle hObj, int State);
173 void TREEVIEW_SetBitmapOffset(TREEVIEW_Handle hObj, int Index, int xOff, int yOff);
174 void TREEVIEW_SetBkColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color);
175 void TREEVIEW_SetFont (TREEVIEW_Handle hObj, const GUI_FONT * pFont);
176 void TREEVIEW_SetHasLines (TREEVIEW_Handle hObj, int State);
177 void TREEVIEW_SetImage (TREEVIEW_Handle hObj, int Index, const GUI_BITMAP * pBitmap);
178 int TREEVIEW_SetIndent (TREEVIEW_Handle hObj, int Indent);
179 void TREEVIEW_SetLineColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color);
180 void TREEVIEW_SetOwnerDraw (TREEVIEW_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem);
181 void TREEVIEW_SetSel (TREEVIEW_Handle hObj, TREEVIEW_ITEM_Handle hItem);
182 void TREEVIEW_SetSelMode (TREEVIEW_Handle hObj, int Mode);
183 void TREEVIEW_SetTextColor (TREEVIEW_Handle hObj, int Index, GUI_COLOR Color);
184 int TREEVIEW_SetTextIndent (TREEVIEW_Handle hObj, int TextIndent);
185 int TREEVIEW_SetUserData (TREEVIEW_Handle hObj, const void * pSrc, int NumBytes);
186 
187 
188 /*********************************************************************
189 *
190 * Treeview item related functions
191 *
192 **********************************************************************
193 */
194 void TREEVIEW_ITEM_Collapse (TREEVIEW_ITEM_Handle hItem);
195 void TREEVIEW_ITEM_CollapseAll(TREEVIEW_ITEM_Handle hItem);
196 TREEVIEW_ITEM_Handle TREEVIEW_ITEM_Create (int IsNode, const char * s, U32 UserData);
197 void TREEVIEW_ITEM_Delete (TREEVIEW_ITEM_Handle hItem);
198 void TREEVIEW_ITEM_Detach (TREEVIEW_ITEM_Handle hItem);
199 void TREEVIEW_ITEM_Expand (TREEVIEW_ITEM_Handle hItem);
200 void TREEVIEW_ITEM_ExpandAll (TREEVIEW_ITEM_Handle hItem);
201 void TREEVIEW_ITEM_GetInfo (TREEVIEW_ITEM_Handle hItem, TREEVIEW_ITEM_INFO * pInfo);
202 void TREEVIEW_ITEM_GetText (TREEVIEW_ITEM_Handle hItem, U8 * pBuffer, int MaxNumBytes);
203 U32 TREEVIEW_ITEM_GetUserData(TREEVIEW_ITEM_Handle hItem);
204 void TREEVIEW_ITEM_SetImage (TREEVIEW_ITEM_Handle hItem, int Index, const GUI_BITMAP * pBitmap);
205 TREEVIEW_ITEM_Handle TREEVIEW_ITEM_SetText (TREEVIEW_ITEM_Handle hItem, const char * s);
206 void TREEVIEW_ITEM_SetUserData(TREEVIEW_ITEM_Handle hItem, U32 UserData);
207 
208 /*********************************************************************
209 *
210 * Managing default values
211 *
212 **********************************************************************
213 */
214 GUI_COLOR TREEVIEW_GetDefaultBkColor (int Index);
215 const GUI_FONT * TREEVIEW_GetDefaultFont (void);
216 GUI_COLOR TREEVIEW_GetDefaultLineColor(int Index);
217 GUI_COLOR TREEVIEW_GetDefaultTextColor(int Index);
218 void TREEVIEW_SetDefaultBkColor (int Index, GUI_COLOR Color);
219 void TREEVIEW_SetDefaultFont (const GUI_FONT * pFont);
220 void TREEVIEW_SetDefaultLineColor(int Index, GUI_COLOR Color);
221 void TREEVIEW_SetDefaultTextColor(int Index, GUI_COLOR Color);
222 
223 #if defined(__cplusplus)
224  }
225 #endif
226 
227 #endif // GUI_WINSUPPORT
228 #endif // TREEVIEW_H
229 
230 /*************************** End of file ****************************/
#define U32
Definition: Global.h:50
Definition: LCD.h:102
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define I16
Definition: Global.h:56
#define U8
Definition: Global.h:44