Definition at line 9 of file Slider.h.
Public Member Functions | |
Slider (const std::string ¶m, 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) |
|
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 }
|
|
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 }
|
|
Implements IWidget. Definition at line 23 of file Slider.h. 00023 { return HEIGHT; }
|
|
Implements IWidget. Definition at line 22 of file Slider.h. 00022 { return (m_max - m_min) * PIXELS_PER_VALUE; }
|