Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIAnimatedImage.h
1/*
2* Copyright (C) TES Electronic Solutions GmbH,
3* All Rights Reserved.
4* Contact: info@guiliani.de
5*
6* This file is part of the Guiliani HMI framework
7* for the development of graphical user interfaces on embedded systems.
8*/
9
10#ifndef GUIANIMATEDIMAGE__H_
11#define GUIANIMATEDIMAGE__H_
12
13// necessary includes
14#include "GUIImage.h"
15#include "GUIImageResource.h"
16
18// @guiliani_doxygen toplevel_control Animated Image
29// @endguiliani_doxygen
59{
60public:
75 CGUICompositeObject* const pkParent,
76 const eC_Value& vX,
77 const eC_Value& vY,
78 const eC_Value& vWidth,
79 const eC_Value& vHeight,
80 const eC_Bool& bStretchBlit = true,
81 const eC_UInt uiMs = 100,
82 const ObjectHandle_t& eID = NO_HANDLE);
83
95 CGUICompositeObject* const pkParent,
96 const CGUIRect& kRect,
97 const eC_Bool& bStretchBlit = true,
98 const eC_UInt uiMs = 100,
99 const ObjectHandle_t& eID = NO_HANDLE);
100
102
103 virtual ~CGUIAnimatedImage();
104
110 virtual eC_Bool SetValue(const CGUIValue& rkValue)
111 {
112 // Show image at index given by value
113 SetAnimationIndex(rkValue.ToInt());
114 CGUIObject::SetValue(rkValue);
115 return true;
116 }
117
118 virtual eC_Bool DoDraw();
119
122
125
129 virtual void DoAnimate(const eC_Value& vTimes = eC_FromInt(1));
130
137 void SetImages(eC_TArray<ImageResource_t> &aImages);
138
142 void SetAutoStart(const eC_Bool& bAutoStart);
143
147 eC_Bool GetAutoStart() const;
148
154 void SetRepeat(const eC_Bool& bRepeat);
155
159 eC_Bool GetRepeat() const;
160
164 void SetFrameDelay(const eC_UInt& uiMs);
165
170 eC_UInt GetFrameDelay() const;
171
177 void SetAnimationIndex(const eC_UInt& uiIndex);
178
183 ImageResource_t GetImage(const eC_UInt& uiIndex) const;
184
188 eC_UInt GetIndexOfVisibleImage() const;
189
193 eC_UInt GetNumberOfImages() const;
194
198 void SetToggle(const eC_Bool& bToggle);
199
203 eC_Bool GetToggle() const;
204
205#ifdef GUILIANI_STREAM_GUI
206 virtual void ReadFromStream();
207#endif
208#ifdef GUILIANI_WRITE_GUI
209 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
210#endif
211
212protected:
214 eC_TArray<ImageResource_t> m_aImageIDs;
215
217 eC_Bool m_bRepeat;
218
221
224
227
229 eC_Bool m_bToggle;
230
232 eC_Bool m_bForward;
233
234private:
236 void Init();
237
239 void DeInit();
240};
241
242#endif
Helper Macros in Guiliani
ImageResource_t
Enumeration of image resource ids.
Definition: GUIImageResource.h:126
ObjectHandle_t
List of object resource ids.
Definition: GUIObjectHandleResource.h:55
Displays an animated image in the GUI.
Definition: GUIAnimatedImage.h:59
eC_UInt GetIndexOfVisibleImage() const
void SetFrameDelay(const eC_UInt &uiMs)
eC_Bool m_bToggle
toggle direction when reaching end of list in loop-mode
Definition: GUIAnimatedImage.h:229
void SetRepeat(const eC_Bool &bRepeat)
eC_TArray< ImageResource_t > m_aImageIDs
Array of image ids within animation.
Definition: GUIAnimatedImage.h:214
virtual eC_Bool DoDraw()
virtual eC_Bool SetValue(const CGUIValue &rkValue)
Definition: GUIAnimatedImage.h:110
void SetAnimationIndex(const eC_UInt &uiIndex)
eC_UInt m_uiVisibleImageIndex
Index of currently displayed image in array of images.
Definition: GUIAnimatedImage.h:226
eC_Bool GetAutoStart() const
virtual void DoAnimate(const eC_Value &vTimes=eC_FromInt(1))
eC_Bool GetRepeat() const
eC_Bool m_bRepeat
boolean value indicating whether this object is currently animating
Definition: GUIAnimatedImage.h:217
void SetToggle(const eC_Bool &bToggle)
CGUIAnimatedImage(CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const eC_Bool &bStretchBlit=true, const eC_UInt uiMs=100, const ObjectHandle_t &eID=NO_HANDLE)
eC_Bool m_bForward
indicate if animation is running forward
Definition: GUIAnimatedImage.h:232
void SetAutoStart(const eC_Bool &bAutoStart)
ImageResource_t GetImage(const eC_UInt &uiIndex) const
eC_Bool m_bAutoStart
boolean value for automatically starting the animation
Definition: GUIAnimatedImage.h:220
void StopAnimation()
Immediately stops the animation.
eC_Bool GetToggle() const
CGUIAnimatedImage(CGUICompositeObject *const pkParent, const CGUIRect &kRect, const eC_Bool &bStretchBlit=true, const eC_UInt uiMs=100, const ObjectHandle_t &eID=NO_HANDLE)
void StartAnimation()
Starts the animation.
eC_UInt m_uiFrameDelay
Time in milliseconds how long a single image of the animation will be displayed.
Definition: GUIAnimatedImage.h:223
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
void SetImages(eC_TArray< ImageResource_t > &aImages)
eC_UInt GetNumberOfImages() const
eC_UInt GetFrameDelay() const
virtual void ReadFromStream()
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
Displays a static image in the GUI.
Definition: GUIImage.h:59
virtual eC_Bool SetValue(const CGUIValue &rkValue)
Definition: GUIObject.h:1067
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
CGUIValue stores a single value in one specific type.
Definition: GUIValue.h:25
eC_Int ToInt() const