Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

wftk::PushButton Class Reference

PushButton Class. More...

#include <pushbutton.h>

Inheritance diagram for wftk::PushButton:

wftk::Button wftk::SingleContainer wftk::Widget wftk::ScreenArea wftk::ToggleButton List of all members.

Public Member Functions

 PushButton (const std::string &text, const Font &font=Font::registry.find("button_font"))
 Constructor for a normal button.
virtual ~PushButton ()
 destructor
void setUpPic (Surface::Resource *bm)
 set the picture for the button in up position

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void setUpPic (const Surface &surf)
 set the picture for the button in up position

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void setUpPic (const std::string &name)
 set the picture for the button in up position
void setDownPic (Surface::Resource *bm)
 set the picture for the button in down position

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void setDownPic (const Surface &surf)
 set the picture for the button in down position

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

void setDownPic (const std::string &name)
 set the picture for the button in down position

Protected Member Functions

virtual void draw (Surface &, const Point &, const Region &)
 The area drawn to must lie within the given region.

Detailed Description

PushButton Class.

In contrast to Button, this widgets changes its appereance when being pressed.


Constructor & Destructor Documentation

wftk::PushButton::PushButton const std::string &  text,
const Font &  font = Font::registry.find("button_font")
[explicit]
 

Constructor for a normal button.

Parameters:
text text that is written on the button, defaults to an empty string
font font to use for the text, defaults to "button_font"


Member Function Documentation

void wftk::PushButton::draw Surface surf,
const Point offset,
const Region r
[protected, virtual]
 

The area drawn to must lie within the given region.

This is protected so derived classes can call their parents' draw() in their own implementations.

Reimplemented from wftk::Widget.

void wftk::PushButton::setDownPic const std::string &  name  ) 
 

set the picture for the button in down position

Parameters:
name a std::string containing the name of the registered resource

void wftk::PushButton::setDownPic const Surface surf  ) 
 

set the picture for the button in down position

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
surf the picture, as a surface reference

void wftk::PushButton::setDownPic Surface::Resource bm  ) 
 

set the picture for the button in down position

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
bm a Surface::Resource containing the picture

void wftk::PushButton::setUpPic const std::string &  name  ) 
 

set the picture for the button in up position

Parameters:
name a std::string containing the name of the registered resource

void wftk::PushButton::setUpPic const Surface surf  ) 
 

set the picture for the button in up position

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
surf the picture, as a surface reference now

void wftk::PushButton::setUpPic Surface::Resource bm  ) 
 

set the picture for the button in up position

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
bm a Surface::Resource containing the picture


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

Generated Tue Aug 9 18:40:26 2005.
Copyright © 1998-2003 by the respective authors.

This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.