Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIScrollBar.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 __GUISCROLLBAR__H_
11#define __GUISCROLLBAR__H_
12
13#include "GUICompositeObject.h"
14#include "GUISlider.h"
15#include "GUIRange.h"
16#include "GUIObserver.h"
17#include "GUIException.h"
18
19class CGUIButton;
20
22
49{
50public:
62 CGUICompositeObject* const pkParent,
63 CGUIObject* const pScrolledObject,
64 const eC_UInt &uiStepSize = 1,
65 const CGUIRange::Base_t &eBase = CGUIRange::BASE_AT_MINIMUM,
67 const ObjectHandle_t &eID = NO_HANDLE);
68
70 virtual ~CGUIScrollBar();
71
79 eC_Bool DoClick(const eC_Value& vAbsX, const eC_Value& vAbsY);
80
86 void RecalculateScrollingRange(const eC_Value vCLipperSize);
87
92
97
102 eC_Bool SetValue(const CGUIValue& rkValue);
103
108
113
118
122 const CGUIRange& GetRange() const;
123
130 void OnNotification(const CGUIValue& kObservedValue, const CGUIObject* const pkUpdatedObject, const eC_UInt uiX=0, const eC_UInt uiY=0);
131
135 virtual void DoAnimate(const eC_Value& vTimes = eC_FromInt(1));
136
142 void SetScrollInterval(const eC_UInt &ruiScrollInterval);
143
147 eC_UInt GetScrollInterval() const;
148
152 void SetScrollSpeed(const eC_UInt &ruiScrollSpeed) const;
153
157 eC_UInt GetScrollSpeed() const;
158
162 void HideButtons(const eC_Bool &bHide);
163
168 virtual void RemoveObject(CGUIObject* pkObject);
169
170#ifdef GUILIANI_STREAM_GUI
176 {
177 Init();
178 }
179
180 virtual void ReadFromStream();
181
182#endif
183#ifdef GUILIANI_WRITE_GUI
184 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
185#endif
186
187protected:
194 eC_Bool DoButtonDown(const eC_Value& vAbsX, const eC_Value& vAbsY);
195
202 eC_Bool DoDragEnd(const eC_Value& vAbsX, const eC_Value& vAbsY);
203
204private:
206 void Init();
208 void DeInit();
210 void AdaptKnobSize();
212 void AdaptSliderSize();
213
214 void CreateChildObjects(const eC_UInt& uiStepSize, const CGUIRange::Base_t &eBase, const CGUICommonEnums::Orientation_t &eStyle);
215
216 eC_UInt m_uiScrollInterval;
217 eC_Bool m_bScrollDownRight;
218 eC_Int m_iOldValue;
219 CGUIObject* m_pkScrolledObject;
220 CGUISlider* m_pkSlider;
221 CGUIButton* m_pkUpLeftButton;
222 CGUIButton* m_pkDownRightButton;
223
224 ObjectHandle_t m_eScrolledObject;
225 eC_Bool m_bAutoStretch;
226};
227#endif
ObjectHandle_t
List of object resource ids.
Definition: GUIObjectHandleResource.h:55
Button specialization that uses images for graphical representation.
Definition: GUIButton.h:69
Orientation_t
orientation of controls
Definition: GUICommonEnums.h:57
@ OR_HORIZONTAL
horizontal orientation
Definition: GUICommonEnums.h:58
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:81
Observer Base class for Observer-Design-Pattern within Guiliani.
Definition: GUIObserver.h:28
Helper class to supply a platform independent range implementation.
Definition: GUIRange.h:67
Base_t
Whether base is at minimum or maximum of the range.
Definition: GUIRange.h:72
The ScrollBar allows navigating controls which are larger than their actual visual representation.
Definition: GUIScrollBar.h:49
void OnNotification(const CGUIValue &kObservedValue, const CGUIObject *const pkUpdatedObject, const eC_UInt uiX=0, const eC_UInt uiY=0)
eC_Bool DoClick(const eC_Value &vAbsX, const eC_Value &vAbsY)
CGUIButton * GetUpLeftButton() const
const CGUIRange & GetRange() const
CGUISlider * GetSlider() const
CGUIScrollBar()
Definition: GUIScrollBar.h:175
void RecalculateScrollingRange(const eC_Value vCLipperSize)
eC_UInt GetScrollSpeed() const
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
void SetScrolledObject(CGUIObject *pkObject)
void SetScrollSpeed(const eC_UInt &ruiScrollSpeed) const
virtual void RemoveObject(CGUIObject *pkObject)
eC_UInt GetScrollInterval() const
virtual void ReadFromStream()
CGUIScrollBar(CGUICompositeObject *const pkParent, CGUIObject *const pScrolledObject, const eC_UInt &uiStepSize=1, const CGUIRange::Base_t &eBase=CGUIRange::BASE_AT_MINIMUM, const CGUICommonEnums::Orientation_t &eStyle=CGUICommonEnums::OR_HORIZONTAL, const ObjectHandle_t &eID=NO_HANDLE)
eC_Bool DoDragEnd(const eC_Value &vAbsX, const eC_Value &vAbsY)
CGUIObject * GetScrolledObject() const
virtual ~CGUIScrollBar()
eC_Bool SetValue(const CGUIValue &rkValue)
void HideButtons(const eC_Bool &bHide)
void SetScrollInterval(const eC_UInt &ruiScrollInterval)
CGUIButton * GetDownRightButton() const
eC_Bool DoButtonDown(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual void DoAnimate(const eC_Value &vTimes=eC_FromInt(1))
Slider specialization that uses images for graphical representation.
Definition: GUISlider.h:80
CGUIValue stores a single value in one specific type.
Definition: GUIValue.h:25