#include <cGauges.h>
Public Member Functions | |
virtual | ~VerticalBarGauge () |
Protected Member Functions | |
virtual void | RenderGraph (float min, float max, float val, float factor, tValue::Base const &val_s) |
Do- nothing destructor. | |
void | RenderCaption (void) |
Renders the caption (if enabled). |
Definition at line 55 of file cGauges.h.
virtual cWidget::VerticalBarGauge::~VerticalBarGauge | ( | ) | [inline, virtual] |
void cWidget::VerticalBarGauge::RenderGraph | ( | float | min, | |
float | max, | |||
float | val, | |||
float | factor, | |||
tValue::Base const & | val_s | |||
) | [protected, virtual] |
Do- nothing destructor.
Renders the Background, bar and current value (if enabled)
Reimplemented from cWidget::BarGauge.
Definition at line 151 of file cGauges.cpp.
References rGradient::BeginDraw(), BeginLines(), DisplayText(), rGradient::DrawPoint(), rGradient::DrawRect(), vValue::Expr::Core::Base::GetString(), cWidget::WithBackground::m_background, cWidget::WithForeground::m_foreground, cWidget::WithLineColor::m_line_color, cWidget::WithCoordinates::m_position, cWidget::WithShowSettings::m_showvalue, cWidget::WithCoordinates::m_size, RenderEnd(), rGradient::SetGradientEdges(), rGradient::SetValue(), sr_fontCockpit, tCoord::x, x, and tCoord::y.
00151 { 00152 float x= factor * ((val-min)/(max-min)*2. - 1.); 00153 float y= (x+1.)/2.; 00154 00155 const tCoord edge1(tCoord(m_position.x-m_size.x, m_position.y-m_size.y)); 00156 const tCoord edge2(tCoord(m_position.x+m_size.x, m_position.y+m_size.y)); 00157 00158 m_foreground.SetGradientEdges(edge1, edge2); 00159 m_background.SetGradientEdges(edge1, edge2); 00160 m_line_color.SetGradientEdges(edge1, edge2); 00161 00162 m_foreground.SetValue(y); 00163 m_background.SetValue(y); 00164 m_line_color.SetValue(y); 00165 00166 m_background.DrawRect( 00167 tCoord(m_position.x+m_size.x, m_position.y+m_size.y*x), 00168 tCoord(m_position.x-m_size.x, m_position.y+m_size.y)); 00169 00170 m_foreground.DrawRect( 00171 tCoord(m_position.x+m_size.x, m_position.y-m_size.y), 00172 tCoord(m_position.x-m_size.x, m_position.y+m_size.y*x)); 00173 00174 m_line_color.BeginDraw(); 00175 BeginLines(); 00176 m_line_color.DrawPoint(tCoord(m_position.x+m_size.x,m_position.y+m_size.y*x)); 00177 m_line_color.DrawPoint(tCoord(m_position.x-m_size.x,m_position.y+m_size.y*x)); 00178 RenderEnd(); 00179 00180 //Value 00181 if(m_showvalue) 00182 DisplayText( m_position.x, m_position.y, .05*m_size.y, (val_s.GetString()).c_str(), sr_fontCockpit); 00183 }
void cWidget::VerticalBarGauge::RenderCaption | ( | void | ) | [protected, virtual] |
Renders the caption (if enabled).
Reimplemented from cWidget::BarGauge.
Definition at line 75 of file cGauges.cpp.
References DisplayText(), cWidget::WithCaption::m_caption, cWidget::WithCaption::m_captionloc, cWidget::WithCoordinates::m_position, cWidget::WithCoordinates::m_size, cWidget::WithCaption::off, sr_fontCockpit, cWidget::WithCaption::top, tCoord::x, and tCoord::y.
00075 { 00076 if ( m_captionloc != off ) { 00077 const float y= 00078 (m_captionloc==top ? 00079 m_position.y+1.2*m_size.y : 00080 m_position.y-1.2*m_size.y); 00081 DisplayText(m_position.x,y,.24*m_size.y,m_caption.c_str(),sr_fontCockpit); 00082 } 00083 }