Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUISegmentBar.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 GUISEGMENTBAR_H
11#define GUISEGMENTBAR_H
12
13#include "GUIAbstractBar.h"
14
15#include "GUICommonEnums.h"
16#include "GUIImageResource.h"
17#include "GUINinePatch.h"
18
49{
50public:
60 CGUICompositeObject* const pkParent,
61 const eC_Value& vX, const eC_Value& vY,
62 const eC_Value& vWidth, const eC_Value& vHeight,
63 const ObjectHandle_t &eID = NO_HANDLE);
64
66
67 virtual ~CGUISegmentBar();
68
73 void SetImages(const ImageResource_t& eInactiveImage, const ImageResource_t& eActiveImage);
74
79 void GetImages(ImageResource_t& eInactiveImage, ImageResource_t& eActiveImage) const;
80
85
90
95
100 void SetMargin(const eC_Value& vMarginX, const eC_Value& vMarginY);
101
106 void GetMargin(eC_Value& vMarginX, eC_Value& vMarginY) const;
107
111 void SetGap(const eC_Value& vGap);
112
116 eC_Value GetGap() const;
117
124 void SetSegmentSize(const eC_Value& vSegmentWidth, const eC_Value& vSegmentHeight);
125
130 void GetSegmentSize(eC_Value& vSegmentWidth, eC_Value& vSegmentHeight) const;
131
138 void SetAutoStretch(const eC_Bool& bAutoStretch);
139
143 eC_Bool GetAutoStretch() const;
144
145 eC_Bool OnValueChange();
146
147 virtual void SetWidth(const eC_Value& vX);
148
149 virtual void SetHeight(const eC_Value& vY);
150
151 virtual eC_Bool DoButtonDown(
152 const eC_Value& vAbsX,
153 const eC_Value& vAbsY);
154
155 virtual eC_Bool DoDrag(
156 const eC_Value& vDeltaX,
157 const eC_Value& vDeltaY,
158 const eC_Value& vAbsX,
159 const eC_Value& vAbsY);
160
161 virtual eC_Bool DoClick(
162 const eC_Value& vAbsX,
163 const eC_Value& vAbsY);
164
165#if defined(GUILIANI_STREAM_GUI)
170 virtual void ReadFromStream();
171#endif
172
173#if defined(GUILIANI_WRITE_GUI)
179 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
180#endif
181
182 virtual eC_Bool IsHighlightable() const { return false; }
183
184protected:
185 virtual eC_Bool DoDraw();
186
187private:
188 void Init();
189
190 void DeInit();
191
192 void UpdateValues();
193 void CalculateValue(const eC_Value& vPosX, const eC_Value& vPosY);
194
195private:
196 // streamed members
197 CGUICommonEnums::Orientation_t m_eOrientation;
198 ImageResource_t m_eInactiveImage;
199 ImageResource_t m_eActiveImage;
200 CGUINinePatch m_kSegmentNinePatch;
201 eC_Bool m_bAutoStretch;
202 eC_Value m_vMarginX;
203 eC_Value m_vMarginY;
204 eC_Value m_vSegmentWidth;
205 eC_Value m_vSegmentHeight;
206 eC_Value m_vGapBetweenSegments;
207
208 // internal members
209 eC_Value m_vScaledSegmentWidth;
210 eC_Value m_vScaledSegmentHeight;
211 eC_Value m_vAdvanceX;
212 eC_Value m_vAdvanceY;
213 eC_UInt m_uiNumberOfSegments;
214};
215
216#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
Orientation_t
orientation of controls
Definition: GUICommonEnums.h:57
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
Definition: GUISegmentBar.h:49
virtual eC_Bool IsHighlightable() const
Definition: GUISegmentBar.h:182
eC_Value GetGap() const
void GetImages(ImageResource_t &eInactiveImage, ImageResource_t &eActiveImage) const
void SetGap(const eC_Value &vGap)
void SetSegmentSize(const eC_Value &vSegmentWidth, const eC_Value &vSegmentHeight)
virtual eC_Bool DoDraw()
void GetMargin(eC_Value &vMarginX, eC_Value &vMarginY) const
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
virtual eC_Bool DoDrag(const eC_Value &vDeltaX, const eC_Value &vDeltaY, const eC_Value &vAbsX, const eC_Value &vAbsY)
void SetOrientation(const CGUICommonEnums::Orientation_t &eOrientation)
CGUINinePatch GetNinePatch()
virtual eC_Bool DoButtonDown(const eC_Value &vAbsX, const eC_Value &vAbsY)
void SetImages(const ImageResource_t &eInactiveImage, const ImageResource_t &eActiveImage)
eC_Bool OnValueChange()
void GetSegmentSize(eC_Value &vSegmentWidth, eC_Value &vSegmentHeight) const
CGUICommonEnums::Orientation_t GetOrientation() const
CGUISegmentBar(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 SetWidth(const eC_Value &vX)
virtual eC_Bool DoClick(const eC_Value &vAbsX, const eC_Value &vAbsY)
virtual void SetHeight(const eC_Value &vY)
void SetAutoStretch(const eC_Bool &bAutoStretch)
virtual void ReadFromStream()
void SetMargin(const eC_Value &vMarginX, const eC_Value &vMarginY)
eC_Bool GetAutoStretch() const