#include <cWidgetBase.h>
Public Member Functions | |
WithCoordinates () | |
Default constructor. | |
bool | Process (tXmlParser::node cur) |
This function will parse Size and Position nodes. | |
void | SetFactor (float factor) |
multiply all y- coordinates by a value | |
Protected Attributes | |
tCoord | m_position |
The x- and y- coordinates of the widget. | |
tCoord | m_size |
The size as width and height. | |
Private Attributes | |
tCoord | m_originalPosition |
The position without any transformations applied. | |
tCoord | m_originalSize |
The size without any transformations applied. |
Definition at line 102 of file cWidgetBase.h.
cWidget::WithCoordinates::WithCoordinates | ( | ) |
Default constructor.
Definition at line 62 of file cWidgetBase.cpp.
00062 : m_originalPosition(0,0), m_originalSize(1,1), m_position(0,0), m_size(1,1) 00063 {}
bool cWidget::WithCoordinates::Process | ( | tXmlParser::node | cur | ) | [virtual] |
This function will parse Size and Position nodes.
Reimplemented from cWidget::Base.
Reimplemented in cWidget::BarGauge, cWidget::Label, cWidget::Map, and cWidget::Rectangle.
Definition at line 65 of file cWidgetBase.cpp.
References m_originalPosition, m_originalSize, m_position, m_size, cWidget::Base::Process(), tCoord::x, and tCoord::y.
Referenced by cWidget::Rectangle::Process(), cWidget::Map::Process(), cWidget::Label::Process(), and cWidget::BarGauge::Process().
00065 { 00066 if(cur.IsOfType("Position")) { 00067 tCoord shift; 00068 cur.GetProp("x", shift.x); 00069 cur.GetProp("y", shift.y); 00070 m_position += shift; 00071 m_originalPosition = m_position; 00072 return true; 00073 } 00074 if(cur.IsOfType("Size")) { 00075 tCoord factor; 00076 cur.GetProp("width", factor.x); 00077 cur.GetProp("height", factor.y); 00078 m_size *= factor; 00079 m_originalSize = m_size; 00080 return true; 00081 } 00082 return Base::Process(cur); 00083 }
void cWidget::WithCoordinates::SetFactor | ( | float | factor | ) |
multiply all y- coordinates by a value
Definition at line 86 of file cWidgetBase.cpp.
References m_originalPosition, m_originalSize, m_position, m_size, and tCoord::y.
00086 { 00087 m_position.y = (m_originalPosition.y + 1.) * factor - 1.; 00088 m_size.y = m_originalSize.y * factor; 00089 }
The position without any transformations applied.
Definition at line 103 of file cWidgetBase.h.
Referenced by Process(), and SetFactor().
The size without any transformations applied.
Definition at line 104 of file cWidgetBase.h.
Referenced by Process(), and SetFactor().
tCoord cWidget::WithCoordinates::m_position [protected] |
The x- and y- coordinates of the widget.
Definition at line 106 of file cWidgetBase.h.
Referenced by Process(), cWidget::Rectangle::Render(), cWidget::Map::Render(), cWidget::Label::Render(), cWidget::VerticalBarGauge::RenderCaption(), cWidget::BarGauge::RenderCaption(), cWidget::NeedleGauge::RenderGraph(), cWidget::VerticalBarGauge::RenderGraph(), cWidget::BarGauge::RenderGraph(), cWidget::BarGauge::RenderMinMax(), and SetFactor().
tCoord cWidget::WithCoordinates::m_size [protected] |
The size as width and height.
Definition at line 107 of file cWidgetBase.h.
Referenced by Process(), cWidget::Rectangle::Render(), cWidget::Map::Render(), cWidget::Label::Render(), cWidget::VerticalBarGauge::RenderCaption(), cWidget::BarGauge::RenderCaption(), cWidget::NeedleGauge::RenderGraph(), cWidget::VerticalBarGauge::RenderGraph(), cWidget::BarGauge::RenderGraph(), cWidget::BarGauge::RenderMinMax(), and SetFactor().