Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

SDLUserButton Class Reference

Button with hardcoded colors and gradients, with text or icon. More...

#include <sdlbutton.h>

Inheritance diagram for SDLUserButton

Inheritance graph
[legend]
Collaboration diagram for SDLUserButton:

Collaboration graph
[legend]
List of all members.

Public Methods

 SDLUserButton (SDLWidget* parent, int btnid, SDL_Rect& r, char* text = NULL)
virtual ~SDLUserButton ()
void DrawBorder (int size=2)
bool SetIcon (char* filenameup, char* filenamedown = NULL, Uint32 colorkey = 0x000000FF)
 SWIG has problems with this, for some reason.. More...

bool SetIcon (SDL_Surface* icon_up, SDL_Surface* icon_down = NULL)
void SetBorderSize (int norm, int pressed, int high)
void SetToggle (bool bToggle)
void SetPressed (bool pressed)
void SetTransparency (int norm, int pressed, int high)
void SetText (char* text)
char* GetText ()
bool GetPressed ()

Protected Methods

void eventDraw (SDL_Surface* surface, SDL_Rect* rect)
void eventSizeWindow (int w, int h)
void eventMouseLeave ()
void eventMouseEnter ()
bool eventMouseButtonUp (const SDL_MouseButtonEvent* button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message. More...

bool eventMouseButtonDown (const SDL_MouseButtonEvent* button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message. More...

virtual void OnButtonSurface (SDL_Surface** surface, int newstate, int w, int h)

Protected Attributes

int bordersize [3]
int transparency [3]
int state
int id
int my_pressShift

Detailed Description

Button with hardcoded colors and gradients, with text or icon.

Author(s):
Alexander Pipelka

This should be integrated with SDLButton once the themeing takes place as this current buttom system is a little odd.

Definition at line 51 of file sdlbutton.h.


Constructor & Destructor Documentation

SDLUserButton::SDLUserButton ( SDLWidget * parent,
int btnid,
SDL_Rect & r,
char * text = NULL )
 

virtual SDLUserButton::~SDLUserButton ( ) [virtual]
 


Member Function Documentation

void SDLUserButton::DrawBorder ( int size = 2 )
 

bool SDLUserButton::GetPressed ( )
 

char * SDLUserButton::GetText ( )
 

void SDLUserButton::OnButtonSurface ( SDL_Surface ** surface,
int newstate,
int w,
int h ) [protected, virtual]
 

Reimplemented in SDLButton.

void SDLUserButton::SetBorderSize ( int norm,
int pressed,
int high )
 

bool SDLUserButton::SetIcon ( SDL_Surface * icon_up,
SDL_Surface * icon_down = NULL )
 

bool SDLUserButton::SetIcon ( char * filenameup,
char * filenamedown = NULL,
Uint32 colorkey = 0x000000FF )
 

SWIG has problems with this, for some reason..

(?)

void SDLUserButton::SetPressed ( bool pressed )
 

void SDLUserButton::SetText ( char * text )
 

void SDLUserButton::SetToggle ( bool bToggle )
 

void SDLUserButton::SetTransparency ( int norm,
int pressed,
int high )
 

void SDLUserButton::eventDraw ( SDL_Surface * surface,
SDL_Rect * rect ) [protected, virtual]
 

Reimplemented from SDLDrawObject.

bool SDLUserButton::eventMouseButtonDown ( const SDL_MouseButtonEvent * button ) [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button   SDL_MouseButtonEvent message

Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from SDLMessageObject.

Reimplemented in SDLScrollBar::ScrollButton.

bool SDLUserButton::eventMouseButtonUp ( const SDL_MouseButtonEvent * button ) [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is released. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button   SDL_MouseButtonEvent message

Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from SDLMessageObject.

Reimplemented in SDLScrollBar::ScrollButton.

void SDLUserButton::eventMouseEnter ( ) [protected, virtual]
 

Reimplemented from SDLWidget.

void SDLUserButton::eventMouseLeave ( ) [protected, virtual]
 

Reimplemented from SDLWidget.

void SDLUserButton::eventSizeWindow ( int w,
int h ) [protected, virtual]
 

Reimplemented from SDLDrawObject.


Member Data Documentation

int SDLUserButton::bordersize[3] [protected]
 

Definition at line 118 of file sdlbutton.h.

int SDLUserButton::id [protected]
 

Definition at line 121 of file sdlbutton.h.

int SDLUserButton::my_pressShift [protected]
 

Definition at line 122 of file sdlbutton.h.

int SDLUserButton::state [protected]
 

Definition at line 120 of file sdlbutton.h.

int SDLUserButton::transparency[3] [protected]
 

Definition at line 119 of file sdlbutton.h.


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