ROLAND
0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
|
A list that can hold several ListItem s. More...
#include <list.h>
Public Member Functions | |
List (Gui *gui) | |
Some initialization. More... | |
virtual | ~List () ROLAND_DEFAULT void init() |
Deafault destructor. More... | |
virtual void | onMouseButton (SDL_MouseButtonEvent *event) |
This member catches mousebutton events. More... | |
virtual bool | onKeyboard (SDL_KeyboardEvent *event) |
This member catches keyboard events. More... | |
virtual bool | onUser (SDL_UserEvent *event) |
Tis member catches user events. More... | |
ListItem * | selected () const |
Returns a pointer to the selected Item. More... | |
void | add (ListItem *item) |
Adds a ListItem to the List. More... | |
void | reposition (Sint16 val) |
Manages the scrolling. More... | |
void | draw () |
Draw the List and visible elements. More... | |
Public Member Functions inherited from Widget | |
Widget (Canvas *const canvas) | |
Constructor with Canvas. More... | |
Widget (Widget *const parent=nullptr) | |
Constructor with parent Widget. More... | |
virtual | ~Widget () ROLAND_DEFAULT virtual void draw()=0 |
Standarddestructor. More... | |
virtual void | onMouseMotion (SDL_MouseMotionEvent *event) |
Catch MouseMotion events. More... | |
virtual void | setPos (int x, int y) |
Sets the Position. More... | |
virtual void | setSize (int width, int height) |
Sets the Size. More... | |
virtual void | setCanvas (Canvas *const canvas) |
Sets the Canvas to draw on. More... | |
void | setParent (Widget *const parent) |
Sets the parent Widget. More... | |
const Widget * | parent () const |
Returns the parent. More... | |
void | setColor (const Color &color) |
Sets the Color of the Widget by Color. More... | |
void | setColor (int r, int g, int b, int a=255) |
Sets the Color of the Widget by RGB(A) More... | |
Color | color () const |
Returns the Color of the Widget. More... | |
void | setEnabled (bool val) |
Set Widget enabled. More... | |
void | setWantEvents (bool val) |
Sets whether to catch Events. More... | |
void | setMouseOver (bool val) |
Sets whehther to catch MouseOver. More... | |
bool | enabled () const |
Returns whether the Widget is enabled. More... | |
bool | wantEvents () const |
Returns whether the Widget wants Events. More... | |
bool | mouseOver () const |
Returns whether the Widget receives MouseOver. More... | |
bool | hasMouseGrab () const |
Returns whether the Widget has MouseGrab. More... | |
Sint16 | x () const |
Returns the x position of the upper left corner. More... | |
Sint16 | y () const |
Returns the y position of the upper left corner. More... | |
Point | pos () const |
Returns the position of the upper left corner. More... | |
Uint16 | width () const |
Returns the width of the Widget. More... | |
Uint16 | height () const |
Returns the height of the Widget. More... | |
Size | size () const |
Returns the Size of the Widget. More... | |
Point | relativePos (Sint16 x, Sint16 y) const |
void | relativePos (Sint16 x, Sint16 y, Point &target) const |
const Rect & | rect () const |
const Rect & | canvasrect () const |
Protected Attributes | |
Sint8 | mSpeed |
Uint8 | mMotion |
Uint16 | mPosH |
Gui * | mGui |
Clock | mClock |
Color | mTmpColor |
std::list< ListItem * >::iterator | mSelected |
Protected Attributes inherited from Widget | |
Canvas * | mCanvas |
Widget * | mParent |
Rect | mRect |
Rect | mCanvasRect |
Color | mColor |
bool | mEnabled |
bool | mMouseOver |
bool | mMouseGrab |
bool | mWantEvents |
A list that can hold several ListItem s.
Some initialization.
References init(), List::onKeyboard(), List::onMouseButton(), List::onUser(), ROLAND_DEFAULT, and List::~List().
|
virtual |
void add | ( | ListItem * | item | ) |
References Gui::add(), Widget::height(), List::mGui, List::mPosH, Widget::mRect, List::mSelected, List::mTmpColor, Label::setBorder(), Widget::setParent(), Label::setPos(), Rect::setWidth(), Widget::width(), Widget::x(), and Widget::y().
Referenced by FileList::FileList(), and List::selected().
void draw | ( | ) |
Draw the List and visible elements.
References Canvas::clearClipRect(), Canvas::end(), Widget::height(), Widget::mCanvas, Widget::mColor, Widget::mEnabled, List::mMotion, Widget::mRect, List::mSpeed, Canvas::rect(), List::reposition(), Canvas::setClipRect(), and Canvas::setColor().
Referenced by List::selected().
|
virtual |
This member catches keyboard events.
Reimplemented from Widget.
Reimplemented in FileList.
References init(), List::mClock, Widget::mEnabled, List::mMotion, List::mSelected, List::mSpeed, and List::mTmpColor.
Referenced by List::List(), and FileList::onKeyboard().
|
virtual |
This member catches mousebutton events.
Reimplemented from Widget.
References Widget::mEnabled, List::mMotion, and List::mSpeed.
Referenced by List::List().
|
virtual |
Tis member catches user events.
Reimplemented from Widget.
References IOUT, sdltk::ListItemClicked, sdltk::ListItemDoubleClicked, Widget::mEnabled, List::mSelected, List::mTmpColor, and List::selected().
Referenced by List::List().
void reposition | ( | Sint16 | val | ) |
Manages the scrolling.
References Clock::elapsed(), Widget::height(), Rect::inside(), List::mClock, Widget::mEnabled, List::mMotion, Widget::mRect, List::mSelected, List::mSpeed, List::mTmpColor, Rect::setHeight(), Rect::setY(), and Widget::y().
Referenced by List::draw(), and List::selected().
|
inline |
Returns a pointer to the selected Item.
References List::add(), List::draw(), List::mSelected, and List::reposition().
Referenced by List::onUser().
|
protected |
Referenced by List::onKeyboard(), and List::reposition().
|
protected |
Referenced by List::add(), and FileList::FileList().
|
protected |
Referenced by List::draw(), List::onKeyboard(), List::onMouseButton(), and List::reposition().
|
protected |
Referenced by List::add().
|
protected |
Referenced by List::add(), List::onKeyboard(), List::onUser(), List::reposition(), and List::selected().
|
protected |
Referenced by List::draw(), List::onKeyboard(), List::onMouseButton(), and List::reposition().
|
protected |
Referenced by List::add(), List::onKeyboard(), List::onUser(), and List::reposition().