Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUIRadialSlider.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 CGUIRADIALSLIDER__H_
11#define CGUIRADIALSLIDER__H_
12
13#include "GUIRadialBar.h"
14
15#include "GUIImageResource.h"
16#include "GUICommonEnums.h"
17#include "GUINinePatch.h"
18
20
21// @guiliani_doxygen toplevel_control Radial Slider
32// @endguiliani_doxygen
37{
38public:
53 CGUICompositeObject* const pkParent,
54 const eC_Value& vX, const eC_Value& vY,
55 const eC_Value& vWidth, const eC_Value& vHeight,
56 const ObjectHandle_t &eID = NO_HANDLE);
57
69 CGUICompositeObject* const pkParent,
70 const CGUIRect& kRect,
71 const ObjectHandle_t &eID = NO_HANDLE);
72
77
83
86
90 virtual void SetWidth(const eC_Value& vWidth);
91
95 virtual void SetHeight(const eC_Value& vHeight);
96
97 virtual eC_Bool DoButtonDown(const eC_Value& vAbsX, const eC_Value& vAbsY);
98
99 virtual eC_Bool DoDrag(const eC_Value& vDeltaX, const eC_Value& vDeltaY, const eC_Value& vAbsX, const eC_Value& vAbsY);
100
101 virtual eC_Bool DoDragEnd(const eC_Value& vAbsX, const eC_Value& vAbsY);
102
103 virtual eC_Bool DoClick(const eC_Value& vAbsX, const eC_Value& vAbsY);
104
105 virtual eC_Bool SetValue(const CGUIValue& rkValue);
106
107#ifdef GUILIANI_STREAM_GUI
109
110 virtual void ReadFromStream();
111#endif
112
113#ifdef GUILIANI_WRITE_GUI
114 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
115#endif
116
117protected:
120 void Init();
121
125 void CopyAttributes(const CGUIRadialSlider& kSource);
126
128 void DeInit();
129
132
135
138
145 void MoveHandle(const eC_Value& vDeltaX, const eC_Value& vDeltaY, const eC_Value& vAbsX, const eC_Value& vAbsY);
146
152 eC_Value GetAngle(const eC_Value& vAbsX, const eC_Value& vAbsY);
153
155 virtual void DrawFilled();
156
157private:
158 enum MovingPart_t
159 {
160 MP_NONE,
161 MP_HANDLE1,
162 MP_HANDLE2,
163 MP_MIDDLE
164 };
165
166private:
167 ImageResource_t m_eImageKnob;
168
169 eC_Bool m_bDoubleEnded;
170
171 eC_Value m_vKnobWidth;
172 eC_Value m_vKnobHeight;
173
174 CGUIRect m_kHandle1;
175 CGUIRect m_kHandle2;
176
177 eC_Bool m_bSelfUpdate;
178
179 // internal members
180 MovingPart_t m_eMovingHandle;
181
182 eC_Value m_vCurrentAngle;
183 eC_Value m_vCurrentAngle2;
184
185 eC_Value m_vCurrentDrawAngle;
186 eC_Value m_vCurrentDrawAngle2;
187};
188#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
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
Base class for radial bars.
Definition: GUIRadialBar.h:33
A primitive-based radial slider.
Definition: GUIRadialSlider.h:37
virtual eC_Bool DoButtonDown(const eC_Value &vAbsX, const eC_Value &vAbsY)
CGUIRadialSlider(CGUICompositeObject *const pkParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
CGUIRadialSlider(const CGUIRadialSlider &kSource)
void MoveHandle(const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
void DeInit()
Deinitialize the control and free the resources.
virtual eC_Bool DoDrag(const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
void CalculateHandle()
calculate position of handle
eC_Value GetAngle(const eC_Value &vAbsX, const eC_Value &vAbsY)
void CopyAttributes(const CGUIRadialSlider &kSource)
void CalculateValues()
calculate current slider-values
virtual void ReadFromStream()
CGUIRadialSlider & operator=(const CGUIRadialSlider &kSource)
virtual ~CGUIRadialSlider()
Destructor.
CGUIRadialSlider(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)
virtual void DrawFilled()
draw filled part of bar
virtual eC_Bool DoClick(const eC_Value &vAbsX, const eC_Value &vAbsY)
void CalculateImageSizes()
calculate image-size
virtual eC_Bool SetValue(const CGUIValue &rkValue)
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
virtual void SetWidth(const eC_Value &vWidth)
virtual eC_Bool DoDragEnd(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual void SetHeight(const eC_Value &vHeight)
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