Guiliani  Version 2.5 revision 7293 (documentation build 13)
GUIListItem.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 CGUILISTITEM_H_
11#define CGUILISTITEM_H_
12
13#include "GUITextField.h"
14
15class CGUIListBox;
16
18
64{
65public:
80 CGUIListBox* const pkParent,
81 const eC_Value& vX, const eC_Value& vY,
82 const eC_Value& vWidth, const eC_Value& vHeight,
83 const eC_String &kText,
84 const eC_Bool& bMultiLine = false,
85 const eC_Value& vRelXPosIcon = eC_FromInt(0),
86 const eC_Value& vRelYPosIcon = eC_FromInt(0),
87 const ImageResource_t &eBackgroundImg = DUMMY_IMAGE,
88 const ObjectHandle_t &eID = NO_HANDLE);
89
101 CGUIListBox* const pkParent,
102 const CGUIRect &kRect,
103 const eC_String &kText,
104 const eC_Bool& bMultiLine = false,
105 const eC_Value& vRelXPosIcon = eC_FromInt(0),
106 const eC_Value& vRelYPosIcon = eC_FromInt(0),
107 const ImageResource_t &eBackgroundImg = DUMMY_IMAGE,
108 const ObjectHandle_t &eID = NO_HANDLE);
109
124 CGUIListBox* const pkParent,
125 const eC_Value& vX, const eC_Value& vY,
126 const eC_Value& vWidth, const eC_Value& vHeight,
127 const TextResource_t &eTextID,
128 const eC_Bool& bMultiLine = false,
129 const eC_Value& vRelXPosIcon = eC_FromInt(0),
130 const eC_Value& vRelYPosIcon = eC_FromInt(0),
131 const ImageResource_t &eBackgroundImg = DUMMY_IMAGE,
132 const ObjectHandle_t &eID = NO_HANDLE);
133
145 CGUIListBox* const pkParent,
146 const CGUIRect &kRect,
147 const TextResource_t &eTextID,
148 const eC_Bool& bMultiLine = false,
149 const eC_Value& vRelXPosIcon = eC_FromInt(0),
150 const eC_Value& vRelYPosIcon = eC_FromInt(0),
151 const ImageResource_t &eBackgroundImg = DUMMY_IMAGE,
152 const ObjectHandle_t &eID = NO_HANDLE);
153
157 CGUIListItem(const CGUIListItem& kSource);
158
163
165 virtual ~CGUIListItem();
166
172
173#ifdef GUILIANI_STREAM_GUI
174 virtual void ReadFromStream();
175#endif
176
177#ifdef GUILIANI_WRITE_GUI
178 virtual void WriteToStream(const eC_Bool bWriteClassID = false);
179#endif
180
181 eC_Bool DoDraw();
182
183 void SetParent(CGUICompositeObject* const pkParent);
184
189 void SetSelectedColor(const eC_UInt& uiSelectedColor);
190
195 void SetSelectedColor(const GlobalProperty_t& eSelectedColor);
196
200 eC_UInt GetSelectedColor() const;
201
205 void SetSelected(const eC_Bool& bSelected);
206
210 eC_Bool IsSelected() const;
211
216 void SetIconPos(const eC_Value& vRelXPosIcon, const eC_Value& vRelYPosIcon);
217
222 void GetIconPos(eC_Value& vRelXPosIcon, eC_Value& vRelYPosIcon);
223
228 void SetIconImages(const ImageResource_t& eIconNormal, const ImageResource_t& eIconSelected);
229
234 void GetIconImages(ImageResource_t& eIconNormal, ImageResource_t& eIconSelected);
235
236protected:
238 eC_Bool m_bSelected;
239
242
245
248
251
252private:
254 void Init(CGUIListBox* pkParent, const eC_Value& vRelXPosIcon, const eC_Value& vRelYPosIcon);
255
257 void DeInit();
258
260 void CopyAttributes(const CGUIListItem & kSource);
261
262private:
263 static const eC_UInt INDEX_COLOR_SELECTED;
264};
265#endif
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
TextResource_t
List of text resource ids.
Definition: GUITextResource.h:40
This is the Guiliani base class for all composite objects.
Definition: GUICompositeObject.h:70
Contains list items and can be scrolled if there is not enough space.
Definition: GUIListBox.h:103
A list item is a control that is shown in a list as an element.
Definition: GUIListItem.h:64
eC_Bool DoDraw()
eC_Bool m_bSelected
Indicate whether the control is selected or not.
Definition: GUIListItem.h:238
void GetIconImages(ImageResource_t &eIconNormal, ImageResource_t &eIconSelected)
void SetParent(CGUICompositeObject *const pkParent)
CGUIListItem(CGUIListBox *const pkParent, const CGUIRect &kRect, const TextResource_t &eTextID, const eC_Bool &bMultiLine=false, const eC_Value &vRelXPosIcon=eC_FromInt(0), const eC_Value &vRelYPosIcon=eC_FromInt(0), const ImageResource_t &eBackgroundImg=DUMMY_IMAGE, const ObjectHandle_t &eID=NO_HANDLE)
void SetSelected(const eC_Bool &bSelected)
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
void SetSelectedColor(const GlobalProperty_t &eSelectedColor)
eC_Bool IsSelected() const
virtual ~CGUIListItem()
void GetIconPos(eC_Value &vRelXPosIcon, eC_Value &vRelYPosIcon)
CGUIListItem(CGUIListBox *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const eC_String &kText, const eC_Bool &bMultiLine=false, const eC_Value &vRelXPosIcon=eC_FromInt(0), const eC_Value &vRelYPosIcon=eC_FromInt(0), const ImageResource_t &eBackgroundImg=DUMMY_IMAGE, const ObjectHandle_t &eID=NO_HANDLE)
void SetIconPos(const eC_Value &vRelXPosIcon, const eC_Value &vRelYPosIcon)
eC_Value m_vRelXPosIcon
Stores X-Position of icon. This is relative to the control.
Definition: GUIListItem.h:247
void SetIconImages(const ImageResource_t &eIconNormal, const ImageResource_t &eIconSelected)
ImageResource_t m_eIconSelected
The icon image drawn in selected state.
Definition: GUIListItem.h:244
ImageResource_t m_eIconNormal
The icon image drawn in standard state.
Definition: GUIListItem.h:241
CGUIListItem(CGUIListBox *const pkParent, const CGUIRect &kRect, const eC_String &kText, const eC_Bool &bMultiLine=false, const eC_Value &vRelXPosIcon=eC_FromInt(0), const eC_Value &vRelYPosIcon=eC_FromInt(0), const ImageResource_t &eBackgroundImg=DUMMY_IMAGE, const ObjectHandle_t &eID=NO_HANDLE)
virtual void ReadFromStream()
eC_Value m_vRelYPosIcon
Stores Y-Position of icon. This is relative to the control.
Definition: GUIListItem.h:250
CGUIListItem(const CGUIListItem &kSource)
CGUIListItem & operator=(const CGUIListItem &kSource)
CGUIListItem(CGUIListBox *const pkParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const TextResource_t &eTextID, const eC_Bool &bMultiLine=false, const eC_Value &vRelXPosIcon=eC_FromInt(0), const eC_Value &vRelYPosIcon=eC_FromInt(0), const ImageResource_t &eBackgroundImg=DUMMY_IMAGE, const ObjectHandle_t &eID=NO_HANDLE)
void SetSelectedColor(const eC_UInt &uiSelectedColor)
eC_UInt GetSelectedColor() const
Helper class to supply a platform independent rectangle implementation.
Definition: GUIRect.h:63
Represents a simple GUI object containing a text.
Definition: GUITextField.h:83