WebRadioApp  0.1
_WidgetSetVerticalSlider.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 _WidgetSetVerticalSlider_H
28 #define _WidgetSetVerticalSlider_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 Views::Frame */
87 #ifndef _ViewsFrame_
88  EW_DECLARE_CLASS( ViewsFrame )
89 #define _ViewsFrame_
90 #endif
91 
92 /* Forward declaration of the class Views::Image */
93 #ifndef _ViewsImage_
94  EW_DECLARE_CLASS( ViewsImage )
95 #define _ViewsImage_
96 #endif
97 
98 /* Forward declaration of the class WidgetSet::VerticalSlider */
99 #ifndef _WidgetSetVerticalSlider_
100  EW_DECLARE_CLASS( WidgetSetVerticalSlider )
101 #define _WidgetSetVerticalSlider_
102 #endif
103 
104 /* Forward declaration of the class WidgetSet::VerticalSliderConfig */
105 #ifndef _WidgetSetVerticalSliderConfig_
106  EW_DECLARE_CLASS( WidgetSetVerticalSliderConfig )
107 #define _WidgetSetVerticalSliderConfig_
108 #endif
109 
110 
111 /* This class implements a 'vertical slider' widget. When the user touches the slider's
112  thumb and drags it vertically, the slider's current value represented by the
113  int32 property @CurrentValue is changed and signal is sent to the slot method
114  stored in the property @OnChange. The valid range for @CurrentValue is determined
115  by the properties @MinValue and @MaxValue. By connecting further slot methods
116  to the properties @OnStart and @OnEnd you can react to other events triggered
117  while the user starts and ends the interaction with the slider.
118  Alternatively the property @Outlet can refer to any other 'int32' property the
119  slider widget should remain synchronized with. When the user drags the slider's
120  thumb, the affected property is automatically updated to reflect the slider's
121  current value. On the other hand, when the referred property is modified by another
122  one, the slider is automatically notified to remain in sync with the property.
123  This approach follows the Controller-View programming paradigm. Here the slider
124  represents the 'View' and the property referred via 'Outlet' can be seen as a
125  part of the 'Controller'.
126  During its lifetime the slider remains always in one of the four states: 'disabled',
127  'default', 'focused' and 'active'. The state 'disabled' is true for every not
128  available slider (the property @Enabled of the slider is 'false'). Such sliders
129  will ignore all user inputs. The state 'default' determines a slider, which is
130  ready to be touched by the user or ready to become focused. As soon as the slider
131  becomes focused, it switches in the state 'focused'. In this state the user can
132  control the slider by pressing keys on the keyboard. Finally, the state 'active'
133  is true, if the user actually interacts with the slider (the slider's thumb is
134  pressed).
135  The exact look and feel of the slider is determined by the 'Vertical Slider Configuration'
136  object assigned to the property @Appearance. The configuration object provides
137  bitmaps, colors and other configuration parameters needed to construct and display
138  the slider. Usually, you will manage in your project your own configuration objects
139  and customize the sliders according to your design expectations. Depending on
140  the information provided in the associated configuration object, the slider will
141  be composed of following views:
142  - 'Face' is a bitmap frame view (Views::Frame) filling horizontally centered
143  the entire height in the background of the slider. In the configuration object
144  you can individually specify for every slider state the desired bitmap, its opacity,
145  frame number (if the bitmap is multi-frame) and tint color (if the bitmap contains
146  Alpha8 information only). The slider can automatically play animated bitmaps.
147  - 'TrackBelow' is a bitmap frame view (Views::Frame) filling horizontally centered
148  the background of the slider between its bottom edge and the actual position
149  of the thumb. In the configuration object you can individually specify for every
150  slider state the desired bitmap, its opacity, frame number (if the bitmap is
151  multi-frame) and tint color (if the bitmap contains Alpha8 information only).
152  The slider can automatically play animated bitmaps.
153  - 'TrackAbove' is a bitmap frame view (Views::Frame) filling horizontally centered
154  the background of the slider between the actual position of the thumb and the
155  top edge of the slider widget. In the configuration object you can individually
156  specify for every slider state the desired bitmap, its opacity, frame number
157  (if the bitmap is multi-frame) and tint color (if the bitmap contains Alpha8
158  information only). The slider can automatically play animated bitmaps.
159  - 'Thumb' is an image view (Views::Image) displayed horizontally centered at
160  the thumb position according to current value of the slider (@CurrentValue).
161  In the configuration object you can individually specify for every slider state
162  the desired bitmap, its opacity, frame number (if the bitmap is multi-frame)
163  and tint color (if the bitmap contains Alpha8 information only). The slider can
164  automatically play animated bitmaps. If necessary, additional margins above and
165  below the thumb can be specified.
166  - 'Cover' is a bitmap frame view (Views::Frame) filling horizontally centered
167  the entire height of the slider and covering so eventually the thumb and track.
168  In the configuration object you can individually specify for every slider state
169  the desired bitmap, its opacity, frame number (if the bitmap is multi-frame)
170  and tint color (if the bitmap contains Alpha8 information only). The slider can
171  automatically play animated bitmaps.
172  In particular application cases you can instruct the slider to automatically
173  resign and retarget the actual touch interaction to another touch handler (e.g.
174  another widget) after the user has performed a horizontal wipe gesture (@ResignAfterHorizontalWipe).
175  Using this property several widgets can cooperate during an active user interaction
176  even if these handler overlap each other.
177  If the slider is actually focused, it can also be controlled by pressing the
178  keyboard keys Core::KeyCode.Down and Core::KeyCode.Up causing the slider's thumb
179  to be moved down or up. In the configuration object you can specify another key
180  codes, if desired. To prevent the slider from being able to be focused, specify
181  in the configuration object the Core::KeyCode.NoKey as codes to control the slider.
182  With the property @StepSize you can specify a raster in which the slider changes
183  the value when user interacts with it.
184  If there is no thumb bitmap provided for the slider, the entire slider area is
185  touchable permitting the user so to interact with and control the slider.
186  The slider widget provides an additional set of methods useful to query the actual
187  position of the thumb and its possible movement range (@GetThumbMaxPosition(),
188  @GetThumbMinPosition(), @GetThumbPosition()). These methods can be invoked from
189  a slot method assigned to the property @OnUpdate. In this manner you can automatically
190  arrange and updated additional decoration according to the actual state of the
191  slider widget. For example, you can arrange a Views::Text view to follow the
192  thumb and to display the actual value of the slider (@CurrentValue).
193  For more details regarding the customization of the slider see the description
194  of WidgetSet::VerticalSliderConfig class. */
195 EW_DEFINE_FIELDS( WidgetSetVerticalSlider, CoreGroup )
196  EW_VARIABLE( frameView4, ViewsFrame )
197  EW_VARIABLE( imageView, ViewsImage )
198  EW_VARIABLE( frameView3, ViewsFrame )
199  EW_VARIABLE( frameView2, ViewsFrame )
200  EW_VARIABLE( frameView1, ViewsFrame )
201  EW_PROPERTY( Appearance, WidgetSetVerticalSliderConfig )
202  EW_PROPERTY( OnUpdate, XSlot )
203  EW_PROPERTY( OnChange, XSlot )
204  EW_PROPERTY( OnEnd, XSlot )
205  EW_PROPERTY( OnStart, XSlot )
206  EW_PROPERTY( Outlet, XRef )
207  EW_OBJECT ( RepetitionTimer, CoreTimer )
208  EW_OBJECT ( KeyHandlerDown, CoreKeyPressHandler )
209  EW_OBJECT ( KeyHandlerUp, CoreKeyPressHandler )
210  EW_OBJECT ( TouchHandler, CoreSimpleTouchHandler )
211  EW_VARIABLE( touchStartValue, XInt32 )
212  EW_PROPERTY( StepSize, XInt32 )
213  EW_PROPERTY( MaxValue, XInt32 )
214  EW_PROPERTY( MinValue, XInt32 )
215  EW_PROPERTY( CurrentValue, XInt32 )
216  EW_VARIABLE( touchActive, XBool )
217 EW_END_OF_FIELDS( WidgetSetVerticalSlider )
218 
219 /* Virtual Method Table (VMT) for the class : 'WidgetSet::VerticalSlider' */
220 EW_DEFINE_METHODS( WidgetSetVerticalSlider, CoreGroup )
221  EW_METHOD( initLayoutContext, void )( CoreRectView _this, XRect aBounds, CoreOutline
222  aOutline )
223  EW_METHOD( GetRoot, CoreRoot )( CoreView _this )
224  EW_METHOD( Draw, void )( CoreGroup _this, GraphicsCanvas aCanvas,
226  EW_METHOD( HandleEvent, XObject )( CoreView _this, CoreEvent aEvent )
227  EW_METHOD( CursorHitTest, CoreCursorHit )( CoreGroup _this, XRect aArea, XInt32
228  aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason )
229  EW_METHOD( ArrangeView, XPoint )( CoreRectView _this, XRect aBounds, XEnum
230  aFormation )
231  EW_METHOD( MoveView, void )( CoreRectView _this, XPoint aOffset, XBool
232  aFastMove )
233  EW_METHOD( GetExtent, XRect )( CoreRectView _this )
234  EW_METHOD( ChangeViewState, void )( CoreGroup _this, XSet aSetState, XSet aClearState )
235  EW_METHOD( OnSetBounds, void )( WidgetSetVerticalSlider _this, XRect value )
236  EW_METHOD( drawContent, void )( CoreGroup _this, GraphicsCanvas aCanvas,
238  EW_METHOD( OnSetFocus, void )( CoreGroup _this, CoreView value )
239  EW_METHOD( OnSetBuffered, void )( CoreGroup _this, XBool value )
240  EW_METHOD( OnSetOpacity, void )( CoreGroup _this, XInt32 value )
241  EW_METHOD( IsDialog, XBool )( CoreGroup _this, XBool aRecursive )
242  EW_METHOD( DispatchEvent, XObject )( CoreGroup _this, CoreEvent aEvent )
243  EW_METHOD( BroadcastEvent, XObject )( CoreGroup _this, CoreEvent aEvent, XSet
244  aFilter )
245  EW_METHOD( UpdateLayout, void )( CoreGroup _this, XPoint aSize )
246  EW_METHOD( UpdateViewState, void )( WidgetSetVerticalSlider _this, XSet aState )
247  EW_METHOD( InvalidateArea, void )( CoreGroup _this, XRect aArea )
248 EW_END_OF_METHODS( WidgetSetVerticalSlider )
249 
250 /* 'C' function for method : 'WidgetSet::VerticalSlider.OnSetBounds()' */
251 void WidgetSetVerticalSlider_OnSetBounds( WidgetSetVerticalSlider _this, XRect value );
252 
253 /* The method UpdateViewState() is invoked automatically after the state of the
254  component has been changed. This method can be overridden and filled with logic
255  to ensure the visual aspect of the component does reflect its current state.
256  For example, the 'enabled' state of the component can affect its colors (disabled
257  components may appear pale). In this case the logic of the method should modify
258  the respective color properties accordingly to the current 'enabled' state.
259  The current state of the component is passed as a set in the parameter aState.
260  It reflects the very basic component state like its visibility or the ability
261  to react to user inputs. Beside this common state, the method can also involve
262  any other variables used in the component as long as they reflect its current
263  state. For example, the toggle switch component can take in account its toggle
264  state 'on' or 'off' and change accordingly the location of the slider, etc.
265  Usually, this method will be invoked automatically by the framework. Optionally
266  you can request its invocation by using the method @InvalidateViewState(). */
267 void WidgetSetVerticalSlider_UpdateViewState( WidgetSetVerticalSlider _this, XSet
268  aState );
269 
270 /* 'C' function for method : 'WidgetSet::VerticalSlider.onConfigChanged()' */
271 void WidgetSetVerticalSlider_onConfigChanged( WidgetSetVerticalSlider _this, XObject
272  sender );
273 
274 /* 'C' function for method : 'WidgetSet::VerticalSlider.onRepetitionTimer()' */
275 void WidgetSetVerticalSlider_onRepetitionTimer( WidgetSetVerticalSlider _this, XObject
276  sender );
277 
278 /* 'C' function for method : 'WidgetSet::VerticalSlider.onReleaseKey()' */
279 void WidgetSetVerticalSlider_onReleaseKey( WidgetSetVerticalSlider _this, XObject
280  sender );
281 
282 /* 'C' function for method : 'WidgetSet::VerticalSlider.onPressKey()' */
283 void WidgetSetVerticalSlider_onPressKey( WidgetSetVerticalSlider _this, XObject
284  sender );
285 
286 /* 'C' function for method : 'WidgetSet::VerticalSlider.onDragTouch()' */
287 void WidgetSetVerticalSlider_onDragTouch( WidgetSetVerticalSlider _this, XObject
288  sender );
289 
290 /* 'C' function for method : 'WidgetSet::VerticalSlider.onReleaseTouch()' */
291 void WidgetSetVerticalSlider_onReleaseTouch( WidgetSetVerticalSlider _this, XObject
292  sender );
293 
294 /* 'C' function for method : 'WidgetSet::VerticalSlider.onPressTouch()' */
295 void WidgetSetVerticalSlider_onPressTouch( WidgetSetVerticalSlider _this, XObject
296  sender );
297 
298 /* 'C' function for method : 'WidgetSet::VerticalSlider.OnGetCurrentValue()' */
299 XInt32 WidgetSetVerticalSlider_OnGetCurrentValue( WidgetSetVerticalSlider _this );
300 
301 /* 'C' function for method : 'WidgetSet::VerticalSlider.OnSetCurrentValue()' */
302 void WidgetSetVerticalSlider_OnSetCurrentValue( WidgetSetVerticalSlider _this, XInt32
303  value );
304 
305 /* 'C' function for method : 'WidgetSet::VerticalSlider.OnSetAppearance()' */
306 void WidgetSetVerticalSlider_OnSetAppearance( WidgetSetVerticalSlider _this, WidgetSetVerticalSliderConfig
307  value );
308 
309 #ifdef __cplusplus
310  }
311 #endif
312 
313 #endif /* _WidgetSetVerticalSlider_H */
314 
315 /* Embedded Wizard */
WidgetSetVerticalSlider_onDragTouch
void WidgetSetVerticalSlider_onDragTouch(WidgetSetVerticalSlider _this, XObject sender)
Definition: WidgetSet.c:3771
XRef
Definition: ewrte.h:2075
EW_METHOD
EW_METHOD(initLayoutContext, void)(CoreRectView _this
ewrte.h
_CoreTimer.h
_CoreGroup.h
EW_END_OF_FIELDS
#define EW_END_OF_FIELDS(aClass)
Definition: ewrte.h:460
aBounds
XRect aBounds
Definition: _WidgetSetVerticalSlider.h:221
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
WidgetSetVerticalSlider_OnSetBounds
void WidgetSetVerticalSlider_OnSetBounds(WidgetSetVerticalSlider _this, XRect value)
Definition: WidgetSet.c:3089
_obj_XObject
Definition: ewrte.h:281
aOutline
XRect CoreOutline aOutline XRect CoreOutline aOutline
Definition: _CoreQuadView.h:109
WidgetSetVerticalSlider_OnSetAppearance
void WidgetSetVerticalSlider_OnSetAppearance(WidgetSetVerticalSlider _this, WidgetSetVerticalSliderConfig value)
Definition: WidgetSet.c:3965
XInt32
signed long XInt32
Definition: ewrte.h:1586
_CoreSimpleTouchHandler.h
WidgetSetVerticalSlider_onReleaseTouch
void WidgetSetVerticalSlider_onReleaseTouch(WidgetSetVerticalSlider _this, XObject sender)
Definition: WidgetSet.c:3825
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
WidgetSetVerticalSlider_UpdateViewState
void WidgetSetVerticalSlider_UpdateViewState(WidgetSetVerticalSlider _this, XSet aState)
Definition: WidgetSet.c:3168
WidgetSetVerticalSlider_onRepetitionTimer
void WidgetSetVerticalSlider_onRepetitionTimer(WidgetSetVerticalSlider _this, XObject sender)
Definition: WidgetSet.c:3651
value
XRect CoreOutline aOutline XRect value
Definition: _WidgetSetVerticalSlider.h:251
_CoreKeyPressHandler.h
aClip
XRect CoreOutline aOutline GraphicsCanvas XRect aClip
Definition: _CoreOutline.h:171
WidgetSetVerticalSlider_onReleaseKey
void WidgetSetVerticalSlider_onReleaseKey(WidgetSetVerticalSlider _this, XObject sender)
Definition: WidgetSet.c:3704
sender
XRect CoreOutline aOutline XObject sender
Definition: _ApplicationRadioInterface.h:186
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
WidgetSetVerticalSlider_OnSetCurrentValue
void WidgetSetVerticalSlider_OnSetCurrentValue(WidgetSetVerticalSlider _this, XInt32 value)
Definition: WidgetSet.c:3953
EW_OBJECT
#define EW_OBJECT(aName, aObjectClass)
Definition: ewrte.h:468
aCanvas
XRect CoreOutline aOutline GraphicsCanvas aCanvas
Definition: _CoreOutline.h:171
EW_END_OF_METHODS
#define EW_END_OF_METHODS(aClass)
Definition: ewrte.h:539
WidgetSetVerticalSlider_OnGetCurrentValue
XInt32 WidgetSetVerticalSlider_OnGetCurrentValue(WidgetSetVerticalSlider _this)
Definition: WidgetSet.c:3928
CoreCursorHit
XRect CoreOutline aOutline CoreCursorHit(CoreGroup _this, XRect aArea, XInt32 aFinger, XInt32 aStrikeCount, CoreView aDedicatedView, XSet aRetargetReason) EW_METHOD(ArrangeView
WidgetSetVerticalSlider_onPressTouch
void WidgetSetVerticalSlider_onPressTouch(WidgetSetVerticalSlider _this, XObject sender)
Definition: WidgetSet.c:3842
WidgetSetVerticalSlider_onPressKey
void WidgetSetVerticalSlider_onPressKey(WidgetSetVerticalSlider _this, XObject sender)
Definition: WidgetSet.c:3717
aBlend
XRect CoreOutline aOutline GraphicsCanvas XRect XPoint XInt32 XBool aBlend
Definition: _CoreOutline.h:172
WidgetSetVerticalSlider_onConfigChanged
void WidgetSetVerticalSlider_onConfigChanged(WidgetSetVerticalSlider _this, XObject sender)
Definition: WidgetSet.c:3599
EW_DEFINE_FIELDS
#define EW_DEFINE_FIELDS(aClass, aSuperClass)
Definition: ewrte.h:451