STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
SPINBOX_Private.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 : SPINBOX_Private.h
30 Purpose : Private SPINBOX include
31 --------------------END-OF-HEADER-------------------------------------
32 */
33 
34 #ifndef SPINBOX_PRIVATE_H
35 #define SPINBOX_PRIVATE_H
36 
37 #include "SPINBOX.h"
38 #include "EDIT.h"
39 #include "GUI_Private.h"
40 
41 #if GUI_WINSUPPORT
42 
43 /*********************************************************************
44 *
45 * Private config defaults
46 *
47 **********************************************************************
48 */
49 
50 /*********************************************************************
51 *
52 * Object definition
53 *
54 **********************************************************************
55 */
56 typedef struct {
57  WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
58 } SPINBOX_SKIN_PRIVATE;
59 
60 typedef struct {
61  GUI_COLOR aButtonBkColor[3]; // Button background color for the states (disabled, pressed, unpressed).
62  GUI_COLOR aButtonUpperColor[3]; // Upper color for the button states (disabled, pressed, unpressed).
63  GUI_COLOR aButtonLowerColor[3]; // Lower color for the button states (disabled, pressed, unpressed).
64  GUI_COLOR aButtonOuterColor[3]; // Outer color for the button states (disabled, pressed, unpressed).
65  GUI_COLOR aTriangleColor[3]; // Color of the triangle for the button states (disabled, pressed, unpressed).
66  GUI_COLOR aBkColor[2]; // Background color for the states (enabled, disabled).
67  GUI_COLOR aTextColor[2]; // Text color for the states (enabled, disabled).
68  I32 Min; // Minimum allowed value.
69  I32 Max; // Maximum allowed value.
70  U16 Step; // Value will be increased/decreased by this amount when a button is clicked.
71  U16 ButtonSize; // Size of the button depending on the orientation.
72  U8 Edge; // Buttons reside on the left or right edge of the widget.
73  SPINBOX_SKIN_PRIVATE SkinPrivate; // Structure containing a pointer to the used DrawSkin-function.
74 } SPINBOX_PROPS;
75 
76 typedef struct {
77  WIDGET Widget;
78  SPINBOX_PROPS Props;
79  const WIDGET_SKIN * pWidgetSkin;
80  EDIT_Handle hEdit;
81  GUI_TIMER_HANDLE hTimer;
82  I8 TimerButton;
83  I8 LastButton;
84  I8 NoAction;
85  U8 State; // Pressed state
86 } SPINBOX_OBJ;
87 
88 /*********************************************************************
89 *
90 * Macros for internal use
91 *
92 **********************************************************************
93 */
94 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
95  #define SPINBOX_INIT_ID(p) (p->Widget.DebugId = SPINBOX_ID)
96 #else
97  #define SPINBOX_INIT_ID(p)
98 #endif
99 
100 #if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
101  SPINBOX_OBJ * SPINBOX_LockH(SPINBOX_Handle h);
102  #define SPINBOX_LOCK_H(h) SPINBOX_LockH(h)
103 #else
104  #define SPINBOX_LOCK_H(h) (SPINBOX_OBJ *)GUI_LOCK_H(h)
105 #endif
106 
107 #define SPINBOX_BUTTON_NONE -1
108 #define SPINBOX_BUTTON_0 0
109 #define SPINBOX_BUTTON_1 1
110 
111 #define SPINBOX_TIMER_ID 1234
112 
113 /*********************************************************************
114 *
115 * Private function prototypes
116 *
117 **********************************************************************
118 */
119 void SPINBOX__ApplyProps (SPINBOX_Handle hObj, SPINBOX_SKINFLEX_PROPS * const * ppProps);
120 void SPINBOX__DrawBk (SPINBOX_Handle hObj, GUI_COLOR Color);
121 void SPINBOX__GetButtonRect (SPINBOX_Handle hObj, GUI_RECT * pButtonRect, U8 ButtonIndex);
122 void SPINBOX__GetButtonRectEx(SPINBOX_Handle hObj, WIDGET_ITEM_DRAW_INFO * ItemInfo);
123 int SPINBOX__GetDefaultMax (void);
124 int SPINBOX__GetDefaultMin (void);
125 
126 /*********************************************************************
127 *
128 * Module internal data
129 *
130 **********************************************************************
131 */
132 /*********************************************************************
133 *
134 * Public data (internal defaults)
135 *
136 **********************************************************************
137 */
138 extern SPINBOX_PROPS SPINBOX__DefaultProps;
139 extern const WIDGET_SKIN SPINBOX__SkinClassic;
140 extern WIDGET_SKIN SPINBOX__Skin;
141 extern const WIDGET_SKIN * SPINBOX__pSkinDefault;
142 
143 #endif // GUI_WINSUPPORT
144 #endif // SPINBOX_PRIVATE_H
145 
146 /*************************** End of file ****************************/
GUI_HMEM GUI_TIMER_HANDLE
Definition: GUI.h:1184
Definition: LCD.h:102
#define I8
Definition: Global.h:53
LCD_COLOR GUI_COLOR
Definition: GUI_Type.h:50
#define U16
Definition: Global.h:47
#define I32
Definition: Global.h:59
#define U8
Definition: Global.h:44