Select one of the symbols to view example projects that use it.
 
Outline
#define MENU_H
#include "WM.h"
#include "WIDGET.h"
#include "DIALOG_Intern.h"
#define MENU_SKIN_FLEX
#define MENU_CF_HORIZONTAL
#define MENU_CF_VERTICAL
#define MENU_CF_OPEN_ON_POINTEROVER
#define MENU_CF_CLOSE_ON_SECOND_CLICK
#define MENU_CF_HIDE_DISABLED_SEL
#define MENU_IF_DISABLED
#define MENU_IF_SEPARATOR
#define MENU_CI_ENABLED
#define MENU_CI_SELECTED
#define MENU_CI_DISABLED
#define MENU_CI_DISABLED_SEL
#define MENU_CI_ACTIVE_SUBMENU
#define MENU_BI_LEFT
#define MENU_BI_RIGHT
#define MENU_BI_TOP
#define MENU_BI_BOTTOM
#define MENU_ON_ITEMSELECT
#define MENU_ON_INITMENU
#define MENU_ON_INITSUBMENU
#define MENU_ON_OPEN
#define MENU_ON_CLOSE
#define MENU_IS_MENU
#define MENU_ON_ITEMACTIVATE
#define MENU_ON_ITEMPRESSED
#define MENU_SKINFLEX_PI_ENABLED
#define MENU_SKINFLEX_PI_SELECTED
#define MENU_SKINFLEX_PI_DISABLED
#define MENU_SKINFLEX_PI_DISABLED_SEL
#define MENU_SKINFLEX_PI_ACTIVE_SUBMENU
MENU_Handle
MENU_SKINFLEX_PROPS
MENU_MSG_DATA
MENU_ITEM_DATA
MENU_CreateIndirect(const GUI_WIDGET_CREATE_INFO *, GUI_HWIN, int, int, WM_CALLBACK *);
MENU_CreateEx(int, int, int, int, GUI_HWIN, int, int, int);
MENU_CreateUser(int, int, int, int, GUI_HWIN, int, int, int, int);
MENU_Callback(WM_MESSAGE *);
MENU_AddItem(MENU_Handle, const MENU_ITEM_DATA *);
MENU_Attach(MENU_Handle, GUI_HWIN, int, int, int, int, int);
MENU_DeleteItem(MENU_Handle, unsigned short);
MENU_DisableItem(MENU_Handle, unsigned short);
MENU_EnableItem(MENU_Handle, unsigned short);
MENU_GetBkColor(MENU_Handle, unsigned int);
MENU_GetFont(MENU_Handle);
MENU_GetItem(MENU_Handle, unsigned short, MENU_ITEM_DATA *);
MENU_GetItemText(MENU_Handle, unsigned short, char *, unsigned int);
MENU_GetNumItems(MENU_Handle);
MENU_GetOwner(MENU_Handle);
MENU_GetTextColor(MENU_Handle, unsigned int);
MENU_GetUserData(MENU_Handle, void *, int);
MENU_InsertItem(MENU_Handle, unsigned short, const MENU_ITEM_DATA *);
MENU_Popup(MENU_Handle, GUI_HWIN, int, int, int, int, int);
MENU_SetBkColor(MENU_Handle, unsigned int, GUI_COLOR);
MENU_SetBorderSize(MENU_Handle, unsigned int, unsigned char);
MENU_SetFont(MENU_Handle, const GUI_FONT *);
MENU_SetItem(MENU_Handle, unsigned short, const MENU_ITEM_DATA *);
MENU_SetOwner(MENU_Handle, GUI_HWIN);
MENU_SetSel(MENU_Handle, int);
MENU_SetTextColor(MENU_Handle, unsigned int, GUI_COLOR);
MENU_SetUserData(MENU_Handle, const void *, int);
MENU_GetDefaultTextColor(unsigned int);
MENU_GetDefaultBkColor(unsigned int);
MENU_GetDefaultBorderSize(unsigned int);
MENU_GetDefaultEffect();
MENU_GetDefaultFont();
MENU_SetDefaultTextColor(unsigned int, GUI_COLOR);
MENU_SetDefaultBkColor(unsigned int, GUI_COLOR);
MENU_SetDefaultBorderSize(unsigned int, unsigned char);
MENU_SetDefaultEffect(const WIDGET_EFFECT *);
MENU_SetDefaultFont(const GUI_FONT *);
MENU_DrawSkinFlex(const WIDGET_ITEM_DRAW_INFO *);
MENU_GetSkinFlexProps(MENU_SKINFLEX_PROPS *, int);
MENU_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC *);
MENU_SetDefaultSkinClassic();
MENU_SetSkinClassic(MENU_Handle);
MENU_SetSkin(MENU_Handle, WIDGET_DRAW_ITEM_FUNC *);
MENU_SetSkinFlexProps(const MENU_SKINFLEX_PROPS *, int);
MENU_SkinEnableArrow(MENU_Handle, int);
Files
loading...
CodeScopeSTM32 Libraries and SamplesSTemWininc/MENU.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/********************************************************************* * SEGGER Microcontroller GmbH & Co. KG * * Solutions for real time microcontroller applications * ********************************************************************** * * * (c) 1996 - 2017 SEGGER Microcontroller GmbH & Co. KG * * * * Internet: www.segger.com Support: support@segger.com * * * ********************************************************************** ** emWin V5.44 - Graphical user interface for embedded applications ** All Intellectual Property rights in the Software belongs to SEGGER. emWin is protected by international copyright laws. Knowledge of the source code may not be used to write a similar product. This file may only be used in accordance with the following terms: The software has been licensed to STMicroelectronics International N.V. a Dutch company with a Swiss branch and its headquarters in Plan- les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_ troller products commercialized by Licensee only, sublicensed and dis_ tributed under the terms and conditions of the End User License Agree_ ment supplied by STMicroelectronics International N.V. Full source code is available at: www.segger.com We appreciate your understanding and fairness. ---------------------------------------------------------------------- ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under Ultimate Liberty license SLA0044, * the "License"; You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * http://www.st.com/SLA0044 * ****************************************************************************** ---------------------------------------------------------------------- File : MENU.h Purpose : MENU include --------------------END-OF-HEADER------------------------------------- *//* ... */ #ifndef MENU_H #define MENU_H #include "WM.h" #include "WIDGET.h" #include "DIALOG_Intern.h" // Required for Create indirect data structure #if GUI_WINSUPPORT #if defined(__cplusplus) extern "C" { // Make sure we have C-declarations in C++ programs #endif /********************************************************************* * * Defines * ********************************************************************** *//* ... */ #define MENU_SKIN_FLEX MENU_DrawSkinFlex /********************************************************************* * * Create flags *//* ... */ #define MENU_CF_HORIZONTAL (0<<0) #define MENU_CF_VERTICAL (1<<0) #define MENU_CF_OPEN_ON_POINTEROVER (1<<1) // Normally a menu opens first when clicked on it #define MENU_CF_CLOSE_ON_SECOND_CLICK (1<<2) // Normally a menu closes only when clicked outside it #define MENU_CF_HIDE_DISABLED_SEL (1<<3) // Hides the selection when a disabled item is selected /********************************************************************* * * Menu item flags *//* ... */ #define MENU_IF_DISABLED (1<<0) // Indicates that item is disabled #define MENU_IF_SEPARATOR (1<<1) // Indicates that item is a separator /********************************************************************* * * Color indices *//* ... */ #define MENU_CI_ENABLED 0 #define MENU_CI_SELECTED 1 #define MENU_CI_DISABLED 2 #define MENU_CI_DISABLED_SEL 3 #define MENU_CI_ACTIVE_SUBMENU 4 /********************************************************************* * * Border indices *//* ... */ #define MENU_BI_LEFT 0 #define MENU_BI_RIGHT 1 #define MENU_BI_TOP 2 #define MENU_BI_BOTTOM 3 /********************************************************************* * * Message types *//* ... */ #define MENU_ON_ITEMSELECT 0 // Send to owner when selecting a menu item #define MENU_ON_INITMENU 1 // Send to owner when for the first time selecting a submenu #define MENU_ON_INITSUBMENU 2 // Send to owner when selecting a submenu #define MENU_ON_OPEN 3 // Internal message of menu widget (only send to submenus) #define MENU_ON_CLOSE 4 // Internal message of menu widget (only send to submenus) #define MENU_IS_MENU 5 // Internal message of menu widget. Owner must call // WM_DefaultProc() when not handle the message #define MENU_ON_ITEMACTIVATE 6 // Send to owner when highlighting a menu item #define MENU_ON_ITEMPRESSED 7 // Send to owner when a menu item has been pressed /********************************************************************* * * Skinning property indices *//* ... */ #define MENU_SKINFLEX_PI_ENABLED 0 #define MENU_SKINFLEX_PI_SELECTED 1 #define MENU_SKINFLEX_PI_DISABLED 2 #define MENU_SKINFLEX_PI_DISABLED_SEL 3 #define MENU_SKINFLEX_PI_ACTIVE_SUBMENU 4 30 defines /********************************************************************* * * Types * ********************************************************************** *//* ... */ typedef WM_HMEM MENU_Handle; typedef struct { // // Background // GUI_COLOR aBkColorH[2]; GUI_COLOR BkColorV; GUI_COLOR FrameColorH; GUI_COLOR FrameColorV; // // Selection // GUI_COLOR aSelColorH[2]; GUI_COLOR aSelColorV[2]; GUI_COLOR FrameColorSelH; GUI_COLOR FrameColorSelV; // // Separator // GUI_COLOR aSepColorH[2]; GUI_COLOR aSepColorV[2]; // // Arrow // GUI_COLOR ArrowColor; // // Text // GUI_COLOR TextColor; ...} MENU_SKINFLEX_PROPS; /********************************************************************* * * Menu message data *//* ... */ typedef struct { U16 MsgType; U16 ItemId; ...} MENU_MSG_DATA; /********************************************************************* * * Menu item data *//* ... */ typedef struct { const char * pText; U16 Id; U16 Flags; MENU_Handle hSubmenu; ...} MENU_ITEM_DATA; /********************************************************************* * * Create functions * ********************************************************************** *//* ... */ MENU_Handle MENU_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb); MENU_Handle MENU_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id); MENU_Handle MENU_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes); /********************************************************************* * * The callback ... * * Do not call it directly ! It is only to be used from within an * overwritten callback. *//* ... */ void MENU_Callback(WM_MESSAGE * pMsg); /********************************************************************* * * Individual member functions * ********************************************************************** *//* ... */ void MENU_AddItem (MENU_Handle hObj, const MENU_ITEM_DATA * pItemData); void MENU_Attach (MENU_Handle hObj, WM_HWIN hDestWin, int x, int y, int xSize, int ySize, int Flags); void MENU_DeleteItem (MENU_Handle hObj, U16 ItemId); void MENU_DisableItem (MENU_Handle hObj, U16 ItemId); void MENU_EnableItem (MENU_Handle hObj, U16 ItemId); GUI_COLOR MENU_GetBkColor (MENU_Handle hObj, unsigned ColorIndex); const GUI_FONT * MENU_GetFont (MENU_Handle hObj); void MENU_GetItem (MENU_Handle hObj, U16 ItemId, MENU_ITEM_DATA * pItemData); void MENU_GetItemText (MENU_Handle hObj, U16 ItemId, char * pBuffer, unsigned BufferSize); unsigned MENU_GetNumItems (MENU_Handle hObj); WM_HWIN MENU_GetOwner (MENU_Handle hObj); GUI_COLOR MENU_GetTextColor (MENU_Handle hObj, unsigned ColorIndex); int MENU_GetUserData (MENU_Handle hObj, void * pDest, int NumBytes); void MENU_InsertItem (MENU_Handle hObj, U16 ItemId, const MENU_ITEM_DATA * pItemData); void MENU_Popup (MENU_Handle hObj, WM_HWIN hDestWin, int x, int y, int xSize, int ySize, int Flags); void MENU_SetBkColor (MENU_Handle hObj, unsigned ColorIndex, GUI_COLOR Color); void MENU_SetBorderSize (MENU_Handle hObj, unsigned BorderIndex, U8 BorderSize); void MENU_SetFont (MENU_Handle hObj, const GUI_FONT * pFont); void MENU_SetItem (MENU_Handle hObj, U16 ItemId, const MENU_ITEM_DATA * pItemData); void MENU_SetOwner (MENU_Handle hObj, WM_HWIN hOwner); int MENU_SetSel (MENU_Handle hObj, int Sel); void MENU_SetTextColor (MENU_Handle hObj, unsigned ColorIndex, GUI_COLOR Color); int MENU_SetUserData (MENU_Handle hObj, const void * pSrc, int NumBytes); /********************************************************************* * * Managing default values * ********************************************************************** *//* ... */ GUI_COLOR MENU_GetDefaultTextColor (unsigned ColorIndex); GUI_COLOR MENU_GetDefaultBkColor (unsigned ColorIndex); U8 MENU_GetDefaultBorderSize (unsigned BorderIndex); const WIDGET_EFFECT * MENU_GetDefaultEffect (void); const GUI_FONT * MENU_GetDefaultFont (void); void MENU_SetDefaultTextColor (unsigned ColorIndex, GUI_COLOR Color); void MENU_SetDefaultBkColor (unsigned ColorIndex, GUI_COLOR Color); void MENU_SetDefaultBorderSize (unsigned BorderIndex, U8 BorderSize); void MENU_SetDefaultEffect (const WIDGET_EFFECT * pEffect); void MENU_SetDefaultFont (const GUI_FONT * pFont); /********************************************************************* * * Member functions: Skinning * ********************************************************************** *//* ... */ int MENU_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo); void MENU_GetSkinFlexProps (MENU_SKINFLEX_PROPS * pProps, int Index); WIDGET_DRAW_ITEM_FUNC * MENU_SetDefaultSkin (WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); void MENU_SetDefaultSkinClassic(void); void MENU_SetSkinClassic (MENU_Handle hObj); void MENU_SetSkin (MENU_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin); void MENU_SetSkinFlexProps (const MENU_SKINFLEX_PROPS * pProps, int Index); void MENU_SkinEnableArrow (MENU_Handle hObj, int OnOff); #if defined(__cplusplus) }extern "C" { ... } #endif /* ... */ #endif // GUI_WINSUPPORT/* ... */ #endif // MENU_H /*************************** End of file ****************************/