STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
CHECKBOX.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 : CHECKBOX.h
30 Purpose : CHECKBOX include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef CHECKBOX_H
35 #define CHECKBOX_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 
54 /*********************************************************************
55 *
56 * Color indices
57 */
58 #define CHECKBOX_CI_DISABLED 0
59 #define CHECKBOX_CI_ENABLED 1
60 
61 /*********************************************************************
62 *
63 * Bitmap indices
64 */
65 #define CHECKBOX_BI_INACTIV_UNCHECKED 0
66 #define CHECKBOX_BI_ACTIV_UNCHECKED 1
67 #define CHECKBOX_BI_INACTIV_CHECKED 2
68 #define CHECKBOX_BI_ACTIV_CHECKED 3
69 #define CHECKBOX_BI_INACTIV_3STATE 4
70 #define CHECKBOX_BI_ACTIV_3STATE 5
71 
72 /*********************************************************************
73 *
74 * Skinning property indices
75 */
76 #define CHECKBOX_SKINFLEX_PI_ENABLED 0
77 #define CHECKBOX_SKINFLEX_PI_DISABLED 1
78 
79 /*********************************************************************
80 *
81 * Public Types
82 *
83 **********************************************************************
84 */
85 typedef WM_HMEM CHECKBOX_Handle;
86 
87 typedef struct {
88  GUI_COLOR aColorFrame[3];
89  GUI_COLOR aColorInner[2];
90  GUI_COLOR ColorCheck;
91  int ButtonSize;
92 } CHECKBOX_SKINFLEX_PROPS;
93 
94 /*********************************************************************
95 *
96 * Create functions
97 *
98 **********************************************************************
99 */
100 CHECKBOX_Handle CHECKBOX_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags);
101 CHECKBOX_Handle CHECKBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
102 CHECKBOX_Handle CHECKBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
103 CHECKBOX_Handle CHECKBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
104 
105 /*********************************************************************
106 *
107 * The callback ...
108 *
109 * Do not call it directly ! It is only to be used from within an
110 * overwritten callback.
111 */
112 void CHECKBOX_Callback(WM_MESSAGE * pMsg);
113 
114 /*********************************************************************
115 *
116 * Standard member functions
117 *
118 **********************************************************************
119 */
120 
121 int CHECKBOX_GetDefaultAlign (void);
122 GUI_COLOR CHECKBOX_GetDefaultBkColor (void);
123 const GUI_FONT * CHECKBOX_GetDefaultFont (void);
124 int CHECKBOX_GetDefaultSpacing (void);
125 int CHECKBOX_GetDefaultTextAlign (void);
126 GUI_COLOR CHECKBOX_GetDefaultTextColor (void);
127 int CHECKBOX_GetUserData (CHECKBOX_Handle hObj, void * pDest, int NumBytes);
128 void CHECKBOX_SetDefaultAlign (int Align);
129 void CHECKBOX_SetDefaultBkColor (GUI_COLOR Color);
130 GUI_COLOR CHECKBOX_SetDefaultFocusColor(GUI_COLOR Color);
131 void CHECKBOX_SetDefaultFont (const GUI_FONT * pFont);
132 void CHECKBOX_SetDefaultImage (const GUI_BITMAP * pBitmap, unsigned int Index);
133 void CHECKBOX_SetDefaultSpacing (int Spacing);
134 void CHECKBOX_SetDefaultTextAlign (int Align);
135 void CHECKBOX_SetDefaultTextColor (GUI_COLOR Color);
136 int CHECKBOX_SetUserData (CHECKBOX_Handle hObj, const void * pSrc, int NumBytes);
137 
138 /*********************************************************************
139 *
140 * Member functions
141 *
142 **********************************************************************
143 */
144 
145 int CHECKBOX_GetState (CHECKBOX_Handle hObj);
146 int CHECKBOX_GetText (CHECKBOX_Handle hObj, char * pBuffer, int MaxLen);
147 int CHECKBOX_IsChecked (CHECKBOX_Handle hObj);
148 void CHECKBOX_SetBkColor (CHECKBOX_Handle hObj, GUI_COLOR Color);
149 GUI_COLOR CHECKBOX_SetBoxBkColor(CHECKBOX_Handle hObj, GUI_COLOR Color, int Index);
150 GUI_COLOR CHECKBOX_SetFocusColor(CHECKBOX_Handle hObj, GUI_COLOR Color);
151 void CHECKBOX_SetFont (CHECKBOX_Handle hObj, const GUI_FONT * pFont);
152 void CHECKBOX_SetImage (CHECKBOX_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index);
153 void CHECKBOX_SetNumStates (CHECKBOX_Handle hObj, unsigned NumStates);
154 void CHECKBOX_SetSpacing (CHECKBOX_Handle hObj, unsigned Spacing);
155 void CHECKBOX_SetState (CHECKBOX_Handle hObj, unsigned State);
156 void CHECKBOX_SetText (CHECKBOX_Handle hObj, const char * pText);
157 void CHECKBOX_SetTextAlign (CHECKBOX_Handle hObj, int Align);
158 void CHECKBOX_SetTextColor (CHECKBOX_Handle hObj, GUI_COLOR Color);
159 
160 /*********************************************************************
161 *
162 * Member functions: Skinning
163 *
164 **********************************************************************
165 */
166 void CHECKBOX_GetSkinFlexProps (CHECKBOX_SKINFLEX_PROPS * pProps, int Index);
167 void CHECKBOX_SetSkinClassic (CHECKBOX_Handle hObj);
168 void CHECKBOX_SetSkin (CHECKBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
169 int CHECKBOX_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
170 void CHECKBOX_SetSkinFlexProps (const CHECKBOX_SKINFLEX_PROPS * pProps, int Index);
171 void CHECKBOX_SetDefaultSkinClassic (void);
172 int CHECKBOX_GetSkinFlexButtonSize (CHECKBOX_Handle hObj);
173 void CHECKBOX_SetSkinFlexButtonSize (CHECKBOX_Handle hObj, int ButtonSize);
174 WIDGET_DRAW_ITEM_FUNC * CHECKBOX_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
175 
176 #define CHECKBOX_SKIN_FLEX CHECKBOX_DrawSkinFlex
177 
178 /*********************************************************************
179 *
180 * Macros for compatibility
181 *
182 **********************************************************************
183 */
184 
185 #define CHECKBOX_Check(hObj) CHECKBOX_SetState(hObj, 1)
186 #define CHECKBOX_Uncheck(hObj) CHECKBOX_SetState(hObj, 0)
187 
188 #define CHECKBOX_BI_INACTIV CHECKBOX_BI_INACTIV_CHECKED
189 #define CHECKBOX_BI_ACTIV CHECKBOX_BI_ACTIV_CHECKED
190 
191 #if defined(__cplusplus)
192  }
193 #endif
194 
195 #endif // GUI_WINSUPPORT
196 #endif // CHECKBOX_H
197 
198 /*************************** End of file ****************************/
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50