Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
#include <slider.h>
Public Member Functions | |
void | setMaxMin (int max, int min=0) |
void | setThumbLength (float len) |
void | setPageSize (int s) |
int | position (void) |
void | setPosition (int pos) |
void | setThumbColor (const GFXColor &color, const GFXColor &outline) |
void | setThumbColorBasedOnColor (const GFXColor &c) |
virtual void | draw (void) |
virtual void | setRect (const Rect &r) |
virtual void | setColor (const GFXColor &c) |
virtual bool | processMouseDown (const InputEvent &event) |
virtual bool | processMouseUp (const InputEvent &event) |
virtual bool | processMouseDrag (const InputEvent &event) |
Slider (void) | |
virtual | ~Slider (void) |
![]() | |
virtual Rect | rect (void) |
virtual bool | hitTest (const Point &p) |
virtual bool | hidden (void) |
virtual void | setHidden (bool h=true) |
virtual const std::string & | id (void) |
virtual void | setId (const std::string &newId) |
virtual GFXColor | color (void) |
virtual GFXColor | outlineColor (void) |
virtual void | setOutlineColor (const GFXColor &c) |
virtual GFXColor | textColor (void) |
virtual void | setTextColor (const GFXColor &c) |
virtual Font | font (void) |
virtual void | setFont (const Font &f) |
virtual bool | hasGroupChildren (void) |
Control (void) | |
virtual | ~Control (void) |
![]() | |
virtual bool | processCommand (const EventCommandId &command, Control *control) |
virtual bool | processKeyDown (const InputEvent &event) |
virtual bool | processKeyUp (const InputEvent &event) |
virtual void | processUnfocus (const InputEvent &event) |
virtual bool | processMouseMove (const InputEvent &event) |
virtual void | sendCommand (const EventCommandId &command, Control *control) |
virtual void | setCommandTarget (EventResponder *responder) |
virtual void | setModal (bool modal) |
EventResponder (void) | |
virtual | ~EventResponder (void) |
Protected Types | |
enum | MouseState { MOUSE_NONE, MOUSE_PAGE_UP, MOUSE_PAGE_DOWN, MOUSE_THUMB_DRAG } |
Protected Attributes | |
int | m_minValue |
int | m_maxValue |
float | m_thumbLength |
float | m_originalThumbLength |
int | m_pageSize |
GFXColor | m_thumbColor |
GFXColor | m_thumbOutlineColor |
int | m_position |
bool | m_vertical |
MouseState | m_mouseState |
float | m_buttonDownMouse |
int | m_buttonDownPosition |
Rect | m_thumbRect |
![]() | |
Rect | m_rect |
std::string | m_id |
GFXColor | m_color |
GFXColor | m_outlineColor |
GFXColor | m_textColor |
Font | m_font |
bool | m_hidden |
![]() | |
bool | m_modal |
EventResponder * | m_commandTarget |
Additional Inherited Members | |
![]() | |
virtual void | drawBackground (void) |
|
protected |
Slider::Slider | ( | void | ) |
Definition at line 289 of file slider.cpp.
|
virtual |
Implements Control.
Definition at line 156 of file slider.cpp.
References Control::drawBackground(), drawRect(), drawRectOutline(), float, Size::height, Rect::inset(), isClear(), m_maxValue, m_minValue, m_position, Control::m_rect, m_thumbColor, m_thumbLength, m_thumbOutlineColor, m_thumbRect, m_vertical, Rect::origin, Rect::size, Size::width, Point::x, and Point::y.
|
inline |
Definition at line 48 of file slider.h.
References m_position.
Referenced by Scroller::processCommand(), processMouseDown(), and processMouseUp().
|
virtual |
Reimplemented from EventResponder.
Definition at line 182 of file slider.cpp.
References InputEvent::code, VegaConfig::getVariable(), globalEventManager(), Control::hitTest(), LEFT_MOUSE_BUTTON, InputEvent::loc, m_buttonDownMouse, m_buttonDownPosition, m_mouseState, m_position, m_thumbLength, m_thumbRect, m_vertical, MOUSE_PAGE_DOWN, MOUSE_PAGE_UP, MOUSE_THUMB_DRAG, NO_THUMB_LENGTH, Rect::origin, XMLSupport::parse_int(), position(), EventResponder::processMouseDown(), EventManager::pushResponder(), Rect::right(), EventResponder::setModal(), setPosition(), Rect::top(), vs_config, WHEELDOWN_MOUSE_BUTTON, WHEELUP_MOUSE_BUTTON, Point::x, and Point::y.
|
virtual |
Reimplemented from EventResponder.
Definition at line 221 of file slider.cpp.
References Rect::copyAndInset(), float_to_int(), Size::height, Rect::inside(), InputEvent::loc, m_buttonDownMouse, m_buttonDownPosition, m_maxValue, m_minValue, m_mouseState, Control::m_rect, m_thumbLength, m_vertical, MOUSE_THUMB_DRAG, NO_THUMB_LENGTH, EventResponder::processMouseDrag(), setPosition(), Rect::size, Size::width, Point::x, and Point::y.
|
virtual |
Reimplemented from EventResponder.
Definition at line 257 of file slider.cpp.
References InputEvent::code, globalEventManager(), Control::hitTest(), LEFT_MOUSE_BUTTON, InputEvent::loc, m_mouseState, m_pageSize, MOUSE_NONE, MOUSE_PAGE_DOWN, MOUSE_PAGE_UP, MOUSE_THUMB_DRAG, position(), EventResponder::processMouseUp(), EventManager::removeResponder(), EventResponder::setModal(), and setPosition().
|
virtual |
Reimplemented from Control.
Definition at line 147 of file slider.cpp.
References Control::setColor(), and setThumbColorBasedOnColor().
Referenced by Scroller::createControls().
Definition at line 65 of file slider.cpp.
References float_to_int(), m_maxValue, m_minValue, max(), min(), and setPageSize().
Referenced by Scroller::setRangeValues().
|
inline |
Definition at line 41 of file slider.h.
References m_pageSize.
Referenced by setMaxMin(), and Scroller::setRangeValues().
void Slider::setPosition | ( | int | pos) |
Definition at line 51 of file slider.cpp.
References m_maxValue, m_minValue, m_position, and EventResponder::sendCommand().
Referenced by processMouseDown(), processMouseDrag(), processMouseUp(), and Scroller::setScrollPosition().
|
virtual |
Reimplemented from Control.
Definition at line 94 of file slider.cpp.
References Size::height, m_originalThumbLength, Control::m_rect, m_vertical, Control::setRect(), setThumbLength(), Rect::size, and Size::width.
Definition at line 55 of file slider.h.
References Control::color(), m_thumbColor, and m_thumbOutlineColor.
Referenced by Scroller::setThumbColor(), and setThumbColorBasedOnColor().
void Slider::setThumbColorBasedOnColor | ( | const GFXColor & | c) |
Definition at line 134 of file slider.cpp.
References darkenColor(), GUI_OPAQUE_WHITE(), isClear(), isColorLight(), lightenColor(), and setThumbColor().
Referenced by Scroller::createControls(), setColor(), and Scroller::setColor().
void Slider::setThumbLength | ( | float | len) |
Definition at line 76 of file slider.cpp.
References ABSOLUTE_MIN_THUMB_LENGTH, Size::height, m_originalThumbLength, Control::m_rect, m_thumbLength, m_vertical, MAX_THUMB_LENGTH, MIN_THUMB_LENGTH, NO_THUMB_LENGTH, Rect::size, and Size::width.
Referenced by Scroller::setRangeValues(), and setRect().
|
protected |
Definition at line 101 of file slider.h.
Referenced by processMouseDown(), and processMouseDrag().
|
protected |
Definition at line 102 of file slider.h.
Referenced by processMouseDown(), and processMouseDrag().
|
protected |
Definition at line 91 of file slider.h.
Referenced by draw(), processMouseDrag(), setMaxMin(), and setPosition().
|
protected |
Definition at line 90 of file slider.h.
Referenced by draw(), processMouseDrag(), setMaxMin(), and setPosition().
|
protected |
Definition at line 100 of file slider.h.
Referenced by processMouseDown(), processMouseDrag(), and processMouseUp().
|
protected |
Definition at line 93 of file slider.h.
Referenced by setRect(), and setThumbLength().
|
protected |
Definition at line 94 of file slider.h.
Referenced by processMouseUp(), and setPageSize().
|
protected |
Definition at line 98 of file slider.h.
Referenced by draw(), position(), processMouseDown(), and setPosition().
|
protected |
Definition at line 95 of file slider.h.
Referenced by draw(), and setThumbColor().
|
protected |
Definition at line 92 of file slider.h.
Referenced by draw(), processMouseDown(), processMouseDrag(), and setThumbLength().
|
protected |
Definition at line 96 of file slider.h.
Referenced by draw(), and setThumbColor().
|
protected |
Definition at line 103 of file slider.h.
Referenced by draw(), and processMouseDown().
|
protected |
Definition at line 99 of file slider.h.
Referenced by draw(), processMouseDown(), processMouseDrag(), setRect(), and setThumbLength().