eGUI alias D4D  Release 3.0
Reference Manual
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
d4d_group_box.h
Go to the documentation of this file.
1 /**************************************************************************
2 *
3 * Copyright 2014 by Petr Gargulak. eGUI Community.
4 * Copyright 2009-2013 by Petr Gargulak. Freescale Semiconductor, Inc.
5 *
6 ***************************************************************************
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License Version 3
9 * or later (the "LGPL").
10 *
11 * As a special exception, the copyright holders of the eGUI project give you
12 * permission to link the eGUI sources with independent modules to produce an
13 * executable, regardless of the license terms of these independent modules,
14 * and to copy and distribute the resulting executable under terms of your
15 * choice, provided that you also meet, for each linked independent module,
16 * the terms and conditions of the license of that module.
17 * An independent module is a module which is not derived from or based
18 * on this library.
19 * If you modify the eGUI sources, you may extend this exception
20 * to your version of the eGUI sources, but you are not obligated
21 * to do so. If you do not wish to do so, delete this
22 * exception statement from your version.
23 *
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
27 *
28 * You should have received a copy of the GNU General Public License
29 * and the GNU Lesser General Public License along with this program.
30 * If not, see <http://www.gnu.org/licenses/>.
31 *
32 ***************************************************************************/
46 #ifndef __D4D_GROUP_BOX_H
47 #define __D4D_GROUP_BOX_H
48 
50 
51 /******************************************************************************
52 * D4D GROUP BOX setting constants
53 *
54 */
58 //********************* Group Box flags for its specific flags *****************
69  #define D4D_GROUP_BOX_F_CONTENT_OUTLINE (0x01 << D4D_OBJECT_F_OBJECT_SHIFT)
70 
71 
76 #ifndef D4D_GROUP_BOX_F_DEFAULT
77  #define D4D_GROUP_BOX_F_DEFAULT (D4D_OBJECT_F_VISIBLE | D4D_OBJECT_F_ENABLED | D4D_OBJECT_F_MOUSE_NORMAL | D4D_OBJECT_F_TOUCHENABLE | D4D_OBJECT_F_BEVEL_RAISED | D4D_GROUP_BOX_F_CONTENT_OUTLINE)
78 #endif
79 
82 #ifndef D4D_GROUP_BOX_TEXT_OFFSET
83  #define D4D_GROUP_BOX_TEXT_OFFSET 6
84 #endif
85 
88 #ifndef D4D_GROUP_BOX_HEADER_MARGIN
89  #define D4D_GROUP_BOX_HEADER_MARGIN 16
90 #endif
91 
94 #ifndef D4D_GROUP_BOX_FRAME_MARGIN
95  #define D4D_GROUP_BOX_FRAME_MARGIN 4
96 #endif
97 
100 /******************************************************************************
101 * Types
102 ******************************************************************************/
103 
104 // groupBox configuration (goes to ROM by default)
105 
106 typedef struct
107 {
108  D4D_STRING textBuff; // group box text
109 } D4D_GROUP_BOX;
110 
111 
112 /******************************************************************************
113 * Macros
114 ******************************************************************************/
115 
116 // getting the GROUP_BOX structure from general OBJECT
117 #define D4D_GET_GROUP_BOX(pObj) ((D4D_GROUP_BOX*)((pObj)->pParam))
118 
119 /******************************************************************************
120 * D4D GROUP BOX setting public macros
121 *
122 */
126 /**************************************************************************/
148 #define _D4D_DECLARE_GROUP_BOX(type, name, x, y, cx, cy, radius, pMargin, pRelations, text, fontId, flags, pScheme, pUser, pOnUsrMsg) \
149  static D4D_STR_PROPERTIES name##_strPrties = { D4D_FNT_PRTY_TRANSPARENT_NO_MASK, (D4D_TXT_PRTY_ALIGN_H_CENTER_MASK | D4D_TXT_PRTY_ALIGN_V_CENTER_MASK)}; \
150  static type D4D_GROUP_BOX name##_params = \
151  { \
152  { text, sizeof(text), fontId, &name##_strPrties, D4D_OBJECT_MAX_TEXT_LEN(text), 0}, /* textBuff */ \
153  }; \
154  \
155  D4D_DECLARE_OBJECT(type, name, x, y, cx, cy, radius, pMargin, pRelations, pOnUsrMsg, &d4d_groupBoxSysFunc, &(name##_params), flags, pUser, pScheme)
156 
157 
158 
159 /**************************************************************************/
190 #define D4D_DECLARE_GROUP_BOX_BEGIN(name, x, y, cx, cy, radius, pParent, pMargin, text, fontId, flags, pScheme, pUser, pOnUsrMsg)\
191  extern const D4D_OBJECT* const name##_pRelations[];\
192  _D4D_DECLARE_GROUP_BOX(D4D_CONST, name, x, y, cx, cy, radius, pMargin, name##_pRelations, text, fontId, flags, pScheme, pUser, pOnUsrMsg)\
193  D4D_DECLARE_OBJECT_RELATIONS_BEGIN(name##_pRelations, pParent)
194 
195 /**************************************************************************/
208 #define D4D_DECLARE_GROUP_BOX_OBJECT(name) D4D_DECLARE_OBJECT_RELATIONS_CHILD(name)
209 
210 /**************************************************************************/
222 #define D4D_DECLARE_GROUP_BOX_OBJECT_END D4D_DECLARE_OBJECT_RELATIONS_END
223 
224 /**************************************************************************/
250 #define D4D_DECLARE_STD_GROUP_BOX_BEGIN(name, x, y, cx, cy, radius, pParent, text, fontId) \
251  D4D_DECLARE_GROUP_BOX_BEGIN(name, x, y, cx, cy, radius, pParent, &groupBox_marginDefault, text, fontId, (D4D_GROUP_BOX_F_DEFAULT), NULL, NULL, NULL)
252 
253 
254 //IN RAM instantions macros
255 /**************************************************************************/
258 #define D4D_DECLARE_GROUP_BOX_BEGIN_INRAM(name, x, y, cx, cy, radius, pParent, pMargin, text, fontId, flags, pScheme, pUser, pOnUsrMsg)\
259  extern const D4D_OBJECT* const name##_pRelations[];\
260  _D4D_DECLARE_GROUP_BOX(D4D_NO_CONST, name, x, y, cx, cy, radius, pMargin, name##_pRelations, text, fontId, flags, pScheme, pUser, pOnUsrMsg)\
261  D4D_DECLARE_OBJECT_RELATIONS_BEGIN(name##_pRelations, pParent)
262 
263 /**************************************************************************/
266 #define D4D_DECLARE_STD_GROUP_BOX_BEGIN_INRAM(name, x, y, cx, cy, radius, pParent, text, fontId) \
267  D4D_DECLARE_GROUP_BOX_BEGIN_INRAM(name, x, y, cx, cy, radius, pParent, &groupBox_marginDefault, text, fontId, (D4D_GROUP_BOX_F_DEFAULT), NULL, NULL, NULL)
268 
271 /******************************************************************************
272 * Global variables
273 ******************************************************************************/
274 
276 
277 /******************************************************************************
278 * Global functions
279 ******************************************************************************/
280 
281 
282 
283 #endif /* __D4D_GROUP_BOX_H */
D4D_STRING textBuff
The string type. This structure contains all properties about string in eGUI.
Definition: d4d_string.h:100
const D4D_OBJECT_SYS_FUNCTION d4d_groupBoxSysFunc
Definition: d4d_group_box.c:61
D4D_MARGIN groupBox_marginDefault
Definition: d4d_group_box.c:53
The object system function needed for each object - this is part of D4D_OBJECT main structure...
Definition: d4d_object.h:134
Type definition of eGUI client area margin structure.
Definition: d4d_types.h:244