GUI: Consistent behavior of ButtonWidget::setLabel()

This commit is contained in:
Eugene Sandulenko 2011-08-06 10:12:34 +01:00
parent f681617913
commit 9e0c1a38e1
2 changed files with 6 additions and 0 deletions

View file

@ -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)

View file

@ -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(); }