Guiliani  Version 2.6 revision 7293 (documentation build 12)
GUILayouterAnchor.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 GUILAYOUTERANCHOR__H_
11#define GUILAYOUTERANCHOR__H_
12
13#include "GUILayouter.h"
14class CGUIObject;
15
17
87{
88public:
89
91 enum Anchors_t {
92 ANCHOR_TOP = 0x0001,
93 ANCHOR_BOTTOM = 0x0002,
94 ANCHOR_LEFT = 0x0004,
95 ANCHOR_RIGHT = 0x0008
96 };
97
101 CGUILayouterAnchor(CGUIObject * const pkObject = NULL);
102
105
106 virtual eC_Bool IsDependentOnParentSize() {return true;}
107
116 const eC_Bool &bTop, const eC_Bool &bBottom, const eC_Bool &bLeft, const eC_Bool &bRight);
117
122 void SetAnchors(const eC_UByte &ubAnchors);
123
134 virtual void InitLayouter(eMovedEdges_t eMovedEdges);
135
139 inline eC_Bool IsAnchorSet(const Anchors_t eAnchor) const
140 {
141 return (m_ubAnchors & eAnchor)!=0;
142 };
143
144 virtual void DoLayout(eMovedEdges_t eMovedEdges);
145
146#if defined(GUILIANI_STREAM_GUI) || defined(GUILIANI_WRITE_GUI)
147 static const eC_UInt LAYOUTER_ANCHOR_CLASS_VERSION;
148#endif
149
150#ifdef GUILIANI_STREAM_GUI
151 virtual void ReadFromStream();
152#endif
153
154#ifdef GUILIANI_WRITE_GUI
155 virtual void WriteToStream(const eC_Bool bWriteClassID=false);
156#endif
157
158private:
159
161 inline void Init();
162
163 // Helper attributes required for layouting
164 eC_Value m_vDistanceBottom;
165 eC_Value m_vDistanceRight;
166
167 // Scaling factors in vertical and horizontal direction
168 eC_Value m_vXFactor;
169 eC_Value m_vYFactor;
170
171 // Member to store the state of all four anchors
172 eC_UByte m_ubAnchors;
173};
174
175#endif
This is a layouter, which implements the "anchor"-concept.
Definition: GUILayouterAnchor.h:87
static const eC_UInt LAYOUTER_ANCHOR_CLASS_VERSION
Class version of anchor layouter class.
Definition: GUILayouterAnchor.h:147
void SetAnchors(const eC_UByte &ubAnchors)
virtual void WriteToStream(const eC_Bool bWriteClassID=false)
virtual eC_Bool IsDependentOnParentSize()
Definition: GUILayouterAnchor.h:106
CGUILayouterAnchor(CGUIObject *const pkObject=NULL)
void SetAnchors(const eC_Bool &bTop, const eC_Bool &bBottom, const eC_Bool &bLeft, const eC_Bool &bRight)
virtual void DoLayout(eMovedEdges_t eMovedEdges)
Anchors_t
Enumeration for anchors to all four sides of an object.
Definition: GUILayouterAnchor.h:91
virtual void InitLayouter(eMovedEdges_t eMovedEdges)
~CGUILayouterAnchor()
Destructs an Anchor-Layouter.
Definition: GUILayouterAnchor.h:104
eC_Bool IsAnchorSet(const Anchors_t eAnchor) const
Definition: GUILayouterAnchor.h:139
virtual void ReadFromStream()
Definition: GUILayouter.h:57
eMovedEdges_t
Enumerate possible reasons for calling layout,.
Definition: GUILayouter.h:61
This is the Guiliani base class all controls are derived from.
Definition: GUIObject.h:81