WebRadioApp  0.1
_WidgetSetPushButton.h
Go to the documentation of this file.
1 /*******************************************************************************
2 *
3 * E M B E D D E D W I Z A R D P R O J E C T
4 *
5 * Copyright (c) TARA Systems GmbH
6 * written by Paul Banach and Manfred Schweyer
7 *
8 ********************************************************************************
9 *
10 * This file was generated automatically by Embedded Wizard Studio.
11 *
12 * Please do not make any modifications of this file! The modifications are lost
13 * when the file is generated again by Embedded Wizard Studio!
14 *
15 * The template of this heading text can be found in the file 'head.ewt' in the
16 * directory 'Platforms' of your Embedded Wizard installation directory. If you
17 * wish to adapt this text, please copy the template file 'head.ewt' into your
18 * project directory and edit the copy only. Please avoid any modifications of
19 * the original template file!
20 *
21 * Version : 10.00
22 * Profile : STM32H747
23 * Platform : STM.STM32.RGB565
24 *
25 *******************************************************************************/
26 
27 #ifndef _WidgetSetPushButton_H
28 #define _WidgetSetPushButton_H
29 
30 #ifdef __cplusplus
31  extern "C"
32  {
33 #endif
34 
35 #include "ewrte.h"
36 #if EW_RTE_VERSION != 0x000A0000
37  #error Wrong version of Embedded Wizard Runtime Environment.
38 #endif
39 
40 #include "ewgfx.h"
41 #if EW_GFX_VERSION != 0x000A0000
42  #error Wrong version of Embedded Wizard Graphics Engine.
43 #endif
44 
45 #include "_CoreGroup.h"
46 #include "_CoreKeyPressHandler.h"
48 #include "_CoreTimer.h"
49 
50 /* Forward declaration of the class Core::DialogContext */
51 #ifndef _CoreDialogContext_
52  EW_DECLARE_CLASS( CoreDialogContext )
53 #define _CoreDialogContext_
54 #endif
55 
56 /* Forward declaration of the class Core::LayoutContext */
57 #ifndef _CoreLayoutContext_
58  EW_DECLARE_CLASS( CoreLayoutContext )
59 #define _CoreLayoutContext_
60 #endif
61 
62 /* Forward declaration of the class Core::TaskQueue */
63 #ifndef _CoreTaskQueue_
64  EW_DECLARE_CLASS( CoreTaskQueue )
65 #define _CoreTaskQueue_
66 #endif
67 
68 /* Forward declaration of the class Core::View */
69 #ifndef _CoreView_
70  EW_DECLARE_CLASS( CoreView )
71 #define _CoreView_
72 #endif
73 
74 /* Forward declaration of the class Effects::Fader */
75 #ifndef _EffectsFader_
77 #define _EffectsFader_
78 #endif
79 
80 /* Forward declaration of the class Graphics::Canvas */
81 #ifndef _GraphicsCanvas_
82  EW_DECLARE_CLASS( GraphicsCanvas )
83 #define _GraphicsCanvas_
84 #endif
85 
86 /* Forward declaration of the class Resources::Bitmap */
87 #ifndef _ResourcesBitmap_
88  EW_DECLARE_CLASS( ResourcesBitmap )
89 #define _ResourcesBitmap_
90 #endif
91 
92 /* Forward declaration of the class Views::Frame */
93 #ifndef _ViewsFrame_
94  EW_DECLARE_CLASS( ViewsFrame )
95 #define _ViewsFrame_
96 #endif
97 
98 /* Forward declaration of the class Views::Image */
99 #ifndef _ViewsImage_
100  EW_DECLARE_CLASS( ViewsImage )
101 #define _ViewsImage_
102 #endif
103 
104 /* Forward declaration of the class Views::Text */
105 #ifndef _ViewsText_
106  EW_DECLARE_CLASS( ViewsText )
107 #define _ViewsText_
108 #endif
109 
110 /* Forward declaration of the class WidgetSet::PushButton */
111 #ifndef _WidgetSetPushButton_
112  EW_DECLARE_CLASS( WidgetSetPushButton )
113 #define _WidgetSetPushButton_
114 #endif
115 
116 /* Forward declaration of the class WidgetSet::PushButtonConfig */
117 #ifndef _WidgetSetPushButtonConfig_
118  EW_DECLARE_CLASS( WidgetSetPushButtonConfig )
119 #define _WidgetSetPushButtonConfig_
120 #endif
121 
122 
123 /* This class implements the monostable 'push button' widget. When the user taps
124  on the button, the button sends a signal to the slot method stored in its @OnActivate
125  property. By connecting further slot methods to the properties @OnPress, @OnRelease,
126  @OnEnter and @OnLeave you can react to other events triggered while the user
127  interacts with the button.
128  During its lifetime the button remains always in one of the four states: 'disabled',
129  'default', 'focused' and 'active'. The state 'disabled' is true for every not
130  available button (the property @Enabled of the button is 'false'). Such buttons
131  will ignore all user inputs. The state 'default' determines a button, which is
132  ready to be touched by the user or ready to become focused. As soon as the button
133  becomes focused, it switches in the state 'focused'. In this state the user can
134  activate the button by pressing a key on the keyboard. Finally, the state 'active'
135  is true, if the user actually interacts with the button (the button is pressed).
136  The exact look and feel of the push button is determined by the 'Push Button
137  Configuration' object assigned to the property @Appearance. The configuration
138  object provides bitmaps, colors, fonts and other configuration parameters needed
139  to construct and display the push button. Usually, you will manage in your project
140  your own configuration objects and customize the push buttons according to your
141  design expectations. Depending on the information provided in the associated
142  configuration object, the push button will be composed of following views:
143  - 'Face' is a bitmap frame view (Views::Frame) filling per default the entire
144  background of the button. In the configuration object you can individually specify
145  for every button state the desired bitmap, its opacity, frame number (if the
146  bitmap is multi-frame) and tint color (if the bitmap contains Alpha8 information
147  only). The button can automatically play animated bitmaps. If desired, you can
148  also configure the bitmap to be arranged horizontally and vertically instead
149  of filling the entire widget area.
150  - 'Icon' is an image view (Views::Image) displayed per default in the center
151  of the button. The corresponding bitmap is determined in the property @Icon.
152  If the bitmap is multi-frame, the desired frame number can be selected by using
153  the property @IconFrame or individually for every button state by using the properties
154  @IconFrameActive, @IconFrameDefault, @IconFrameDisabled and @IconFrameFocused.
155  In the configuration object you can specify the alignment and margins how to
156  arrange the @Icon bitmap within the button area. Furthermore, for every button
157  state the opacity and tint color (if the @Icon bitmap contains Alpha8 information
158  only) can be determined. The button can automatically play animated bitmaps.
159  - 'Label' is a text view (Views::Text) displayed per default in the center of
160  the button. The corresponding text is determined in the property @Label. In the
161  configuration object you can specify the font, alignment and margins to use for
162  the text view. For every button state you can specify individual text color values.
163  In particular application cases you can instruct the button to automatically
164  resign and retarget the actual touch interaction to another touch handler (e.g.
165  another widget) after the user has performed a horizontal wipe gesture (@ResignAfterHorizontalWipe)
166  or vertical wipe gesture (@ResignAfterVerticalWipe). Using these properties several
167  widgets can cooperate during an active user interaction even if these handler
168  overlap each other.
169  If the button is actually focused, it can also be activated by pressing the keyboard
170  key Core::KeyCode.Enter. In the configuration object you can specify another
171  key code, if desired. To prevent the button from being able to be focused, specify
172  in the configuration object the Core::KeyCode.NoKey as the code to activate the
173  button.
174  For more details regarding the customization of the button see the description
175  of WidgetSet::PushButtonConfig class. */
176 EW_DEFINE_FIELDS( WidgetSetPushButton, CoreGroup )
177  EW_VARIABLE( textView, ViewsText )
178  EW_VARIABLE( imageView, ViewsImage )
179  EW_VARIABLE( frameView, ViewsFrame )
180  EW_PROPERTY( Icon, ResourcesBitmap )
181  EW_PROPERTY( Appearance, WidgetSetPushButtonConfig )
182  EW_PROPERTY( OnLeave, XSlot )
183  EW_PROPERTY( OnEnter, XSlot )
184  EW_PROPERTY( OnRelease, XSlot )
185  EW_PROPERTY( OnPress, XSlot )
186  EW_PROPERTY( OnActivate, XSlot )
187  EW_OBJECT ( FlashTimer, CoreTimer )
188  EW_OBJECT ( KeyHandler, CoreKeyPressHandler )
189  EW_OBJECT ( TouchHandler, CoreSimpleTouchHandler )
190  EW_PROPERTY( Label, XString )
191  EW_VARIABLE( onPressKeyTime, XUInt32 )
192  EW_PROPERTY( IconFrameActive, XInt32 )
193  EW_PROPERTY( IconFrameFocused, XInt32 )
194  EW_PROPERTY( IconFrameDisabled, XInt32 )
195  EW_PROPERTY( IconFrameDefault, XInt32 )
196 EW_END_OF_FIELDS( WidgetSetPushButton )
197 
198 /* Virtual Method Table (VMT) for the class : 'WidgetSet::PushButton' */
199 EW_DEFINE_METHODS( WidgetSetPushButton, CoreGroup )
200  EW_METHOD( initLayoutContext, void )( CoreRectView _this, XRect aBounds, CoreOutline
201  aOutline )
202  EW_METHOD( GetRoot, CoreRoot )( CoreView _this )
203  EW_METHOD( Draw, void )( CoreGroup _this, GraphicsCanvas aCanvas,
205  EW_METHOD( HandleEvent, XObject )( CoreView _this, CoreEvent aEvent )
206  EW_METHOD( CursorHitTest, CoreCursorHit )( CoreGroup _this, XRect aArea, XInt32
207  aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason )
208  EW_METHOD( ArrangeView, XPoint )( CoreRectView _this, XRect aBounds, XEnum
209  aFormation )
210  EW_METHOD( MoveView, void )( CoreRectView _this, XPoint aOffset, XBool
211  aFastMove )
212  EW_METHOD( GetExtent, XRect )( CoreRectView _this )
213  EW_METHOD( ChangeViewState, void )( CoreGroup _this, XSet aSetState, XSet aClearState )
214  EW_METHOD( OnSetBounds, void )( WidgetSetPushButton _this, XRect value )
215  EW_METHOD( drawContent, void )( CoreGroup _this, GraphicsCanvas aCanvas,
217  EW_METHOD( OnSetFocus, void )( CoreGroup _this, CoreView value )
218  EW_METHOD( OnSetBuffered, void )( CoreGroup _this, XBool value )
219  EW_METHOD( OnSetOpacity, void )( CoreGroup _this, XInt32 value )
220  EW_METHOD( IsDialog, XBool )( CoreGroup _this, XBool aRecursive )
221  EW_METHOD( DispatchEvent, XObject )( CoreGroup _this, CoreEvent aEvent )
222  EW_METHOD( BroadcastEvent, XObject )( CoreGroup _this, CoreEvent aEvent, XSet
223  aFilter )
224  EW_METHOD( UpdateLayout, void )( CoreGroup _this, XPoint aSize )
225  EW_METHOD( UpdateViewState, void )( WidgetSetPushButton _this, XSet aState )
226  EW_METHOD( InvalidateArea, void )( CoreGroup _this, XRect aArea )
227 EW_END_OF_METHODS( WidgetSetPushButton )
228 
229 /* 'C' function for method : 'WidgetSet::PushButton.OnSetBounds()' */
230 void WidgetSetPushButton_OnSetBounds( WidgetSetPushButton _this, XRect value );
231 
232 /* The method UpdateViewState() is invoked automatically after the state of the
233  component has been changed. This method can be overridden and filled with logic
234  to ensure the visual aspect of the component does reflect its current state.
235  For example, the 'enabled' state of the component can affect its colors (disabled
236  components may appear pale). In this case the logic of the method should modify
237  the respective color properties accordingly to the current 'enabled' state.
238  The current state of the component is passed as a set in the parameter aState.
239  It reflects the very basic component state like its visibility or the ability
240  to react to user inputs. Beside this common state, the method can also involve
241  any other variables used in the component as long as they reflect its current
242  state. For example, the toggle switch component can take in account its toggle
243  state 'on' or 'off' and change accordingly the location of the slider, etc.
244  Usually, this method will be invoked automatically by the framework. Optionally
245  you can request its invocation by using the method @InvalidateViewState(). */
246 void WidgetSetPushButton_UpdateViewState( WidgetSetPushButton _this, XSet aState );
247 
248 /* 'C' function for method : 'WidgetSet::PushButton.onConfigChanged()' */
249 void WidgetSetPushButton_onConfigChanged( WidgetSetPushButton _this, XObject sender );
250 
251 /* 'C' function for method : 'WidgetSet::PushButton.onFlashTimer()' */
252 void WidgetSetPushButton_onFlashTimer( WidgetSetPushButton _this, XObject sender );
253 
254 /* 'C' function for method : 'WidgetSet::PushButton.onReleaseKey()' */
255 void WidgetSetPushButton_onReleaseKey( WidgetSetPushButton _this, XObject sender );
256 
257 /* 'C' function for method : 'WidgetSet::PushButton.onPressKey()' */
258 void WidgetSetPushButton_onPressKey( WidgetSetPushButton _this, XObject sender );
259 
260 /* 'C' function for method : 'WidgetSet::PushButton.onLeaveTouch()' */
261 void WidgetSetPushButton_onLeaveTouch( WidgetSetPushButton _this, XObject sender );
262 
263 /* 'C' function for method : 'WidgetSet::PushButton.onEnterTouch()' */
264 void WidgetSetPushButton_onEnterTouch( WidgetSetPushButton _this, XObject sender );
265 
266 /* 'C' function for method : 'WidgetSet::PushButton.onReleaseTouch()' */
267 void WidgetSetPushButton_onReleaseTouch( WidgetSetPushButton _this, XObject sender );
268 
269 /* 'C' function for method : 'WidgetSet::PushButton.onPressTouch()' */
270 void WidgetSetPushButton_onPressTouch( WidgetSetPushButton _this, XObject sender );
271 
272 /* 'C' function for method : 'WidgetSet::PushButton.OnSetLabel()' */
273 void WidgetSetPushButton_OnSetLabel( WidgetSetPushButton _this, XString value );
274 
275 /* 'C' function for method : 'WidgetSet::PushButton.OnSetAppearance()' */
276 void WidgetSetPushButton_OnSetAppearance( WidgetSetPushButton _this, WidgetSetPushButtonConfig
277  value );
278 
279 #ifdef __cplusplus
280  }
281 #endif
282 
283 #endif /* _WidgetSetPushButton_H */
284 
285 /* Embedded Wizard */
WidgetSetPushButton_onLeaveTouch
void WidgetSetPushButton_onLeaveTouch(WidgetSetPushButton _this, XObject sender)
Definition: WidgetSet.c:5322
ewrte.h
WidgetSetPushButton_onConfigChanged
void WidgetSetPushButton_onConfigChanged(WidgetSetPushButton _this, XObject sender)
Definition: WidgetSet.c:5237
_CoreTimer.h
value
XRect CoreOutline aOutline XRect value
Definition: _WidgetSetPushButton.h:230
_CoreGroup.h
EW_END_OF_FIELDS
#define EW_END_OF_FIELDS(aClass)
Definition: ewrte.h:460
EW_DECLARE_CLASS
#define EW_DECLARE_CLASS(aClass)
Definition: ewrte.h:393
EW_METHOD
EW_METHOD(initLayoutContext, void)(CoreRectView _this
WidgetSetPushButton_OnSetLabel
void WidgetSetPushButton_OnSetLabel(WidgetSetPushButton _this, XString value)
Definition: WidgetSet.c:5390
XSlot
Definition: ewrte.h:2114
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
ewgfx.h
WidgetSetPushButton_onReleaseTouch
void WidgetSetPushButton_onReleaseTouch(WidgetSetPushButton _this, XObject sender)
Definition: WidgetSet.c:5342
_obj_XObject
Definition: ewrte.h:281
aOutline
XRect CoreOutline aOutline XRect CoreOutline aOutline
Definition: _CoreQuadView.h:109
XInt32
signed long XInt32
Definition: ewrte.h:1586
_CoreSimpleTouchHandler.h
WidgetSetPushButton_OnSetAppearance
void WidgetSetPushButton_OnSetAppearance(WidgetSetPushButton _this, WidgetSetPushButtonConfig value)
Definition: WidgetSet.c:5400
WidgetSetPushButton_onEnterTouch
void WidgetSetPushButton_onEnterTouch(WidgetSetPushButton _this, XObject sender)
Definition: WidgetSet.c:5332
XBool
char XBool
Definition: ewrte.h:1592
XEnum
unsigned long XEnum
Definition: ewrte.h:1593
EW_DEFINE_METHODS
#define EW_DEFINE_METHODS(aClass, aSuperClass)
Definition: ewrte.h:524
XRect
Definition: ewrte.h:1639
EffectsFader
EffectsFader(EffectsShowHideTransition _this) EW_METHOD(CreateRestoreFader
XSet
unsigned long XSet
Definition: ewrte.h:1594
aOpacity
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 aOpacity
Definition: _CoreOutline.h:172
WidgetSetPushButton_OnSetBounds
void WidgetSetPushButton_OnSetBounds(WidgetSetPushButton _this, XRect value)
Definition: WidgetSet.c:4900
_CoreKeyPressHandler.h
aClip
XRect CoreOutline aOutline GraphicsCanvas XRect aClip
Definition: _CoreOutline.h:171
sender
XRect CoreOutline aOutline XObject sender
Definition: _ApplicationRadioInterface.h:186
XPoint
Definition: ewrte.h:1616
aBounds
XRect aBounds
Definition: _WidgetSetPushButton.h:200
EW_PROPERTY
#define EW_PROPERTY(aName, aType)
Definition: ewrte.h:466
aOffset
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint aOffset
Definition: _CoreOutline.h:172
WidgetSetPushButton_onFlashTimer
void WidgetSetPushButton_onFlashTimer(WidgetSetPushButton _this, XObject sender)
Definition: WidgetSet.c:5264
EW_OBJECT
#define EW_OBJECT(aName, aObjectClass)
Definition: ewrte.h:468
XUInt32
unsigned long XUInt32
Definition: ewrte.h:1590
WidgetSetPushButton_onPressKey
void WidgetSetPushButton_onPressKey(WidgetSetPushButton _this, XObject sender)
Definition: WidgetSet.c:5302
aCanvas
XRect CoreOutline aOutline GraphicsCanvas aCanvas
Definition: _CoreOutline.h:171
XString
XChar * XString
Definition: ewrte.h:1656
WidgetSetPushButton_onReleaseKey
void WidgetSetPushButton_onReleaseKey(WidgetSetPushButton _this, XObject sender)
Definition: WidgetSet.c:5274
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
WidgetSetPushButton_onPressTouch
void WidgetSetPushButton_onPressTouch(WidgetSetPushButton _this, XObject sender)
Definition: WidgetSet.c:5373
WidgetSetPushButton_UpdateViewState
void WidgetSetPushButton_UpdateViewState(WidgetSetPushButton _this, XSet aState)
Definition: WidgetSet.c:4976
aBlend
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 XBool aBlend
Definition: _CoreOutline.h:172
CoreCursorHit
XRect CoreOutline aOutline CoreCursorHit(CoreGroup _this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason) EW_METHOD(ArrangeView
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451