STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
EDIT.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 : EDIT.h
30 Purpose : EDIT include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef EDIT_H
35 #define EDIT_H
36 
37 #include "WM.h"
38 #include "DIALOG_Intern.h" // Required for Create indirect data structure
39 
40 #if GUI_WINSUPPORT
41 
42 #if defined(__cplusplus)
43  extern "C" { // Make sure we have C-declarations in C++ programs
44 #endif
45 
46 /*********************************************************************
47 *
48 * Defaults for configuration switches
49 *
50 * The following are defaults for config switches which affect the
51 * interface specified in this module
52 *
53 **********************************************************************
54 */
55 /*********************************************************************
56 *
57 * Defines
58 *
59 **********************************************************************
60 */
61 /*********************************************************************
62 *
63 * Create / Status flags
64 */
65 #define EDIT_CF_LEFT GUI_TA_LEFT
66 #define EDIT_CF_RIGHT GUI_TA_RIGHT
67 #define EDIT_CF_HCENTER GUI_TA_HCENTER
68 
69 #define EDIT_CF_VCENTER GUI_TA_VCENTER
70 #define EDIT_CF_TOP GUI_TA_TOP
71 #define EDIT_CF_BOTTOM GUI_TA_BOTTOM
72 
73 /*********************************************************************
74 *
75 * Color indices
76 */
77 #define EDIT_CI_DISABLED 0
78 #define EDIT_CI_ENABLED 1
79 
80 /*********************************************************************
81 *
82 * Types
83 *
84 **********************************************************************
85 */
86 typedef WM_HMEM EDIT_Handle;
87 typedef void tEDIT_AddKeyEx (EDIT_Handle hObj, int Key);
88 typedef void tEDIT_UpdateBuffer(EDIT_Handle hObj);
89 
90 /*********************************************************************
91 *
92 * Create functions
93 */
94 EDIT_Handle EDIT_Create (int x0, int y0, int xSize, int ySize, int Id, int MaxLen, int Flags);
95 EDIT_Handle EDIT_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int MaxLen);
96 EDIT_Handle EDIT_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen);
97 EDIT_Handle EDIT_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen, int NumExtraBytes);
98 EDIT_Handle EDIT_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
99 
100 /*********************************************************************
101 *
102 * The callback ...
103 *
104 * Do not call it directly ! It is only to be used from within an
105 * overwritten callback.
106 */
107 void EDIT_Callback(WM_MESSAGE * pMsg);
108 
109 /*********************************************************************
110 *
111 * Standard member functions
112 */
113 #define EDIT_EnableMemdev(hObj) WM_EnableMemdev(hObj)
114 #define EDIT_DisableMemdev(hObj) WM_DisableMemdev(hObj)
115 #define EDIT_Delete(hObj) WM_DeleteWindow(hObj)
116 #define EDIT_Paint(hObj) WM_Paint(hObj)
117 #define EDIT_Invalidate(hObj) WM_InvalidateWindow(hObj)
118 
119 /*********************************************************************
120 *
121 * Individual member functions
122 */
123 //
124 // Methods changing preferences
125 //
126 void EDIT_SetDefaultBkColor (unsigned int Index, GUI_COLOR Color);
127 void EDIT_SetDefaultFont (const GUI_FONT * pFont);
128 void EDIT_SetDefaultTextAlign(int Align);
129 void EDIT_SetDefaultTextColor(unsigned int Index, GUI_COLOR Color);
130 //
131 // Query preferences
132 //
133 GUI_COLOR EDIT_GetDefaultBkColor(unsigned int Index);
134 const GUI_FONT * EDIT_GetDefaultFont(void);
135 int EDIT_GetDefaultTextAlign(void);
136 GUI_COLOR EDIT_GetDefaultTextColor(unsigned int Index);
137 //
138 // Methods changing properties
139 //
140 void EDIT_AddKey (EDIT_Handle hObj, int Key);
141 void EDIT_EnableBlink (EDIT_Handle hObj, int Period, int OnOff);
142 GUI_COLOR EDIT_GetBkColor (EDIT_Handle hObj, unsigned int Index);
143 void EDIT_SetBkColor (EDIT_Handle hObj, unsigned int Index, GUI_COLOR color);
144 void EDIT_SetCursorAtChar (EDIT_Handle hObj, int Pos);
145 void EDIT_SetCursorAtPixel (EDIT_Handle hObj, int xPos);
146 void EDIT_SetFocussable (EDIT_Handle hObj, int State);
147 void EDIT_SetFont (EDIT_Handle hObj, const GUI_FONT * pFont);
148 int EDIT_SetInsertMode (EDIT_Handle hObj, int OnOff);
149 void EDIT_SetMaxLen (EDIT_Handle hObj, int MaxLen);
150 void EDIT_SetpfAddKeyEx (EDIT_Handle hObj, tEDIT_AddKeyEx * pfAddKeyEx);
151 void EDIT_SetpfUpdateBuffer(EDIT_Handle hObj, tEDIT_UpdateBuffer * pfUpdateBuffer);
152 void EDIT_SetText (EDIT_Handle hObj, const char * s);
153 void EDIT_SetTextAlign (EDIT_Handle hObj, int Align);
154 GUI_COLOR EDIT_GetTextColor(EDIT_Handle hObj, unsigned int Index);
155 void EDIT_SetTextColor (EDIT_Handle hObj, unsigned int Index, GUI_COLOR Color);
156 void EDIT_SetSel (EDIT_Handle hObj, int FirstChar, int LastChar);
157 int EDIT_SetUserData (EDIT_Handle hObj, const void * pSrc, int NumBytes);
158 //
159 // Get/Set user input
160 //
161 int EDIT_GetCursorCharPos (EDIT_Handle hObj);
162 void EDIT_GetCursorPixelPos (EDIT_Handle hObj, int * pxPos, int * pyPos);
163 float EDIT_GetFloatValue (EDIT_Handle hObj);
164 const GUI_FONT * EDIT_GetFont(EDIT_Handle hObj);
165 int EDIT_GetNumChars (EDIT_Handle hObj);
166 void EDIT_GetText (EDIT_Handle hObj, char * sDest, int MaxLen);
167 I32 EDIT_GetValue (EDIT_Handle hObj);
168 void EDIT_SetFloatValue (EDIT_Handle hObj, float Value);
169 int EDIT_GetUserData (EDIT_Handle hObj, void * pDest, int NumBytes);
170 void EDIT_SetValue (EDIT_Handle hObj, I32 Value);
171 
172 /*********************************************************************
173 *
174 * Routines for editing values
175 *
176 **********************************************************************
177 */
178 void EDIT_SetHexMode (EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
179 void EDIT_SetBinMode (EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
180 void EDIT_SetDecMode (EDIT_Handle hEdit, I32 Value, I32 Min, I32 Max, int Shift, U8 Flags);
181 void EDIT_SetFloatMode(EDIT_Handle hEdit, float Value, float Min, float Max, int Shift, U8 Flags);
182 void EDIT_SetTextMode (EDIT_Handle hEdit);
183 void EDIT_SetUlongMode(EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
184 
185 U32 GUI_EditHex (U32 Value, U32 Min, U32 Max, int Len, int xSize);
186 U32 GUI_EditBin (U32 Value, U32 Min, U32 Max, int Len, int xSize);
187 I32 GUI_EditDec (I32 Value, I32 Min, I32 Max, int Len, int xSize, int Shift, U8 Flags);
188 float GUI_EditFloat (float Value, float Min, float Max, int Len, int xSize, int Shift, U8 Flags);
189 void GUI_EditString (char * pString, int Len, int xSize);
190 
191 /*********************************************************************
192 *
193 * Flags
194 *
195 **********************************************************************
196 */
197 //
198 // Signed or normal mode
199 //
200 #define GUI_EDIT_NORMAL (0 << 0)
201 #define GUI_EDIT_SIGNED (1 << 0)
202 #define GUI_EDIT_SUPPRESS_LEADING_ZEROES (1 << 1)
203 //
204 // Edit modes
205 //
206 #define GUI_EDIT_MODE_INSERT 0
207 #define GUI_EDIT_MODE_OVERWRITE 1
208 //
209 // Compatibility macros
210 //
211 #define EDIT_CI_DISABELD EDIT_CI_DISABLED
212 #define EDIT_CI_ENABELD EDIT_CI_ENABLED
213 
214 #if defined(__cplusplus)
215  }
216 #endif
217 
218 #endif // GUI_WINSUPPORT
219 #endif // EDIT_H
220 
221 /*************************** End of file ****************************/
#define U32
Definition: Global.h:50
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define I32
Definition: Global.h:59
#define U8
Definition: Global.h:44