cWidget::VerticalBarGauge Class Reference

Renders a vertical bar gauge. More...

#include <cGauges.h>

Inheritance diagram for cWidget::VerticalBarGauge:

Inheritance graph
[legend]
Collaboration diagram for cWidget::VerticalBarGauge:

Collaboration graph
[legend]

List of all members.

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).


Detailed Description

Renders a vertical bar gauge.

Definition at line 55 of file cGauges.h.


Constructor & Destructor Documentation

virtual cWidget::VerticalBarGauge::~VerticalBarGauge (  )  [inline, virtual]

Definition at line 57 of file cGauges.h.

00057 { }; 


Member Function Documentation

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 }

Here is the call graph for this function:

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 }

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Sun Mar 16 00:03:45 2008 for Armagetron Advanced by  doxygen 1.5.4