Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIProgressBar.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 CGUIPROGRESSBAR__H_
11#define CGUIPROGRESSBAR__H_
12
13#include "GUIImageResource.h"
14#include "GUIAbstractBar.h"
15#include "GUICommonEnums.h"
16#include "GUINinePatch.h"
17#include "GUIColorPropertyObserver.h"
18
20
21// @guiliani_doxygen toplevel_control Progress Bar
34// @endguiliani_doxygen
82{
83public:
86 {
98 };
99
102 {
111 };
112
127 const eC_Value& vX, const eC_Value& vY, const eC_Value& vWidth,
128 const eC_Value& vHeight,
129 const ObjectHandle_t &eID = NO_HANDLE);
130
147 const eC_Value& vX, const eC_Value& vY, const eC_Value& vWidth,
148 const eC_Value& vHeight,
149 const ImageResource_t &eBackground,
150 const ImageResource_t &eForeground,
151 const ObjectHandle_t &eID = NO_HANDLE);
152
164 const CGUIRect& kRect,
165 const ObjectHandle_t &eID = NO_HANDLE);
166
180 const CGUIRect& kRect,
181 const ImageResource_t &eBackground,
182 const ImageResource_t &eForeground,
183 const ObjectHandle_t &eID = NO_HANDLE);
184
189
190
196
197 virtual eC_Bool DoDraw();
198
199 virtual eC_Bool IsHighlightable() const { return false; }
200
206 void SetImages(const ImageResource_t eForeground, const ImageResource_t eBackground);
207
208 virtual void DoAnimate(const eC_Value& vTimes = eC_FromInt(1));
209
215 void SetFullRangeSize(const eC_Value& vSize);
216
219 inline eC_Value GetFullRangeSize() const
220 {
222 return m_vBarWidth;
224 return m_vBarHeight;
225 else
226 return eC_FromInt(0);
227 }
228
233
238 {
239 return m_eProgressBarType;
240 }
241
247 inline void SetLoopMode(LoopMode_t eLM)
248 {
249 m_eLoopMode = eLM;
250 }
251
256 inline LoopMode_t GetLoopMode() const
257 {
258 return m_eLoopMode;
259 }
260
265 eC_Bool Increase();
266
271 eC_Bool Decrease();
272
277 void SetVertical(eC_Bool bVert)
278 {
279 if (bVert)
281 else
283 }
284
288 inline eC_Bool IsVertical() const
289 {
291 return false;
293 return true;
294 return false;
295 }
296
300 inline eC_Value GetBarXPos() const
301 {
302 return m_vBarX;
303 }
304
308 inline eC_Value GetBarYPos() const
309 {
310 return m_vBarY;
311 }
312
316 inline eC_Value GetBarWidth() const
317 {
318 return m_vBarWidth;
319 }
320
324 inline eC_Value GetBarHeight() const
325 {
326 return m_vBarHeight;
327 }
328
334 inline void SetBarRect(const CGUIRect& kBarRect)
335 {
336 m_vBarX = kBarRect.GetX1();
337 m_vBarY = kBarRect.GetY1();
338 m_vBarWidth = kBarRect.GetWidth();
339 m_vBarHeight = kBarRect.GetHeight();
341 }
342
347 void SetBarXPos(const eC_Value& vX);
348
353 void SetBarYPos(const eC_Value& vY);
354
359 void SetBarWidth(const eC_Value& vWidth);
360
365 void SetBarHeight(const eC_Value& vHeight);
366
369
373 virtual void SetWidth(const eC_Value& vWidth);
374
378 virtual void SetHeight(const eC_Value& vHeight);
379
383
387 eC_UInt GetForegroundColor() const;
388
392 void SetForegroundColor(const eC_UInt& uiForegroundColor);
393
397 void SetForegroundColor(const GlobalProperty_t& eForegroundColor);
398
399#ifdef GUILIANI_STREAM_GUI
401
402 virtual void ReadFromStream();
403#endif
404#ifdef GUILIANI_WRITE_GUI
405 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
406#endif
407
408protected:
409
414 eC_Bool IncrementValue(eC_Bool bInc);
415
418 virtual void DrawTypeNormalBar();
419
422 virtual void DrawTypeActivityBar();
423
428 void Init(const ImageResource_t &eForeground, const ImageResource_t &eBackground);
429
433 void CopyAttributes(const CGUIProgressBar& kSource);
434
436 void DeInit();
437
440
443
446
448 eC_Value m_vBarX;
449
451 eC_Value m_vBarY;
452
454 eC_Value m_vBarWidth;
455
457 eC_Value m_vBarHeight;
458
461
464
467
470};
471#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
GlobalProperty_t
List of property resource ids.
Definition: GUIPropertyResource.h:67
Base class for bars.
Definition: GUIAbstractBar.h:33
This observer provides the base-interface for controls when using color-properties.
Definition: GUIColorPropertyObserver.h:23
Orientation_t
orientation of controls
Definition: GUICommonEnums.h:57
@ OR_VERTICAL
vertical orientation
Definition: GUICommonEnums.h:59
@ OR_HORIZONTAL
horizontal orientation
Definition: GUICommonEnums.h:58
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
Helper class to for storing Nine-Patch images.
Definition: GUINinePatch.h:41
void InvalidateArea()
A bitmap based progress bar.
Definition: GUIProgressBar.h:82
eC_UInt GetForegroundColor() const
ProgressBarType_t m_eProgressBarType
The progress bar type.
Definition: GUIProgressBar.h:460
virtual void DrawTypeNormalBar()
eC_Bool IsVertical() const
Definition: GUIProgressBar.h:288
void SetBarXPos(const eC_Value &vX)
virtual void ReadFromStream()
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
ImageResource_t m_eImgBackground
Background image ID.
Definition: GUIProgressBar.h:439
void SetBarWidth(const eC_Value &vWidth)
void SetImages(const ImageResource_t eForeground, const ImageResource_t eBackground)
void DeInit()
Deinitialize the control and free the resources.
void SetBarYPos(const eC_Value &vY)
virtual eC_Bool IsHighlightable() const
Definition: GUIProgressBar.h:199
CGUIProgressBar & operator=(const CGUIProgressBar &kSource)
CGUINinePatch & GetNinePatch()
Definition: GUIProgressBar.h:382
void Init(const ImageResource_t &eForeground, const ImageResource_t &eBackground)
void SetLoopMode(LoopMode_t eLM)
Definition: GUIProgressBar.h:247
CGUIProgressBar(const CGUIProgressBar &kSource)
eC_Value m_vBarWidth
The width of the progressing area.
Definition: GUIProgressBar.h:454
void CopyAttributes(const CGUIProgressBar &kSource)
eC_Value GetBarHeight() const
Definition: GUIProgressBar.h:324
eC_Bool m_bLoopDirection
Indicates the direction in which the bar will be moving in Activity mode.
Definition: GUIProgressBar.h:466
ImageResource_t m_eImgForeground
Foreground image ID.
Definition: GUIProgressBar.h:442
virtual void SetWidth(const eC_Value &vWidth)
eC_Value m_vBarX
The x position of the progressing area relative to the control.
Definition: GUIProgressBar.h:448
void SetForegroundColor(const eC_UInt &uiForegroundColor)
LoopMode_t GetLoopMode() const
Definition: GUIProgressBar.h:256
CGUIProgressBar(CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ImageResource_t &eBackground, const ImageResource_t &eForeground, const ObjectHandle_t &eID=NO_HANDLE)
CGUICommonEnums::Orientation_t m_eStyle
Indicates whether the progress bar is a vertical bar or horizontal bar.
Definition: GUIProgressBar.h:445
virtual void DrawTypeActivityBar()
eC_Bool Decrease()
void SetVertical(eC_Bool bVert)
Definition: GUIProgressBar.h:277
CGUIProgressBar(CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
ProgressBarType_t GetTypeOfProgressBar() const
Definition: GUIProgressBar.h:237
eC_Value GetBarWidth() const
Definition: GUIProgressBar.h:316
eC_Bool IncrementValue(eC_Bool bInc)
void SetBarRect(const CGUIRect &kBarRect)
Definition: GUIProgressBar.h:334
void SetFullRangeSize(const eC_Value &vSize)
eC_Bool Increase()
eC_Value m_vBarHeight
The height of the progressing area.
Definition: GUIProgressBar.h:457
eC_Value GetBarYPos() const
Definition: GUIProgressBar.h:308
LoopMode_t m_eLoopMode
Loop mode used in the progress bar with activity type.
Definition: GUIProgressBar.h:463
eC_Value GetFullRangeSize() const
Definition: GUIProgressBar.h:219
CGUIProgressBar(CGUICompositeObject *const pkParent, const CGUIRect &kRect, const ImageResource_t &eBackground, const ImageResource_t &eForeground, const ObjectHandle_t &eID=NO_HANDLE)
ProgressBarType_t
Progress bar types.
Definition: GUIProgressBar.h:86
@ PBT_PROGRESSBAR_TYPE_ACTIVITY
Definition: GUIProgressBar.h:97
@ PBT_PROGRESSBAR_TYPE_NORMAL
Definition: GUIProgressBar.h:90
CGUIProgressBar(CGUICompositeObject *const pkParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
virtual void DoAnimate(const eC_Value &vTimes=eC_FromInt(1))
void SetTypeOfProgressBar(ProgressBarType_t eType)
virtual void SetHeight(const eC_Value &vHeight)
void SetBarHeight(const eC_Value &vHeight)
LoopMode_t
Loop modes for PBT_PROGRESSBAR_TYPE_ACTIVITY.
Definition: GUIProgressBar.h:102
@ LM_FILL_UP_TILE
Fills up the bar tiled.
Definition: GUIProgressBar.h:110
@ LM_REVERTLOOP_MODE
Cycles the full bar from start to end and reverts direction from end to start repeatedly.
Definition: GUIProgressBar.h:106
@ LM_FILL_UP
Fills up the bar from start to end until full and starts again empty repeatedly.
Definition: GUIProgressBar.h:108
@ LM_LOOP_MODE
The full bar travels from start to end repeatedly.
Definition: GUIProgressBar.h:104
eC_Value GetBarXPos() const
Definition: GUIProgressBar.h:300
virtual eC_Bool DoDraw()
eC_Value m_vBarY
The y position of the progressing area relative to the control.
Definition: GUIProgressBar.h:451
~CGUIProgressBar()
Destructor.
void SetForegroundColor(const GlobalProperty_t &eForegroundColor)
CGUINinePatch m_kNinePatch
Nine patch borders for scaling the foreground image.
Definition: GUIProgressBar.h:469
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
eC_Value GetX1() const
Definition: GUIRect.h:196
eC_Value GetY1() const
Definition: GUIRect.h:197
eC_Value GetWidth() const
Definition: GUIRect.h:164
eC_Value GetHeight() const
Definition: GUIRect.h:175