#include <pushbutton.h>
Inheritance diagram for wftk::PushButton:

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 | |
| void | setUpPic (const Surface &surf) |
| set the picture for the button in up position | |
| 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 | |
| void | setDownPic (const Surface &surf) |
| set the picture for the button in down position | |
| 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. | |
In contrast to Button, this widgets changes its appereance when being pressed.
| wftk::PushButton::PushButton | ( | const std::string & | text, | |
| const Font & | font = Font::registry.find("button_font") | |||
| ) | [explicit] |
Constructor for a normal button.
| text | text that is written on the button, defaults to an empty string | |
| font | font to use for the text, defaults to "button_font" |
| 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.
| bm | a Surface::Resource containing the picture |
| 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.
| surf | the picture, as a surface reference now |
| void wftk::PushButton::setUpPic | ( | const std::string & | name | ) |
set the picture for the button in up position
| name | a std::string containing the name of the registered resource |
| 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.
| bm | a Surface::Resource containing the picture |
| 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.
| surf | the picture, as a surface reference |
| void wftk::PushButton::setDownPic | ( | const std::string & | name | ) |
set the picture for the button in down position
| name | a std::string containing the name of the registered resource |
| 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.
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.