Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUICircularSlider.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 _GUICIRCULARSLIDER_H_
11#define _GUICIRCULARSLIDER_H_
12
13#include "GUIAbstractBar.h"
14#include "GUINinePatch.h"
15#include "GUIRange.h"
16
17#include "GUIPoint.h"
18#include "GUIRect.h"
19
20#include "GUIImageResource.h"
21
36{
37public:
56 CGUICompositeObject* const pkParent,
57 const eC_Value& vX, const eC_Value& vY,
58 const eC_Value& vWidth, const eC_Value& vHeight,
59 const eC_Value& vRadius,
60 const eC_Value& vStartAngle,
61 const eC_Value& vEndAngle,
62 const eC_Int& iValue,
63 const eC_Int& iMin,
64 const eC_Int& iMax,
65 const eC_UInt& uiStepSize,
66 const CGUIRange::Base_t& eBase = CGUIRange::BASE_AT_MINIMUM,
67 const ObjectHandle_t& eID = NO_HANDLE);
68
69 virtual ~CGUICircularSlider();
70
73
74 virtual eC_Bool DoButtonDown(const eC_Value& vAbsX, const eC_Value& vAbsY);
75
76 virtual eC_Bool DoDrag(
77 const eC_Value& vDeltaX,
78 const eC_Value& vDeltaY,
79 const eC_Value& vAbsX,
80 const eC_Value& vAbsY);
81
82 virtual eC_Bool DoDragEnd(
83 const eC_Value& vAbsX,
84 const eC_Value& vAbsY);
85
86 virtual eC_Bool DoClick(
87 const eC_Value& vAbsX,
88 const eC_Value& vAbsY);
89
90 virtual eC_Bool DoDraw();
91
96 void CalculateKnobRect(const eC_Int& iValue);
97
103 eC_Value GetAngle(const eC_Value& vAbsX, const eC_Value& vAbsY);
104
120 const ImageResource_t& eSldBG,
121 const ImageResource_t& eSldKnobNormal,
122 const ImageResource_t& eSldKnobHighlighted,
123 const ImageResource_t& eSldKnobPressed,
124 const ImageResource_t& eSldKnobGrayedOut = DUMMY_IMAGE);
125
126 // set functions
127
131 void SetKnobSize(const eC_Value& vKnobSize);
132
136 eC_Value GetKnobSize() const;
137
141 void SetStartAngle(const eC_Value& vStartAngle);
142
146 eC_Value GetStartAngle() const;
147
151 void SetEndAngle(const eC_Value& vEndAngle);
152
156 eC_Value GetEndAngle() const;
157
161 void SetRadius(const eC_Value& vRadius);
162
166 eC_Value GetRadius() const;
167
173 virtual eC_Bool SetValue(const CGUIValue& rkValue);
174
179 void SetRange(const eC_Int& iMin, const eC_Int& iMax);
180
184 void SetSmoothControl(const eC_Bool& bSmoothControl);
185
189 eC_Bool GetSmoothControl() const;
190
191#ifdef GUILIANI_STREAM_GUI
197
198 virtual void ReadFromStream();
199#endif
200#ifdef GUILIANI_WRITE_GUI
201 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
202#endif
203
204protected:
205#ifndef GUILIANI_STREAM_GUI
209#endif
210
211private:
212 void Init(
213 const eC_Value& vRadius,
214 const eC_Value& vStartAngle,
215 const eC_Value& vEndAngle,
216 const eC_Int& iValue,
217 const eC_Int& iMin,
218 const eC_Int& iMax,
219 const eC_UInt& uiStepSize,
220 const CGUIRange::Base_t& eBase);
221
222 void DeInit();
223
224 eC_Int GetSliderValue(const eC_Value& vAngle);
225
226 void UpdateValue();
227 void UpdateAngle();
228
229private:
230 CGUIRect m_kKnobRect;
231
232 ImageResource_t m_eCSldBG;
233 ImageResource_t m_eCSldKnobNormal;
234 ImageResource_t m_eCSldKnobHighlighted;
235 ImageResource_t m_eCSldKnobPressed;
236 ImageResource_t m_eCSldKnobGrayedOut;
237
241 eC_Value m_vKnobSize;
242
244 eC_Value m_vMinimumKnobSize;
245
246 eC_Bool m_bSmoothControl;
247
248 //radius of ricle inside Rect Object class
249 eC_Value m_vRadius;
250
251 // angles for user input
252 eC_Value m_vStartAngle;
253 eC_Value m_vEndAngle;
254
255 eC_Value m_vAngle;
256};
257#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
Base class for bars.
Definition: GUIAbstractBar.h:33
This class represents a circular slider.
Definition: GUICircularSlider.h:36
virtual eC_Bool DoClick(const eC_Value &vAbsX, const eC_Value &vAbsY)
eC_Value GetStartAngle() const
virtual void ReadFromStream()
eC_Value GetRadius() const
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
eC_Bool GetSmoothControl() const
void CalculateKnobRect(const eC_Int &iValue)
void SetSmoothControl(const eC_Bool &bSmoothControl)
void SetImages(const ImageResource_t &eSldBG, const ImageResource_t &eSldKnobNormal, const ImageResource_t &eSldKnobHighlighted, const ImageResource_t &eSldKnobPressed, const ImageResource_t &eSldKnobGrayedOut=DUMMY_IMAGE)
void SetRange(const eC_Int &iMin, const eC_Int &iMax)
virtual eC_Bool DoDrag(const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
eC_Value GetKnobSize() const
eC_Value GetEndAngle() const
virtual eC_Bool DoDragEnd(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual eC_Bool DoButtonDown(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual eC_Bool DoDraw()
CGUICircularSlider(CGUICompositeObject *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const eC_Value &vRadius, const eC_Value &vStartAngle, const eC_Value &vEndAngle, const eC_Int &iValue, const eC_Int &iMin, const eC_Int &iMax, const eC_UInt &uiStepSize, const CGUIRange::Base_t &eBase=CGUIRange::BASE_AT_MINIMUM, const ObjectHandle_t &eID=NO_HANDLE)
void SetEndAngle(const eC_Value &vEndAngle)
void SetKnobSize(const eC_Value &vKnobSize)
virtual eC_Bool SetValue(const CGUIValue &rkValue)
void SetStartAngle(const eC_Value &vStartAngle)
eC_Value GetAngle(const eC_Value &vAbsX, const eC_Value &vAbsY)
void SetStandardImages()
sets all images to standart images
void SetRadius(const eC_Value &vRadius)
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
Base_t
Whether base is at minimum or maximum of the range.
Definition: GUIRange.h:72
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