STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
DROPDOWN.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 : DROPDOWN.h
30 Purpose : Multiple choice object include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef DROPDOWN_H
35 #define DROPDOWN_H
36 
37 #include "WM.h"
38 #include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
39 #include "LISTBOX.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 * Create flags
50 */
51 #define DROPDOWN_CF_AUTOSCROLLBAR (1 << 0)
52 #define DROPDOWN_CF_UP (1 << 1)
53 
54 /*********************************************************************
55 *
56 * Color indices
57 */
58 #define DROPDOWN_CI_UNSEL 0
59 #define DROPDOWN_CI_SEL 1
60 #define DROPDOWN_CI_SELFOCUS 2
61 
62 #define DROPDOWN_CI_ARROW 0
63 #define DROPDOWN_CI_BUTTON 1
64 
65 /*********************************************************************
66 *
67 * Skinning property indices
68 */
69 #define DROPDOWN_SKINFLEX_PI_EXPANDED 0
70 #define DROPDOWN_SKINFLEX_PI_FOCUSSED 1
71 #define DROPDOWN_SKINFLEX_PI_ENABLED 2
72 #define DROPDOWN_SKINFLEX_PI_DISABLED 3
73 
74 /*********************************************************************
75 *
76 * Types
77 *
78 **********************************************************************
79 */
80 typedef WM_HMEM DROPDOWN_Handle;
81 
82 typedef struct {
83  GUI_COLOR aColorFrame[3];
84  GUI_COLOR aColorUpper[2];
85  GUI_COLOR aColorLower[2];
86  GUI_COLOR ColorArrow;
87  GUI_COLOR ColorText;
88  GUI_COLOR ColorSep;
89  int Radius;
90 } DROPDOWN_SKINFLEX_PROPS;
91 
92 /*********************************************************************
93 *
94 * Standard member functions
95 *
96 **********************************************************************
97 */
98 #define DROPDOWN_EnableMemdev(hObj) WM_EnableMemdev(hObj)
99 #define DROPDOWN_DisableMemdev(hObj) WM_DisableMemdev(hObj)
100 #define DROPDOWN_Delete(hObj) WM_DeleteWindow(hObj)
101 #define DROPDOWN_Paint(hObj) WM_Paint(hObj)
102 #define DROPDOWN_Invalidate(hObj) WM_InvalidateWindow(hObj)
103 
104 /*********************************************************************
105 *
106 * Create functions
107 *
108 **********************************************************************
109 */
110 DROPDOWN_Handle DROPDOWN_Create (WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags);
111 DROPDOWN_Handle DROPDOWN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
112 DROPDOWN_Handle DROPDOWN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
113 DROPDOWN_Handle DROPDOWN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* cb);
114 
115 /*********************************************************************
116 *
117 * The callback ...
118 *
119 * Do not call it directly ! It is only to be used from within an
120 * overwritten callback.
121 */
122 void DROPDOWN_Callback(WM_MESSAGE * pMsg);
123 
124 /*********************************************************************
125 *
126 * Member functions
127 *
128 **********************************************************************
129 */
130 void DROPDOWN_AddKey (DROPDOWN_Handle hObj, int Key);
131 void DROPDOWN_AddString (DROPDOWN_Handle hObj, const char* s);
132 void DROPDOWN_Collapse (DROPDOWN_Handle hObj);
133 void DROPDOWN_DecSel (DROPDOWN_Handle hObj);
134 void DROPDOWN_DecSelExp (DROPDOWN_Handle hObj);
135 void DROPDOWN_DeleteItem (DROPDOWN_Handle hObj, unsigned int Index);
136 void DROPDOWN_Expand (DROPDOWN_Handle hObj);
137 unsigned DROPDOWN_GetItemDisabled (DROPDOWN_Handle hObj, unsigned Index);
138 unsigned DROPDOWN_GetItemSpacing (DROPDOWN_Handle hObj);
139 int DROPDOWN_GetItemText (DROPDOWN_Handle hObj, unsigned Index, char * pBuffer, int MaxSize);
140 LISTBOX_Handle DROPDOWN_GetListbox (DROPDOWN_Handle hObj);
141 int DROPDOWN_GetNumItems (DROPDOWN_Handle hObj);
142 int DROPDOWN_GetSel (DROPDOWN_Handle hObj);
143 int DROPDOWN_GetSelExp (DROPDOWN_Handle hObj);
144 int DROPDOWN_GetUserData (DROPDOWN_Handle hObj, void * pDest, int NumBytes);
145 void DROPDOWN_IncSel (DROPDOWN_Handle hObj);
146 void DROPDOWN_IncSelExp (DROPDOWN_Handle hObj);
147 void DROPDOWN_InsertString (DROPDOWN_Handle hObj, const char* s, unsigned int Index);
148 void DROPDOWN_SetAutoScroll (DROPDOWN_Handle hObj, int OnOff);
149 void DROPDOWN_SetBkColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR color);
150 void DROPDOWN_SetColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR Color);
151 void DROPDOWN_SetFont (DROPDOWN_Handle hObj, const GUI_FONT * pfont);
152 void DROPDOWN_SetItemDisabled (DROPDOWN_Handle hObj, unsigned Index, int OnOff);
153 void DROPDOWN_SetItemSpacing (DROPDOWN_Handle hObj, unsigned Value);
154 int DROPDOWN_SetListHeight (DROPDOWN_Handle hObj, unsigned Height);
155 void DROPDOWN_SetScrollbarColor(DROPDOWN_Handle hObj, unsigned Index, GUI_COLOR Color);
156 void DROPDOWN_SetScrollbarWidth(DROPDOWN_Handle hObj, unsigned Width);
157 void DROPDOWN_SetSel (DROPDOWN_Handle hObj, int Sel);
158 void DROPDOWN_SetSelExp (DROPDOWN_Handle hObj, int Sel);
159 void DROPDOWN_SetTextAlign (DROPDOWN_Handle hObj, int Align);
160 void DROPDOWN_SetTextColor (DROPDOWN_Handle hObj, unsigned int index, GUI_COLOR color);
161 void DROPDOWN_SetTextHeight (DROPDOWN_Handle hObj, unsigned TextHeight);
162 int DROPDOWN_SetUpMode (DROPDOWN_Handle hObj, int OnOff);
163 int DROPDOWN_SetUserData (DROPDOWN_Handle hObj, const void * pSrc, int NumBytes);
164 
165 /*********************************************************************
166 *
167 * Member functions: Skinning
168 *
169 **********************************************************************
170 */
171 void DROPDOWN_GetSkinFlexProps (DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
172 void DROPDOWN_SetSkinClassic (DROPDOWN_Handle hObj);
173 void DROPDOWN_SetSkin (DROPDOWN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
174 int DROPDOWN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
175 void DROPDOWN_SetSkinFlexProps (const DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
176 void DROPDOWN_SetDefaultSkinClassic(void);
177 WIDGET_DRAW_ITEM_FUNC * DROPDOWN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
178 
179 #define DROPDOWN_SKIN_FLEX DROPDOWN_DrawSkinFlex
180 
181 /*********************************************************************
182 *
183 * Global functions
184 *
185 **********************************************************************
186 */
187 GUI_COLOR DROPDOWN_GetDefaultBkColor (int Index);
188 GUI_COLOR DROPDOWN_GetDefaultColor (int Index);
189 const GUI_FONT * DROPDOWN_GetDefaultFont (void);
190 GUI_COLOR DROPDOWN_GetDefaultScrollbarColor(int Index);
191 void DROPDOWN_SetDefaultFont (const GUI_FONT * pFont);
192 GUI_COLOR DROPDOWN_SetDefaultBkColor (int Index, GUI_COLOR Color);
193 GUI_COLOR DROPDOWN_SetDefaultColor (int Index, GUI_COLOR Color);
194 GUI_COLOR DROPDOWN_SetDefaultScrollbarColor(int Index, GUI_COLOR Color);
195 
196 #if defined(__cplusplus)
197  }
198 #endif
199 
200 #endif // GUI_WINSUPPORT
201 #endif // DROPDOWN_H
202 
203 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50