Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-10-10 16:41:38 +0000
committerStijn Buys <ingar@osirion.org>2008-10-10 16:41:38 +0000
commit02fcd22d8cde355aa898a8c6bb4773d9434b8e9a (patch)
tree9397f1f5b61a0978acadc4c15fd330ee7138c59b /src/ui/button.cc
parent4331f5c17901f46693dcb5c2df96276f6851be25 (diff)
adds KeyPress, DevInfo and Stats widgets
Diffstat (limited to 'src/ui/button.cc')
-rw-r--r--src/ui/button.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ui/button.cc b/src/ui/button.cc
index d6384c9..1ac5fd8 100644
--- a/src/ui/button.cc
+++ b/src/ui/button.cc
@@ -17,6 +17,7 @@ Button::Button (Widget *parent, const char *text, const char *command) : Label(p
{
set_label("button");
set_command(command);
+ set_alignment(AlignCenter);
}
Button::~Button()
@@ -51,6 +52,7 @@ void Button::draw_border()
paint::color(palette()->foreground());
else
paint::color(palette()->border());
+
paint::border(global_location(), size());
}
@@ -64,21 +66,23 @@ void Button::draw_text()
else
paint::color(palette()->foreground());
- paint::text_centered(global_location(), size(), text(), font());
+ paint::text(global_location(), size(), font(), text(), alignment());
}
-void Button::keypress(unsigned int key, unsigned int modifier)
+bool Button::keypress(unsigned int key, unsigned int modifier)
{
-
+ return false;
}
-void Button::keyrelease(unsigned int key, unsigned int modifier)
+bool Button::keyrelease(unsigned int key, unsigned int modifier)
{
if (key == 512 + SDL_BUTTON_LEFT) {
core::cmd() << button_command << std::endl;
audio::play("ui/button");
+ return true;
}
-}
+ return false;
}
+}