Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Slider Class Reference

Inheritance diagram for Slider:

Inheritance graph
[legend]
Collaboration diagram for Slider:

Collaboration graph
[legend]

Detailed Description

Slider for option value.

Definition at line 9 of file Slider.h.

Public Member Functions

 Slider (const std::string &param, int minValue=0, int maxValue=100)
 Create slider for this param and optinaly specify min and max value.
virtual int getW () const
virtual int getH () const
virtual void drawOn (SDL_Surface *screen)


Constructor & Destructor Documentation

Slider::Slider const std::string &  param,
int  minValue = 0,
int  maxValue = 100
 

Create slider for this param and optinaly specify min and max value.

Definition at line 20 of file Slider.cpp.

00021     : m_param(param)
00022 {
00023     m_min = minValue;
00024     m_max = maxValue;
00025 }


Member Function Documentation

void Slider::drawOn SDL_Surface *  screen  )  [virtual]
 

Implements Drawable.

Definition at line 53 of file Slider.cpp.

00054 {
00055     int value = OptionAgent::agent()->getAsInt(m_param);
00056     SDL_Color gray = {0x00, 0x00, 0x00, 128};
00057     Uint32 green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00);
00058 
00059     SDL_Rect rect;
00060     rect.x = m_shift.getX();
00061     rect.y = m_shift.getY();
00062     rect.w = getW();
00063     rect.h = getH();
00064     SurfaceTool::alphaFill(screen, &rect, gray);
00065 
00066     rect.x = m_shift.getX();
00067     rect.y = m_shift.getY();
00068     rect.w = value2slide(value);
00069     rect.h = getH();
00070     SDL_FillRect(screen, &rect, green);
00071 }

virtual int Slider::getH  )  const [inline, virtual]
 

Implements IWidget.

Definition at line 23 of file Slider.h.

00023 { return HEIGHT; }

virtual int Slider::getW  )  const [inline, virtual]
 

Implements IWidget.

Definition at line 22 of file Slider.h.

00022 { return (m_max - m_min) * PIXELS_PER_VALUE; }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:56:51 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2