GUI
|
Scrollbar widget. Has a bar and it scrools! More...
#include <Scrollbar.h>
Inherits Widget.
Public Member Functions | |
Scrollbar (GUISystem *guiSystem, int x, int y, int w, int h) | |
virtual | ~Scrollbar () |
void | render (Renderer *renderer) |
void | downButtonClick (Event event) |
void | upButtonClick (Event event) |
void | sliderMouseDown (Event event) |
void | sliderMouseUp (Event event) |
void | sliderMouseMove (Event event) |
void | setSlider (float position) |
void | setSliderLength (float length) |
float | getSliderPosition () |
![]() | |
Widget () | |
Widget (int x, int y, int w, int h) | |
virtual | ~Widget () |
virtual void | keyChar (int uchar) |
virtual void | keyDown (int keyCode) |
virtual void | mouseMove (int x, int y) |
virtual void | stateChange (State state) |
virtual void | focusIn () |
virtual void | focusOut () |
void | addChild (Widget *widget) |
void | removeChild (Widget *widget) |
void | setParent (Widget *widget) |
void | resize (int x, int y, int w, int h) |
void | updateAbs () |
void | setVisibility (bool visible) |
bool | contain (int posX, int posY) |
bool | isFocused () |
State | getState () |
![]() | |
EventEmitter () | |
virtual | ~EventEmitter () |
void | setQueue (AddToQueue addFunction) |
Assings addToQueue function so the events can be sent to the queue. More... | |
EventListener::Id | addEventListener (EventType eventType, EventListener::Function listenerFunc) |
Adds an event listener. More... | |
void | removeEventListener (EventListener::Id listenerId) |
Removes an event listener. More... | |
void | emitEvent (Event event) |
Emitts an event. More... | |
Protected Attributes | |
Color | backgroundColor |
Color | frameColor |
![]() | |
int | x |
int | y |
int | w |
int | h |
int | xAbs |
int | yAbs |
int | state |
bool | focused |
bool | visible |
GUISystem * | guiSystem |
Private Attributes | |
Handle< Button > | upButton |
Handle< Button > | downButton |
Handle< Button > | slideButton |
EventListener::Id | mouseMoveListenerId |
float | sliderPosition |
float | sliderLength |
int | holdPointX |
int | holdPointY |
float | sliderPrevPos |
Friends | |
class | GUISystem |
Additional Inherited Members | |
![]() | |
enum | states { STATE_HOVER, STATE_DOWN, STATE_UP } |
typedef char | State |
![]() | |
typedef std::multimap< EventType, EventListener > | Map |
Scrollbar widget. Has a bar and it scrools!
Definition at line 14 of file Scrollbar.h.
Scrollbar::Scrollbar | ( | GUISystem * | guiSystem, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
Definition at line 6 of file Scrollbar.cpp.
References downButton, downButtonClick(), MOUSE_BUTTON_DOWN, MOUSE_BUTTON_UP, setSlider(), slideButton, sliderMouseDown(), sliderMouseUp(), sliderPosition, upButton, and upButtonClick().
|
virtual |
Definition at line 34 of file Scrollbar.cpp.
void Scrollbar::downButtonClick | ( | Event | event | ) |
Definition at line 48 of file Scrollbar.cpp.
References setSlider(), and sliderPosition.
|
inline |
Definition at line 30 of file Scrollbar.h.
References sliderPosition.
|
virtual |
Reimplemented from Widget.
Definition at line 39 of file Scrollbar.cpp.
References backgroundColor, Renderer::drawFilledRect(), Renderer::drawRect(), frameColor, Widget::h, Renderer::setTarget(), Widget::w, Widget::x, Widget::xAbs, Widget::y, and Widget::yAbs.
void Scrollbar::setSlider | ( | float | position | ) |
Definition at line 105 of file Scrollbar.cpp.
References Widget::h, slideButton, sliderLength, sliderPosition, Widget::w, and Widget::y.
void Scrollbar::setSliderLength | ( | float | length | ) |
Definition at line 114 of file Scrollbar.cpp.
References setSlider(), sliderLength, and sliderPosition.
void Scrollbar::sliderMouseDown | ( | Event | event | ) |
Definition at line 58 of file Scrollbar.cpp.
References Event::getEventObject(), holdPointX, holdPointY, MOUSE_BUTTON_DOWN, MOUSE_MOVE, mouseMoveListenerId, slideButton, sliderMouseMove(), sliderPosition, sliderPrevPos, and Event::type.
void Scrollbar::sliderMouseMove | ( | Event | event | ) |
Definition at line 90 of file Scrollbar.cpp.
References Event::getEventObject(), Widget::h, holdPointX, holdPointY, MOUSE_MOVE, setSlider(), sliderLength, sliderPrevPos, Event::type, Widget::x, and Widget::y.
void Scrollbar::sliderMouseUp | ( | Event | event | ) |
Definition at line 76 of file Scrollbar.cpp.
References Event::getEventObject(), MOUSE_BUTTON_UP, mouseMoveListenerId, slideButton, and Event::type.
void Scrollbar::upButtonClick | ( | Event | event | ) |
Definition at line 53 of file Scrollbar.cpp.
References setSlider(), and sliderPosition.
|
friend |
Definition at line 49 of file Scrollbar.h.
|
protected |
Definition at line 33 of file Scrollbar.h.
|
private |
Definition at line 38 of file Scrollbar.h.
|
protected |
Definition at line 34 of file Scrollbar.h.
|
private |
Definition at line 45 of file Scrollbar.h.
|
private |
Definition at line 46 of file Scrollbar.h.
|
private |
Definition at line 41 of file Scrollbar.h.
|
private |
Definition at line 39 of file Scrollbar.h.
|
private |
Definition at line 44 of file Scrollbar.h.
|
private |
Definition at line 43 of file Scrollbar.h.
|
private |
Definition at line 47 of file Scrollbar.h.
|
private |
Definition at line 37 of file Scrollbar.h.