diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-06 18:22:32 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-06 18:22:32 +0000 |
commit | a14d80f83aebe75241bf63b4f3ffca3a5d952577 (patch) | |
tree | fea36faedd17a0aa620f6d7e781a352327d6065d /src/ui/button.cc | |
parent | 343b0b4298e2d084d5544d3d40a8b7dcb586ce8e (diff) |
libui updates, support menu .ini files
Diffstat (limited to 'src/ui/button.cc')
-rw-r--r-- | src/ui/button.cc | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/ui/button.cc b/src/ui/button.cc index 09e8695..73a349e 100644 --- a/src/ui/button.cc +++ b/src/ui/button.cc @@ -5,18 +5,38 @@ */ #include "ui/button.h" +#include "auxiliary/functions.h" +#include "sys/sys.h" namespace ui { -Button::Button (Widget *parent, char const *text, char const *command) : Label(parent, text) +Button::Button (Widget *parent, const char *text, const char *command) : Label(parent, text) { set_label("button"); + set_command(command); +} + +Button::~Button() +{ +} + +void Button::print(size_t indent) +{ + std::string marker(""); + con_print << aux::pad_left(marker, indent*2) << label() << " \"" << text() << "\" \"" << command() << "\"" << std::endl; +} + +void Button::set_command(const char *command) +{ if (command) button_command.assign(command); + else + button_command.clear(); } -Button::~Button() +void Button::set_command(std::string const &command) { + button_command.assign(command); } void Button::draw() |