Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

Gewi::GSlider Class Reference

#include <GewiSlider.h>

Inherits Gewi::GWidget.

Inherited by Gewi::GHorizSlider, and Gewi::GVertSlider.

List of all members.


Detailed Description

Framework for simple slider widget, virtual (fails to overload Show), derived from GWidget.


Public Member Functions

 GSlider (GContainer *parent=NULL)
 Simple constructor for GSlider.

virtual void Create (float x, float y, float width, float height, ResourceID backgroundImg, ResourceID sliderImg, float min, float max, int increment)
 GSlider's create function, must be called to set up actual slider.

void SetPos (float pos)
 Set position of slider.

float GetPos ()
 Get position of slider.


Protected Attributes

bool rPressed
 Boolean value holding if slider is currently 'pressed' or active.

ResourceID rBackground
 ID for background image for slider.

ResourceID rSlider
 Image ID for the sliding part of the slider.

float rMin
 Minimum position for slider.

float rMax
 Maximum position for slider.

float rPos
 Current position of slider.

int rIncrement
 Movement snap increment.


Constructor & Destructor Documentation

Gewi::GSlider::GSlider GContainer parent = NULL  ) 
 

Default constructor for GSlider, can take a parent.

Parameters:
parent Pointer to GContainer derived class to be the parent. Default value is NULL which means no parent.


Member Function Documentation

void Gewi::GSlider::Create float  x,
float  y,
float  width,
float  height,
ResourceID  backgroundImg,
ResourceID  sliderImg,
float  min,
float  max,
int  increment
[virtual]
 

Every widget has a create function which must be called to define the button's appearance and settings.

Parameters:
x X position of widget within it's container (entire screen if no parent)
y Y position of widget within it's container (entire screen if no parent)
width Width of widget.
height Height of widget.
backgroundImg Image for stationary portion of slider.
sliderImg Image for moving portion of slider.
min Minimum value on slider.
max Maximum value on slider.
increment Slider snap-to increment.

void Gewi::GSlider::SetPos float  pos  ) 
 

Sets position of slider, will snap within bounds.

Parameters:
pos Desired position.

float Gewi::GSlider::GetPos  ) 
 

Access current position of slider.

Returns:
Slider position.


The documentation for this class was generated from the following files:
Generated on Fri Aug 1 17:17:30 2003 for Gewi by doxygen1.3