#include <button.h>
Public Member Functions | |
Button (std::string l, int x, int y) | |
int | focus () throw (UIException) |
Shows the button and waits for input. | |
std::string | getLabel () |
int | getLength () const |
Returns the width occupied by the button. | |
void | refresh () throw (UIException) |
void | setLabel (std::string l) throw (UIException) |
virtual | ~Button () |
Protected Member Functions | |
void | createWindow () throw (UIException) |
virtual void | onClick () |
Private Types | |
enum | { BASE_SIZE = 4 } |
Private Member Functions | |
Button (const Button &) | |
const Button & | operator= (const Button &) |
Private Attributes | |
std::string | label |
int | start_x |
int | start_y |
WINDOW * | window |
When the user presses the button, focus()
returns \n
.
Definition at line 61 of file button.h.
anonymous enum [private] |
YAPETUI::Button::Button | ( | const Button & | ) | [inline, private] |
Button::Button | ( | std::string | l, | |
int | x, | |||
int | y | |||
) |
void Button::createWindow | ( | ) | throw (UIException) [protected] |
int Button::focus | ( | ) | throw (UIException) |
Shows the button and waits for input. When button is pressed, it returns \n
.
\n
. Definition at line 79 of file button.cc.
References YAPETUI::BUTTON_FOCUS, YAPETUI::BUTTON_NOFOCUS, KEY_REFRESH, label, onClick(), YAPETUI::BaseWindow::refreshAll(), YAPETUI::Colors::setcolor(), and window.
Referenced by PasswordRecord::run(), PasswordDialog::run(), FileOpen::run(), YAPETUI::MessageBox::run(), and YAPETUI::DialogBox::run().
std::string YAPETUI::Button::getLabel | ( | ) | [inline] |
int YAPETUI::Button::getLength | ( | ) | const [inline] |
Returns the width occupied on the screen by the button. It is calculated by adding BASE_SIZE
and label.length()
.
Definition at line 112 of file button.h.
References BASE_SIZE, and label.
Referenced by PasswordRecord::createWindow(), PasswordDialog::createWindow(), and YAPETUI::MessageBox::getOkButtonLength().
virtual void YAPETUI::Button::onClick | ( | ) | [inline, protected, virtual] |
void Button::refresh | ( | ) | throw (UIException) |
Definition at line 65 of file button.cc.
References YAPETUI::BUTTON_NOFOCUS, label, YAPETUI::Colors::setcolor(), and window.
Referenced by PasswordRecord::refresh(), PasswordDialog::refresh(), FileOpen::refresh(), YAPETUI::MessageBox::refresh(), and YAPETUI::DialogBox::refresh().
void Button::setLabel | ( | std::string | l | ) | throw (UIException) |
std::string YAPETUI::Button::label [private] |
Definition at line 77 of file button.h.
Referenced by createWindow(), focus(), getLabel(), getLength(), refresh(), and setLabel().
int YAPETUI::Button::start_x [private] |
int YAPETUI::Button::start_y [private] |
WINDOW* YAPETUI::Button::window [private] |
Definition at line 72 of file button.h.
Referenced by createWindow(), focus(), refresh(), setLabel(), and ~Button().