TextButton Class Reference
[2D Graphical User Inteface]

Text Button Class

This class create a button with a text. More...

#include <Button.hh>

Inheritance diagram for TextButton:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 TextButton (const uint x, const uint y, const uint w, const uint h, SDL_Surface *screen, Widget *father, const string txt, const ushort action=CLOSE)
 TextButton (const uint w, const uint h, SDL_Surface *screen, Widget *father, const string txt, const ushort action=CLOSE)
 TextButton (SDL_Surface *screen, Widget *father, const string txt, const ushort action=CLOSE)
void drawmotion (SDL_Color textColor, SDL_Color bgColor)
 Method to draw the button when mouse pointer is inside.
void draw ()
 Method to draw the button.
void refresh ()
 virtual method to refresh the widget
void mousemotion (const uint mousex, const uint mousey)
 Method to do an action when mouse is moved.
ushort mousebuttondown (const uint mousex=0, const uint mousey=0)
 Public method to get the action.

Detailed Description

Text Button Class

This class create a button with a text.

Author:
poltuiu
Date:
2006-03-27


Member Function Documentation

void TextButton::draw (  )  [virtual]

Method to draw the button.

Note:
in this method coordinates are in the window and not in the father element

Implements Widget.

void TextButton::drawmotion ( SDL_Color  textColor,
SDL_Color  bgColor 
)

Method to draw the button when mouse pointer is inside.

Note:
in this method coordinates are in the window and not in the father element
Parameters:
textColor color of the text of the button in SDL_Color format
bgColor color of the background of the button in SDL_Color format

ushort TextButton::mousebuttondown ( const uint  mousex = 0,
const uint  mousey = 0 
) [virtual]

Public method to get the action.

Parameters:
mousex is the coordinate x of the mouse pointer
mousey is the coordinate y of the mouse pointer
Returns:
the action of the Button

Reimplemented from Widget.

void TextButton::mousemotion ( const uint  mousex,
const uint  mousey 
) [virtual]

Method to do an action when mouse is moved.

if the mouse pointer is inside the button if the button is visible -> invisible if the button is invisible -> visible

Parameters:
mousex is the coordinate x of the mouse pointer
mousey is the coordinate y of the mouse pointer

Implements Widget.


The documentation for this class was generated from the following files:
Generated on Sat Jun 23 16:14:06 2007 for Stechec/TBT by  doxygen 1.4.7