NvUIValueBar Class Reference

A generic "value bar" element, for progress, time/length, indicators. More...

#include <NvUI.h>

Inheritance diagram for NvUIValueBar:

NvUIElement NvUISlider

List of all members.

Public Member Functions

 NvUIValueBar (NvUIGraphicFrame *emptybar, NvUIGraphicFrame *fullbar, bool useRawBorders=false, bool flipDir=false)
 Default constructor which takes 'empty' and 'full' versions of a visual bar of some sort, overlaid to show it 'filling up'.
virtual ~NvUIValueBar ()
 Default destructor.
virtual void SetDimensions (float w, float h)
 Override to proxy dimensions to inactive bar frame, including auto-border sizing if set.
virtual void SetOrigin (float x, float y)
 Override to proxy origin setting to our frames.
void SetIntegral (bool isint)
 Flag whether we represent integer or floating point values.
bool GetIntegral ()
 Get whether we represent integer or floating point values.
virtual void SetAlpha (float a)
 Override to proxy alpha setting to our frames.
virtual void SetValue (float value)
 Accessor to set current value for the bar.
void SetMaxValue (float value)
 Accessor to set maximum value visualized by the bar.
void SetMinValue (float value)
 Accessor to set minimum value visualized by the bar.
float GetValue ()
 Accessor to get current value for the bar.
float GetMaxValue ()
 Accessor to get maximum value visualized by the bar.
float GetMinValue ()
 Accessor to get minimum value visualized by the bar.
virtual void Draw (const NvUIDrawState &drawState)
 Must override to proxy drawing to our two frames.

Protected Member Functions

void UpdateBar ()
 Update the filled bar sizing based on current/min/max values, and rect of the empty bar.

Protected Attributes

float m_value
 The current value/progress of the bar.
float m_maxValue
 The minimum value/progress of the bar.
float m_minValue
 The maximum value/progress of the bar.
bool m_integral
 Whether or not the bar should snap/round its value to an integer.
bool m_useRawBorders
 leave frame bordering set as passed in, don't try to be smart.
bool m_flipDirection
 Flip x or y axis fill 'direction'.
NvUIGraphicFramem_emptyFrame
 The NvUIGraphicFrame used for empty value/progress background.
NvUIGraphicFramem_fullFrame
 The NvUIGraphicFrame used for the filled value/progress state indication.


Detailed Description

A generic "value bar" element, for progress, time/length, indicators.

Using two NvUIGraphicFrame elements, one for the empty 'background', one for the filled area/value, this class implements a very flexible system for showing various types of bars, thermometers, and progress indicators.

The empty frame can be NULL to have no background, no 'unfilled' visual -- but the best combination is when the unfilled and filled 'bar' graphics are created and used as a pair.

The NvUIValueBar class, once handed NvUIGraphicFrame objects representing the visual form of the bar, handles everything else. It takes min/max values for the bar, the current value, and extracts the proper sizing that the filled bar needs to be set to in order to properly visualize the current value/state.

See also:
NvUIElement

NvUIGraphicFrame

NvUISlider


Constructor & Destructor Documentation

NvUIValueBar::NvUIValueBar ( NvUIGraphicFrame emptybar,
NvUIGraphicFrame fullbar,
bool  useRawBorders = false,
bool  flipDir = false 
)

Default constructor which takes 'empty' and 'full' versions of a visual bar of some sort, overlaid to show it 'filling up'.

Parameters:
emptybar The NvUIGraphicFrame visual for the empty/unfilled bar background
fullbar The NvUIGraphicFrame visual for the filled bar overlay
useRawBorders Whether to try to auto-set borders, or use the raw borders already set on the frame. Defaults to false/auto.
flipDir Whether to reverse the 'fill' direction (normally left->right or top->bottom). Defaults false.


Member Function Documentation

virtual void NvUIValueBar::Draw ( const NvUIDrawState drawState  )  [virtual]

Must override to proxy drawing to our two frames.

Reimplemented from NvUIElement.

Reimplemented in NvUISlider.

bool NvUIValueBar::GetIntegral (  ) 

Get whether we represent integer or floating point values.

float NvUIValueBar::GetMaxValue (  ) 

Accessor to get maximum value visualized by the bar.

float NvUIValueBar::GetMinValue (  ) 

Accessor to get minimum value visualized by the bar.

float NvUIValueBar::GetValue (  ) 

Accessor to get current value for the bar.

virtual void NvUIValueBar::SetAlpha ( float  a  )  [virtual]

Override to proxy alpha setting to our frames.

Reimplemented from NvUIElement.

Reimplemented in NvUISlider.

virtual void NvUIValueBar::SetDimensions ( float  w,
float  h 
) [virtual]

Override to proxy dimensions to inactive bar frame, including auto-border sizing if set.

Reimplemented from NvUIElement.

Reimplemented in NvUISlider.

void NvUIValueBar::SetIntegral ( bool  isint  ) 

Flag whether we represent integer or floating point values.

void NvUIValueBar::SetMaxValue ( float  value  ) 

Accessor to set maximum value visualized by the bar.

void NvUIValueBar::SetMinValue ( float  value  ) 

Accessor to set minimum value visualized by the bar.

virtual void NvUIValueBar::SetOrigin ( float  x,
float  y 
) [virtual]

Override to proxy origin setting to our frames.

Reimplemented from NvUIElement.

Reimplemented in NvUISlider.

virtual void NvUIValueBar::SetValue ( float  value  )  [virtual]

Accessor to set current value for the bar.

Reimplemented in NvUISlider.

void NvUIValueBar::UpdateBar (  )  [protected]

Update the filled bar sizing based on current/min/max values, and rect of the empty bar.


Member Data Documentation

The NvUIGraphicFrame used for empty value/progress background.

Flip x or y axis fill 'direction'.

The NvUIGraphicFrame used for the filled value/progress state indication.

bool NvUIValueBar::m_integral [protected]

Whether or not the bar should snap/round its value to an integer.

float NvUIValueBar::m_maxValue [protected]

The minimum value/progress of the bar.

float NvUIValueBar::m_minValue [protected]

The maximum value/progress of the bar.

leave frame bordering set as passed in, don't try to be smart.

float NvUIValueBar::m_value [protected]

The current value/progress of the bar.


The documentation for this class was generated from the following file: