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

#include <button.h>

Inheritance diagram for Button:
Label Widget ListItem FileListItem

Public Member Functions

 Button ()
 
virtual ~Button () ROLAND_DEFAULT virtual void draw()
 
virtual void onMouseMotion (SDL_MouseMotionEvent *event)
 Catch MouseMotion events. More...
 
virtual void onMouseButton (SDL_MouseButtonEvent *event)
 Catch MouseButton events. More...
 
void setHighlightColor (const Color &color)
 
bool isDown () const
 
void setDown (bool down)
 
- Public Member Functions inherited from Label
 Label (Widget *parent=nullptr)
 
virtual ~Label ()
 
virtual void draw ()
 
virtual void setPos (int x, int y)
 Sets the Position. More...
 
void setImage (const String &fname, bool autosize=true, bool bg=false)
 
void setBorder (bool val)
 
void setBackground (bool val)
 
void setText (const String &text)
 
void setMoveable (bool moveable)
 
void setBorderColor (const Color &color, const Color &highlite)
 
const StringgetText () const
 
- 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 bool onKeyboard (SDL_KeyboardEvent *event)
 Catch Keyboard events. More...
 
virtual bool onUser (SDL_UserEvent *event)
 Catch UserEvents. 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

Color mHighlightColor
 
bool mDown
 
- Protected Attributes inherited from Label
bool mBorder
 
bool mBackground
 
bool mMoveable
 
ImagemImage
 
String mText
 
Point mTextPos
 
Point mTextOffset
 
Point mRelativeMousePos
 
Point mLeftTop
 
Point mRightTop
 
Point mRightBottom
 
Point mLeftBottom
 
Color mBorderColor1
 
Color mBorderColor2
 
- Protected Attributes inherited from Widget
CanvasmCanvas
 
WidgetmParent
 
Rect mRect
 
Rect mCanvasRect
 
Color mColor
 
bool mEnabled
 
bool mMouseOver
 
bool mMouseGrab
 
bool mWantEvents
 

Additional Inherited Members

- Protected Member Functions inherited from Label
void drawBorder ()
 
void drawBackground ()
 
void drawBackground (const Color &color)
 
void drawText ()
 
void moveInit (SDL_MouseButtonEvent *event)
 
void move (SDL_MouseMotionEvent *event)
 

Detailed Description

Author
Fred Klaus devel.nosp@m.opme.nosp@m.nt@fk.nosp@m.web..nosp@m.de

Constructor & Destructor Documentation

Button ( )
virtual ~Button ( )
virtual

Member Function Documentation

bool isDown ( ) const
inline

References Button::mDown.

Referenced by mainloop().

void onMouseButton ( SDL_MouseButtonEvent *  event)
virtual
void onMouseMotion ( SDL_MouseMotionEvent *  event)
virtual

Catch MouseMotion events.

Reimplemented from Label.

References Label::move().

void setDown ( bool  down)
inline

References Button::mDown.

void setHighlightColor ( const Color color)
inline

Member Data Documentation

bool mDown
protected
Color mHighlightColor
protected

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