A button. More...
#include <button.h>

Public Member Functions | |
| Button (std::string l, int x, int y, bool ro=false) | |
| int | focus () throw (UIException) |
| Shows the button and waits for input. | |
| std::string | getLabel () |
| int | getLength () const |
| Returns the width occupied by the button. | |
| bool | getReadonly () const |
| void | refresh () throw (UIException) |
| void | setLabel (std::string l) throw (UIException) |
| void | setReadonly (bool ro) |
| 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 |
| bool | readonly |
| int | start_x |
| int | start_y |
| WINDOW * | window |
Displays a button.
When the user presses the button, focus() returns \n.
Definition at line 62 of file button.h.
anonymous enum [private] |
| YAPET::UI::Button::Button | ( | const Button & | ) | [inline, private] |
| Button::Button | ( | std::string | l, | |
| int | x, | |||
| int | y, | |||
| bool | ro = false | |||
| ) |
Definition at line 38 of file button.cc.
References createWindow().

| 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 87 of file button.cc.
References YAPET::UI::BUTTON_FOCUS, YAPET::UI::BUTTON_NOFOCUS, KEY_ESC, KEY_REFRESH, KEY_TAB, label, onClick(), readonly, YAPET::UI::BaseWindow::refreshAll(), YAPET::UI::Colors::setcolor(), and window.
Referenced by SearchDialog::run(), PWGenDialog::run(), PasswordRecord::run(), PasswordDialog::run(), FileOpen::run(), YAPET::UI::MessageBox::run(), and YAPET::UI::DialogBox::run().


| std::string YAPET::UI::Button::getLabel | ( | ) | [inline] |
| int YAPET::UI::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 118 of file button.h.
References BASE_SIZE, and label.
Referenced by SearchDialog::createWindow(), PWGenDialog::createWindow(), PasswordRecord::createWindow(), PasswordDialog::createWindow(), and YAPET::UI::MessageBox::getOkButtonLength().

| bool YAPET::UI::Button::getReadonly | ( | ) | const [inline] |
| virtual void YAPET::UI::Button::onClick | ( | ) | [inline, protected, virtual] |
| void Button::refresh | ( | ) | throw (UIException) |
Definition at line 72 of file button.cc.
References YAPET::UI::BUTTON_NOFOCUS, label, YAPET::UI::Colors::setcolor(), and window.
Referenced by SearchDialog::refresh(), PWGenDialog::refresh(), PasswordRecord::refresh(), PasswordDialog::refresh(), FileOpen::refresh(), YAPET::UI::MessageBox::refresh(), and YAPET::UI::DialogBox::refresh().


| void Button::setLabel | ( | std::string | l | ) | throw (UIException) |
| void YAPET::UI::Button::setReadonly | ( | bool | ro | ) | [inline] |
Definition at line 122 of file button.h.
References readonly.
Referenced by PasswordRecord::setReadonly().

std::string YAPET::UI::Button::label [private] |
Definition at line 80 of file button.h.
Referenced by createWindow(), focus(), getLabel(), getLength(), and refresh().
bool YAPET::UI::Button::readonly [private] |
Definition at line 84 of file button.h.
Referenced by focus(), getReadonly(), and setReadonly().
int YAPET::UI::Button::start_x [private] |
Definition at line 82 of file button.h.
Referenced by createWindow().
int YAPET::UI::Button::start_y [private] |
Definition at line 83 of file button.h.
Referenced by createWindow().
WINDOW* YAPET::UI::Button::window [private] |
1.7.1