ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
Public Member Functions | Protected Attributes | List of all members
List Class Reference

A list that can hold several ListItem s. More...

#include <list.h>

Inheritance diagram for List:
Widget FileList

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...
 
ListItemselected () 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 Widgetparent () 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 Rectrect () const
 
const Rectcanvasrect () const
 

Protected Attributes

Sint8 mSpeed
 
Uint8 mMotion
 
Uint16 mPosH
 
GuimGui
 
Clock mClock
 
Color mTmpColor
 
std::list< ListItem * >::iterator mSelected
 
- Protected Attributes inherited from Widget
CanvasmCanvas
 
WidgetmParent
 
Rect mRect
 
Rect mCanvasRect
 
Color mColor
 
bool mEnabled
 
bool mMouseOver
 
bool mMouseGrab
 
bool mWantEvents
 

Detailed Description

A list that can hold several ListItem s.

Constructor & Destructor Documentation

List ( Gui gui)
inline
virtual ~List ( )
virtual

Deafault destructor.

Init the List

Referenced by List::List().

Member Function Documentation

void add ( ListItem item)
void draw ( )
bool onKeyboard ( SDL_KeyboardEvent *  event)
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().

void onMouseButton ( SDL_MouseButtonEvent *  event)
virtual

This member catches mousebutton events.

Reimplemented from Widget.

References Widget::mEnabled, List::mMotion, and List::mSpeed.

Referenced by List::List().

bool onUser ( SDL_UserEvent *  event)
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)
ListItem* selected ( ) const
inline

Returns a pointer to the selected Item.

References List::add(), List::draw(), List::mSelected, and List::reposition().

Referenced by List::onUser().

Member Data Documentation

Clock mClock
protected
Gui* mGui
protected

Referenced by List::add(), and FileList::FileList().

Uint8 mMotion
protected
Uint16 mPosH
protected

Referenced by List::add().

std::list<ListItem*>::iterator mSelected
protected
Sint8 mSpeed
protected
Color mTmpColor
protected

The documentation for this class was generated from the following files: