From 9e0c1a38e1264715e00fba000777cf0b05dde8fb Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 6 Aug 2011 10:12:34 +0100 Subject: [PATCH] GUI: Consistent behavior of ButtonWidget::setLabel() --- gui/widget.cpp | 4 ++++ gui/widget.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/gui/widget.cpp b/gui/widget.cpp index 8420391a3ff..c4d288eb111 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -298,6 +298,10 @@ void ButtonWidget::drawWidget() { g_gui.theme()->drawButton(Common::Rect(_x, _y, _x+_w, _y+_h), _label, _state, getFlags()); } +void ButtonWidget::setLabel(const Common::String &label) { + StaticTextWidget::setLabel(cleanupHotkey(label)); +} + #pragma mark - PicButtonWidget::PicButtonWidget(GuiObject *boss, int x, int y, int w, int h, const char *tooltip, uint32 cmd, uint8 hotkey) diff --git a/gui/widget.h b/gui/widget.h index 70f2da4c989..acd575a90bc 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -186,6 +186,8 @@ public: void setCmd(uint32 cmd) { _cmd = cmd; } uint32 getCmd() const { return _cmd; } + void setLabel(const Common::String &label); + void handleMouseUp(int x, int y, int button, int clickCount); void handleMouseEntered(int button) { setFlags(WIDGET_HILITED); draw(); } void handleMouseLeft(int button) { clearFlags(WIDGET_HILITED); draw(); }