WebRadioApp  0.1
_WidgetSetRadioButton.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 _WidgetSetRadioButton_H
28 #define _WidgetSetRadioButton_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::RadioButton */
111 #ifndef _WidgetSetRadioButton_
112  EW_DECLARE_CLASS( WidgetSetRadioButton )
113 #define _WidgetSetRadioButton_
114 #endif
115 
116 /* Forward declaration of the class WidgetSet::RadioButtonConfig */
117 #ifndef _WidgetSetRadioButtonConfig_
118  EW_DECLARE_CLASS( WidgetSetRadioButtonConfig )
119 #define _WidgetSetRadioButtonConfig_
120 #endif
121 
122 
123 /* This class implements a bistable 'radio button' widget. When the user taps the
124  button, the current state of the button represented by the boolean property @Selected
125  is set and signal is sent to the slot method stored in the property @OnSelect.
126  Once selected, the radio button remains in this state until the property @Selected
127  is set to the value 'false' (e.g. in reaction to another radio button selection).
128  By connecting further slot methods to the properties @OnPress, @OnRelease, @OnEnter
129  and @OnLeave you can react to other events triggered while the user interacts
130  with the button.
131  Alternatively the property @Outlet can refer to any other 'int32' property the
132  widget should remain synchronized with. When the user selects the radio button,
133  the affected property is automatically set to the value @OutletSelector. On the
134  other hand, when the referred property is modified by another one, the radio
135  button is automatically notified to remain in sync with the property.
136  This approach follows the Controller-View programming paradigm. Here the radio
137  button represents the 'View' and the property referred via 'Outlet' can be seen
138  as a part of the 'Controller'.
139  During its lifetime the button remains always in one of the four states: 'disabled',
140  'default', 'focused' and 'active'. The state 'disabled' is true for every not
141  available button (the property @Enabled of the button is 'false'). Such buttons
142  will ignore all user inputs. The state 'default' determines a button, which is
143  ready to be touched by the user or ready to become focused. As soon as the button
144  becomes focused, it switches in the state 'focused'. In this state the user can
145  activate the button by pressing a key on the keyboard. Finally, the state 'active'
146  is true, if the user actually interacts with the button (the button is pressed).
147  The exact look and feel of the radio button is determined by the 'Radio Button
148  Configuration' object assigned to the property @Appearance. The configuration
149  object provides bitmaps, colors, fonts and other configuration parameters needed
150  to construct and display the radio button. Usually, you will manage in your project
151  your own configuration objects and customize the radio buttons according to your
152  design expectations. Depending on the information provided in the associated
153  configuration object, the radio button will be composed of following views:
154  - 'Face' is a bitmap frame view (Views::Frame) filling per default the entire
155  background of the button. In the configuration object you can individually specify
156  for every button state the desired bitmap, its opacity, frame number (if the
157  bitmap is multi-frame) and tint color (if the bitmap contains Alpha8 information
158  only). The button can automatically play animated bitmaps. If desired, you can
159  also configure the bitmap to be arranged horizontally and vertically instead
160  of filling the entire widget area.
161  - 'Icon' is an image view (Views::Image) displayed per default in the center
162  of the button. The corresponding bitmap is determined in the property @Icon.
163  If the bitmap is multi-frame, the desired frame number can be selected by using
164  the property @IconFrame or individually for every button state by using the properties
165  @IconOffFrame, @IconOnFrame, @IconOffFrameActive, @IconOffFrameDefault, @IconOffFrameDisabled,
166  @IconOffFrameFocused, @IconOnFrameActive, @IconOnFrameDefault, @IconOnFrameDisabled
167  and @IconOnFrameFocused In the configuration object you can specify the alignment
168  and margins how to arrange the @Icon bitmap within the button area. Furthermore,
169  for every button state the opacity and tint color (if the @Icon bitmap contains
170  Alpha8 information only) can be determined. The button can automatically play
171  animated bitmaps.
172  - 'Label' is a text view (Views::Text) displayed per default in the center of
173  the button. The corresponding text is determined in the property @Label or @LabelOff
174  and @LabelOn depending on the current state of the button (property @Selected).
175  In the configuration object you can specify the font, alignment and margins to
176  use for the text view. For every button state you can specify individual text
177  color values.
178  In particular application cases you can instruct the button to automatically
179  resign and retarget the actual touch interaction to another touch handler (e.g.
180  another widget) after the user has performed a horizontal wipe gesture (@ResignAfterHorizontalWipe)
181  or vertical wipe gesture (@ResignAfterVerticalWipe). Using these properties several
182  widgets can cooperate during an active user interaction even if these handler
183  overlap each other.
184  If the button is actually focused, it can also be activated by pressing the keyboard
185  key Core::KeyCode.Enter. In the configuration object you can specify another
186  key code, if desired. To prevent the button from being able to be focused, specify
187  in the configuration object the Core::KeyCode.NoKey as the code to activate the
188  button.
189  For more details regarding the customization of the button see the description
190  of WidgetSet::RadioButtonConfig class. */
191 EW_DEFINE_FIELDS( WidgetSetRadioButton, CoreGroup )
192  EW_VARIABLE( textView, ViewsText )
193  EW_VARIABLE( imageView, ViewsImage )
194  EW_VARIABLE( frameView, ViewsFrame )
195  EW_PROPERTY( Icon, ResourcesBitmap )
196  EW_PROPERTY( Appearance, WidgetSetRadioButtonConfig )
197  EW_PROPERTY( OnLeave, XSlot )
198  EW_PROPERTY( OnEnter, XSlot )
199  EW_PROPERTY( OnRelease, XSlot )
200  EW_PROPERTY( OnPress, XSlot )
201  EW_PROPERTY( OnSelect, XSlot )
202  EW_PROPERTY( Outlet, XRef )
203  EW_OBJECT ( FlashTimer, CoreTimer )
204  EW_OBJECT ( KeyHandler, CoreKeyPressHandler )
205  EW_OBJECT ( TouchHandler, CoreSimpleTouchHandler )
206  EW_PROPERTY( LabelOn, XString )
207  EW_PROPERTY( LabelOff, XString )
208  EW_VARIABLE( onPressKeyTime, XUInt32 )
209  EW_PROPERTY( OutletSelector, XInt32 )
210  EW_PROPERTY( IconOnFrameActive, XInt32 )
211  EW_PROPERTY( IconOnFrameFocused, XInt32 )
212  EW_PROPERTY( IconOnFrameDisabled, XInt32 )
213  EW_PROPERTY( IconOnFrameDefault, XInt32 )
214  EW_PROPERTY( IconOffFrameActive, XInt32 )
215  EW_PROPERTY( IconOffFrameFocused, XInt32 )
216  EW_PROPERTY( IconOffFrameDisabled, XInt32 )
217  EW_PROPERTY( IconOffFrameDefault, XInt32 )
218  EW_PROPERTY( Selected, XBool )
219 EW_END_OF_FIELDS( WidgetSetRadioButton )
220 
221 /* Virtual Method Table (VMT) for the class : 'WidgetSet::RadioButton' */
222 EW_DEFINE_METHODS( WidgetSetRadioButton, CoreGroup )
223  EW_METHOD( initLayoutContext, void )( CoreRectView _this, XRect aBounds, CoreOutline
224  aOutline )
225  EW_METHOD( GetRoot, CoreRoot )( CoreView _this )
226  EW_METHOD( Draw, void )( CoreGroup _this, GraphicsCanvas aCanvas,
228  EW_METHOD( HandleEvent, XObject )( CoreView _this, CoreEvent aEvent )
229  EW_METHOD( CursorHitTest, CoreCursorHit )( CoreGroup _this, XRect aArea, XInt32
230  aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason )
231  EW_METHOD( ArrangeView, XPoint )( CoreRectView _this, XRect aBounds, XEnum
232  aFormation )
233  EW_METHOD( MoveView, void )( CoreRectView _this, XPoint aOffset, XBool
234  aFastMove )
235  EW_METHOD( GetExtent, XRect )( CoreRectView _this )
236  EW_METHOD( ChangeViewState, void )( CoreGroup _this, XSet aSetState, XSet aClearState )
237  EW_METHOD( OnSetBounds, void )( WidgetSetRadioButton _this, XRect value )
238  EW_METHOD( drawContent, void )( CoreGroup _this, GraphicsCanvas aCanvas,
240  EW_METHOD( OnSetFocus, void )( CoreGroup _this, CoreView value )
241  EW_METHOD( OnSetBuffered, void )( CoreGroup _this, XBool value )
242  EW_METHOD( OnSetOpacity, void )( CoreGroup _this, XInt32 value )
243  EW_METHOD( IsDialog, XBool )( CoreGroup _this, XBool aRecursive )
244  EW_METHOD( DispatchEvent, XObject )( CoreGroup _this, CoreEvent aEvent )
245  EW_METHOD( BroadcastEvent, XObject )( CoreGroup _this, CoreEvent aEvent, XSet
246  aFilter )
247  EW_METHOD( UpdateLayout, void )( CoreGroup _this, XPoint aSize )
248  EW_METHOD( UpdateViewState, void )( WidgetSetRadioButton _this, XSet aState )
249  EW_METHOD( InvalidateArea, void )( CoreGroup _this, XRect aArea )
250 EW_END_OF_METHODS( WidgetSetRadioButton )
251 
252 /* 'C' function for method : 'WidgetSet::RadioButton.OnSetBounds()' */
253 void WidgetSetRadioButton_OnSetBounds( WidgetSetRadioButton _this, XRect value );
254 
255 /* The method UpdateViewState() is invoked automatically after the state of the
256  component has been changed. This method can be overridden and filled with logic
257  to ensure the visual aspect of the component does reflect its current state.
258  For example, the 'enabled' state of the component can affect its colors (disabled
259  components may appear pale). In this case the logic of the method should modify
260  the respective color properties accordingly to the current 'enabled' state.
261  The current state of the component is passed as a set in the parameter aState.
262  It reflects the very basic component state like its visibility or the ability
263  to react to user inputs. Beside this common state, the method can also involve
264  any other variables used in the component as long as they reflect its current
265  state. For example, the toggle switch component can take in account its toggle
266  state 'on' or 'off' and change accordingly the location of the slider, etc.
267  Usually, this method will be invoked automatically by the framework. Optionally
268  you can request its invocation by using the method @InvalidateViewState(). */
269 void WidgetSetRadioButton_UpdateViewState( WidgetSetRadioButton _this, XSet aState );
270 
271 /* 'C' function for method : 'WidgetSet::RadioButton.onConfigChanged()' */
272 void WidgetSetRadioButton_onConfigChanged( WidgetSetRadioButton _this, XObject sender );
273 
274 /* 'C' function for method : 'WidgetSet::RadioButton.onFlashTimer()' */
275 void WidgetSetRadioButton_onFlashTimer( WidgetSetRadioButton _this, XObject sender );
276 
277 /* 'C' function for method : 'WidgetSet::RadioButton.onReleaseKey()' */
278 void WidgetSetRadioButton_onReleaseKey( WidgetSetRadioButton _this, XObject sender );
279 
280 /* 'C' function for method : 'WidgetSet::RadioButton.onPressKey()' */
281 void WidgetSetRadioButton_onPressKey( WidgetSetRadioButton _this, XObject sender );
282 
283 /* 'C' function for method : 'WidgetSet::RadioButton.onLeaveTouch()' */
284 void WidgetSetRadioButton_onLeaveTouch( WidgetSetRadioButton _this, XObject sender );
285 
286 /* 'C' function for method : 'WidgetSet::RadioButton.onEnterTouch()' */
287 void WidgetSetRadioButton_onEnterTouch( WidgetSetRadioButton _this, XObject sender );
288 
289 /* 'C' function for method : 'WidgetSet::RadioButton.onReleaseTouch()' */
290 void WidgetSetRadioButton_onReleaseTouch( WidgetSetRadioButton _this, XObject sender );
291 
292 /* 'C' function for method : 'WidgetSet::RadioButton.onPressTouch()' */
293 void WidgetSetRadioButton_onPressTouch( WidgetSetRadioButton _this, XObject sender );
294 
295 /* 'C' function for method : 'WidgetSet::RadioButton.OnSetSelected()' */
296 void WidgetSetRadioButton_OnSetSelected( WidgetSetRadioButton _this, XBool value );
297 
298 /* 'C' function for method : 'WidgetSet::RadioButton.OnSetLabel()' */
299 void WidgetSetRadioButton_OnSetLabel( WidgetSetRadioButton _this, XString value );
300 
301 /* 'C' function for method : 'WidgetSet::RadioButton.OnSetAppearance()' */
302 void WidgetSetRadioButton_OnSetAppearance( WidgetSetRadioButton _this, WidgetSetRadioButtonConfig
303  value );
304 
305 #ifdef __cplusplus
306  }
307 #endif
308 
309 #endif /* _WidgetSetRadioButton_H */
310 
311 /* Embedded Wizard */
XRef
Definition: ewrte.h:2075
CoreCursorHit
XRect CoreOutline aOutline CoreCursorHit(CoreGroup _this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason) EW_METHOD(ArrangeView
ewrte.h
value
XRect CoreOutline aOutline XRect value
Definition: _WidgetSetRadioButton.h:253
_CoreTimer.h
_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
XSlot
Definition: ewrte.h:2114
EW_VARIABLE
#define EW_VARIABLE(aName, aType)
Definition: ewrte.h:464
ewgfx.h
WidgetSetRadioButton_onPressKey
void WidgetSetRadioButton_onPressKey(WidgetSetRadioButton _this, XObject sender)
_obj_XObject
Definition: ewrte.h:281
WidgetSetRadioButton_OnSetAppearance
void WidgetSetRadioButton_OnSetAppearance(WidgetSetRadioButton _this, WidgetSetRadioButtonConfig value)
WidgetSetRadioButton_onPressTouch
void WidgetSetRadioButton_onPressTouch(WidgetSetRadioButton _this, XObject sender)
aOutline
XRect CoreOutline aOutline XRect CoreOutline aOutline
Definition: _CoreQuadView.h:109
XInt32
signed long XInt32
Definition: ewrte.h:1586
_CoreSimpleTouchHandler.h
XBool
char XBool
Definition: ewrte.h:1592
XEnum
unsigned long XEnum
Definition: ewrte.h:1593
WidgetSetRadioButton_onReleaseKey
void WidgetSetRadioButton_onReleaseKey(WidgetSetRadioButton _this, XObject sender)
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
WidgetSetRadioButton_onFlashTimer
void WidgetSetRadioButton_onFlashTimer(WidgetSetRadioButton _this, XObject sender)
WidgetSetRadioButton_onEnterTouch
void WidgetSetRadioButton_onEnterTouch(WidgetSetRadioButton _this, XObject sender)
_CoreKeyPressHandler.h
WidgetSetRadioButton_onReleaseTouch
void WidgetSetRadioButton_onReleaseTouch(WidgetSetRadioButton _this, XObject sender)
aClip
XRect CoreOutline aOutline GraphicsCanvas XRect aClip
Definition: _CoreOutline.h:171
sender
XRect CoreOutline aOutline XObject sender
Definition: _ApplicationRadioInterface.h:186
EW_METHOD
EW_METHOD(initLayoutContext, void)(CoreRectView _this
XPoint
Definition: ewrte.h:1616
EW_PROPERTY
#define EW_PROPERTY(aName, aType)
Definition: ewrte.h:466
aOffset
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint aOffset
Definition: _CoreOutline.h:172
WidgetSetRadioButton_UpdateViewState
void WidgetSetRadioButton_UpdateViewState(WidgetSetRadioButton _this, XSet aState)
EW_OBJECT
#define EW_OBJECT(aName, aObjectClass)
Definition: ewrte.h:468
XUInt32
unsigned long XUInt32
Definition: ewrte.h:1590
WidgetSetRadioButton_onConfigChanged
void WidgetSetRadioButton_onConfigChanged(WidgetSetRadioButton _this, XObject sender)
aCanvas
XRect CoreOutline aOutline GraphicsCanvas aCanvas
Definition: _CoreOutline.h:171
XString
XChar * XString
Definition: ewrte.h:1656
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
WidgetSetRadioButton_onLeaveTouch
void WidgetSetRadioButton_onLeaveTouch(WidgetSetRadioButton _this, XObject sender)
WidgetSetRadioButton_OnSetLabel
void WidgetSetRadioButton_OnSetLabel(WidgetSetRadioButton _this, XString value)
WidgetSetRadioButton_OnSetSelected
void WidgetSetRadioButton_OnSetSelected(WidgetSetRadioButton _this, XBool value)
aBounds
XRect aBounds
Definition: _WidgetSetRadioButton.h:223
aBlend
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 XBool aBlend
Definition: _CoreOutline.h:172
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451