aboutsummaryrefslogtreecommitdiff
path: root/gui/widget.cpp
diff options
context:
space:
mode:
authorMax Horn2002-07-27 00:36:09 +0000
committerMax Horn2002-07-27 00:36:09 +0000
commit95ca2ea04349e79629e8a34c803331cbae5f9b95 (patch)
treead986ce5f32ef642ce35cbed899862a519b88eed /gui/widget.cpp
parentc318fed6338fd232deff621141f58789ffbbad89 (diff)
downloadscummvm-rg350-95ca2ea04349e79629e8a34c803331cbae5f9b95.tar.gz
scummvm-rg350-95ca2ea04349e79629e8a34c803331cbae5f9b95.tar.bz2
scummvm-rg350-95ca2ea04349e79629e8a34c803331cbae5f9b95.zip
added support for right aligned text; made use of that in the sound dialog; less redrawing in the sound dialog
svn-id: r4649
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r--gui/widget.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index c13ae7f4e1..79354de515 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -76,8 +76,8 @@ void Widget::draw()
#pragma mark -
-StaticTextWidget::StaticTextWidget(Dialog *boss, int x, int y, int w, int h, const char *text, bool centred)
- : Widget (boss, x, y, w, h), _label(0), _centred(centred)
+StaticTextWidget::StaticTextWidget(Dialog *boss, int x, int y, int w, int h, const char *text, int align)
+ : Widget (boss, x, y, w, h), _label(0), _align(align)
{
_type = kStaticTextWidget;
setLabel(text);
@@ -117,7 +117,7 @@ void StaticTextWidget::setValue(int value)
void StaticTextWidget::drawWidget(bool hilite)
{
NewGui *gui = _boss->getGui();
- gui->drawString(_label, _x, _y, _w, hilite ? gui->_textcolorhi : gui->_textcolor, _centred);
+ gui->drawString(_label, _x, _y, _w, hilite ? gui->_textcolorhi : gui->_textcolor, _align);
}
@@ -125,13 +125,11 @@ void StaticTextWidget::drawWidget(bool hilite)
ButtonWidget::ButtonWidget(Dialog *boss, int x, int y, int w, int h, const char *label, uint32 cmd, uint8 hotkey)
- : StaticTextWidget(boss, x, y, w, h, label), CommandSender(boss), _cmd(cmd), _hotkey(hotkey)
+ : StaticTextWidget(boss, x, y, w, h, label, kTextAlignCenter), CommandSender(boss), _cmd(cmd), _hotkey(hotkey)
{
assert(label);
_flags = WIDGET_ENABLED | WIDGET_BORDER | WIDGET_CLEARBG ;
_type = kButtonWidget;
-
- setCentred(true);
}
ButtonWidget::~ButtonWidget()