STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
LISTBOX.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 : LISTBOX.h
30 Purpose : LISTBOX widget include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef LISTBOX_H
35 #define LISTBOX_H
36 
37 #include "WM.h"
38 #include "WIDGET.h" /* Req. for WIDGET_DRAW_ITEM_FUNC */
39 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
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 
54 #define LISTBOX_ALL_ITEMS -1
55 
56 /*********************************************************************
57 *
58 * Color indices
59 */
60 #define LISTBOX_CI_UNSEL 0
61 #define LISTBOX_CI_SEL 1
62 #define LISTBOX_CI_SELFOCUS 2
63 #define LISTBOX_CI_DISABLED 3
64 
65 /************************************************************
66 *
67 * States
68 */
69 typedef WM_HMEM LISTBOX_Handle;
70 
71 /*********************************************************************
72 *
73 * Notification codes
74 *
75 * The following is the list of notification codes specific to this widget,
76 * Send with the WM_NOTIFY_PARENT message
77 */
78 #define LISTBOX_NOTIFICATION_LOST_FOCUS (WM_NOTIFICATION_WIDGET + 0)
79 
80 /************************************************************
81 *
82 * Create / Status flags
83 */
84 #define LISTBOX_CF_AUTOSCROLLBAR_H (1<<0)
85 #define LISTBOX_CF_AUTOSCROLLBAR_V (1<<1)
86 #define LISTBOX_CF_MULTISEL (1<<2)
87 #define LISTBOX_CF_WRAP (1<<3)
88 #define LISTBOX_SF_AUTOSCROLLBAR_H LISTBOX_CF_AUTOSCROLLBAR_H
89 #define LISTBOX_SF_AUTOSCROLLBAR_V LISTBOX_CF_AUTOSCROLLBAR_V
90 #define LISTBOX_SF_MULTISEL LISTBOX_CF_MULTISEL
91 #define LISTBOX_SF_WRAP LISTBOX_CF_WRAP
92 
93 /*********************************************************************
94 *
95 * Standard member functions
96 *
97 **********************************************************************
98 */
99 
100 #define LISTBOX_EnableMemdev(hObj) WM_EnableMemdev(hObj)
101 #define LISTBOX_DisableMemdev(hObj) WM_DisableMemdev(hObj)
102 #define LISTBOX_Delete(hObj) WM_DeleteWindow(hObj)
103 #define LISTBOX_Paint(hObj) WM_Paint(hObj)
104 #define LISTBOX_Invalidate(hObj) WM_InvalidateWindow(hObj)
105 
106 /*********************************************************************
107 *
108 * Create functions
109 *
110 **********************************************************************
111 */
112 
113 LISTBOX_Handle LISTBOX_Create (const GUI_ConstString * ppText, int x0, int y0, int xSize, int ySize, int Flags);
114 LISTBOX_Handle LISTBOX_CreateAsChild (const GUI_ConstString * ppText, WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags);
115 LISTBOX_Handle LISTBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText);
116 LISTBOX_Handle LISTBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const GUI_ConstString * ppText, int NumExtraBytes);
117 LISTBOX_Handle LISTBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
118 
119 /*********************************************************************
120 *
121 * The callback ...
122 *
123 * Do not call it directly ! It is only to be used from within an
124 * overwritten callback.
125 */
126 void LISTBOX_Callback(WM_MESSAGE * pMsg);
127 
128 /*********************************************************************
129 *
130 * Member functions
131 *
132 **********************************************************************
133 */
134 
135 int LISTBOX_AddKey (LISTBOX_Handle hObj, int Key);
136 void LISTBOX_AddString (LISTBOX_Handle hObj, const char * s);
137 void LISTBOX_AddStringH (LISTBOX_Handle hObj, WM_HMEM hString); /* Not to be documented!!! */
138 void LISTBOX_DecSel (LISTBOX_Handle hObj);
139 void LISTBOX_DeleteItem (LISTBOX_Handle hObj, unsigned int Index);
140 void LISTBOX_EnableWrapMode (LISTBOX_Handle hObj, int OnOff);
141 unsigned LISTBOX_GetItemSpacing (LISTBOX_Handle hObj);
142 unsigned LISTBOX_GetNumItems (LISTBOX_Handle hObj);
143 int LISTBOX_GetSel (LISTBOX_Handle hObj);
144 const GUI_FONT * LISTBOX_GetFont (LISTBOX_Handle hObj);
145 int LISTBOX_GetItemDisabled (LISTBOX_Handle hObj, unsigned Index);
146 int LISTBOX_GetItemSel (LISTBOX_Handle hObj, unsigned Index);
147 void LISTBOX_GetItemText (LISTBOX_Handle hObj, unsigned Index, char * pBuffer, int MaxSize);
148 int LISTBOX_GetMulti (LISTBOX_Handle hObj);
149 int LISTBOX_GetScrollStepH (LISTBOX_Handle hObj);
150 int LISTBOX_GetTextAlign (LISTBOX_Handle hObj);
151 int LISTBOX_GetUserData (LISTBOX_Handle hObj, void * pDest, int NumBytes);
152 void LISTBOX_IncSel (LISTBOX_Handle hObj);
153 void LISTBOX_InsertString (LISTBOX_Handle hObj, const char * s, unsigned int Index);
154 void LISTBOX_InvalidateItem (LISTBOX_Handle hObj, int Index);
155 int LISTBOX_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
156 void LISTBOX_SetAutoScrollH (LISTBOX_Handle hObj, int OnOff);
157 void LISTBOX_SetAutoScrollV (LISTBOX_Handle hObj, int OnOff);
158 void LISTBOX_SetBkColor (LISTBOX_Handle hObj, unsigned int Index, GUI_COLOR color);
159 void LISTBOX_SetFont (LISTBOX_Handle hObj, const GUI_FONT * pFont);
160 void LISTBOX_SetItemDisabled (LISTBOX_Handle hObj, unsigned Index, int OnOff);
161 void LISTBOX_SetItemSel (LISTBOX_Handle hObj, unsigned Index, int OnOff);
162 void LISTBOX_SetItemSpacing (LISTBOX_Handle hObj, unsigned Value);
163 void LISTBOX_SetMulti (LISTBOX_Handle hObj, int Mode);
164 void LISTBOX_SetOwner (LISTBOX_Handle hObj, WM_HWIN hOwner);
165 void LISTBOX_SetOwnerDraw (LISTBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem);
166 void LISTBOX_SetScrollStepH (LISTBOX_Handle hObj, int Value);
167 void LISTBOX_SetSel (LISTBOX_Handle hObj, int Sel);
168 void LISTBOX_SetScrollbarColor(LISTBOX_Handle hObj, unsigned Index, GUI_COLOR Color);
169 void LISTBOX_SetScrollbarWidth(LISTBOX_Handle hObj, unsigned Width);
170 void LISTBOX_SetString (LISTBOX_Handle hObj, const char * s, unsigned int Index);
171 void LISTBOX_SetText (LISTBOX_Handle hObj, const GUI_ConstString * ppText);
172 void LISTBOX_SetTextAlign (LISTBOX_Handle hObj, int Align);
173 GUI_COLOR LISTBOX_SetTextColor (LISTBOX_Handle hObj, unsigned int Index, GUI_COLOR Color);
174 int LISTBOX_SetUserData (LISTBOX_Handle hObj, const void * pSrc, int NumBytes);
175 int LISTBOX_UpdateScrollers (LISTBOX_Handle hObj);
176 
177 /*********************************************************************
178 *
179 * Global functions
180 *
181 **********************************************************************
182 */
183 
184 const GUI_FONT * LISTBOX_GetDefaultFont(void);
185 int LISTBOX_GetDefaultScrollStepH (void);
186 GUI_COLOR LISTBOX_GetDefaultBkColor (unsigned Index);
187 int LISTBOX_GetDefaultTextAlign (void);
188 GUI_COLOR LISTBOX_GetDefaultTextColor (unsigned Index);
189 void LISTBOX_SetDefaultFont (const GUI_FONT * pFont);
190 void LISTBOX_SetDefaultScrollStepH (int Value);
191 void LISTBOX_SetDefaultBkColor (unsigned Index, GUI_COLOR Color);
192 void LISTBOX_SetDefaultTextAlign (int Align);
193 void LISTBOX_SetDefaultTextColor (unsigned Index, GUI_COLOR Color);
194 
195 /*********************************************************************
196 *
197 * Compatibility to older versions
198 *
199 **********************************************************************
200 */
201 
202 #define LISTBOX_SetBackColor(hObj, Index, Color) LISTBOX_SetBkColor(hObj, Index, Color)
203 #define LISTBOX_DeleteString LISTBOX_DeleteItem
204 
205 #if defined(__cplusplus)
206  }
207 #endif
208 
209 #endif // GUI_WINSUPPORT
210 #endif // LISTBOX_H
211 
212 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
const char * GUI_ConstString
Definition: GUI_Type.h:48