Guiliani  Version 2.5 revision 6773 (build 33)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIImageStack.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 #if !defined(GUI_IMAGE_STACK_H)
11 #define GUI_IMAGE_STACK_H
12 
13 #include "GUIAnimatedImage.h"
14 
15 // @guiliani_doxygen toplevel_control Image Stack
26 // @endguiliani_doxygen
82 class CGUIImageStack : public CGUIImage
83 {
84 public:
95  CGUICompositeObject* const pkParent,
96  const eC_Value& vX, const eC_Value& vY,
97  const eC_Value& vWidth, const eC_Value& vHeight,
98  const eC_UInt& uiFrameDelay,
99  const ObjectHandle_t &eID = NO_HANDLE);
100 
108  CGUICompositeObject* const pkParent,
109  const CGUIRect& kRect,
110  const eC_UInt& uiFrameDelay,
111  const ObjectHandle_t &eID = NO_HANDLE);
112 
114  CGUIImageStack();
115 
117  virtual ~CGUIImageStack();
118 
122  void ShowNext();
123 
127  void ShowPrevious();
128 
134  virtual eC_Bool SetValue(const CGUIValue& rkValue)
135  {
136  // Show image at index given by value
137  SetAnimationIndex(rkValue.ToInt());
138  CGUIObject::SetValue(rkValue);
139  return true;
140  }
141 
142  virtual eC_Bool DoDraw();
143 
145  void StopAnimation();
146 
148  void StartAnimation();
149 
153  virtual void DoAnimate(const eC_Value& vTimes = eC_FromInt(1));
154 
161  void SetImages(eC_TArray<ImageResource_t> &aImages);
162 
166  void SetFrameDelay(const eC_UInt& uiMs);
167 
172  eC_UInt GetFrameDelay() const;
173 
179  void SetAnimationIndex(const eC_UInt& uiIndex);
180 
185  ImageResource_t GetImage(const eC_UInt& uiIndex) const;
186 
190  eC_UInt GetIndexOfVisibleImage() const;
191 
195  eC_UInt GetNumberOfImages() const;
196 
203  eC_Bool DoKeyDown(
204  const GUIKeyIdentifier_t& eKeyID,
205  const eC_UInt& uiModifiers);
206 
215  eC_Bool DoDrag(const eC_Value& vDeltaX, const eC_Value& vDeltaY, const eC_Value& vAbsX, const eC_Value& vAbsY);
216 
217  eC_Bool DoButtonDown(const eC_Value& vAbsX, const eC_Value& vAbsY);
218 
225  inline void SetMaximumZoomFactor(eC_Value vMaxFactor) { m_vMaxScale = vMaxFactor; }
226 
233  inline void SetMinimumZoomFactor(eC_Value vMinFactor) { m_vMinScale = vMinFactor; }
234 
241  inline void SetStaticZoomFactor(eC_Value vStaticFactor) { m_vStaticScale = vStaticFactor; InvalidateArea(); }
242 
246  inline eC_Value GetMaximumZoomFactor() const { return m_vMaxScale; }
247 
251  inline eC_Value GetMinimumZoomFactor() const { return m_vMinScale; }
252 
256  inline eC_Value GetStaticZoomFactor() const { return m_vStaticScale; }
257 
258 #if defined(GUILIANI_STREAM_GUI)
259 
263  virtual void ReadFromStream();
264 #endif
265 
266 #if defined(GUILIANI_WRITE_GUI)
267 
272  virtual void WriteToStream(const eC_Bool bWriteClassID = false);
273 #endif
274 
275 protected:
282  void BlitScaledImage(ImageResource_t eID, eC_Value vScale, eC_Value vYOffset, eC_UByte ubAlpha);
283 
286  {
290  };
291 
294 
297 
299  eC_TArray<ImageResource_t> m_aImageIDs;
300 
302  eC_UInt m_uiFrameDelay;
303 
306 
309  eC_Value m_vMaxScale;
310 
313  eC_Value m_vMinScale;
314 
317  eC_Value m_vStaticScale;
318 
320  eC_Value m_vDragStartY;
321 
322 private:
324  void Init();
325 
327  void DeInit();
328 };
329 
330 #endif // GUI_IMAGE_STACK_H