diff options
author | James Brown | 2002-07-13 09:19:23 +0000 |
---|---|---|
committer | James Brown | 2002-07-13 09:19:23 +0000 |
commit | 86a2ca6b820fa5d25911c4b1348dc95234c1404a (patch) | |
tree | 658fdb8a20c67e7698db04e9a7a431846266948a /gui/ListWidget.cpp | |
parent | 8e7686e19f2a00d6d832ebc31defcd69ca564aa7 (diff) | |
download | scummvm-rg350-86a2ca6b820fa5d25911c4b1348dc95234c1404a.tar.gz scummvm-rg350-86a2ca6b820fa5d25911c4b1348dc95234c1404a.tar.bz2 scummvm-rg350-86a2ca6b820fa5d25911c4b1348dc95234c1404a.zip |
Let ListWidget have an 'active' item
svn-id: r4529
Diffstat (limited to 'gui/ListWidget.cpp')
-rw-r--r-- | gui/ListWidget.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp index 4216d67a60..d40cfc829d 100644 --- a/gui/ListWidget.cpp +++ b/gui/ListWidget.cpp @@ -48,7 +48,7 @@ ListWidget::ListWidget(Dialog *boss, int x, int y, int w, int h) _numberingMode = kListNumberingOne; _entriesPerPage = (_h - 4) / LINE_HEIGHT; _currentPos = 3; - + _selectedItem = -1; _scrollBar = new ScrollBarWidget(boss, _x + _w, _y, kScrollBarWidth, _h); _scrollBar->setTarget(this); @@ -86,6 +86,8 @@ ListWidget::~ListWidget() void ListWidget::handleClick(int x, int y, int button) { if (_flags & WIDGET_ENABLED) { + _selectedItem = (y / LINE_HEIGHT) + _currentPos; + draw(); } } @@ -121,6 +123,9 @@ void ListWidget::drawWidget(bool hilite) } else buffer = ""; buffer += _list[pos]; - gui->drawString(buffer, _x+5, _y+2 + LINE_HEIGHT * i, _w - 10, gui->_textcolor); + if (_selectedItem == pos) + gui->drawString(buffer, _x+5, _y+2 + LINE_HEIGHT * i, _w - 10, gui->_textcolorhi); + else + gui->drawString(buffer, _x+5, _y+2 + LINE_HEIGHT * i, _w - 10, gui->_textcolor); } } |