diff options
author | Paul Gilbert | 2015-07-03 11:24:48 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-07-03 11:24:48 -0400 |
commit | 323a16e51c5925a07e9316ed69cc23a25401db16 (patch) | |
tree | d15d2d4f48497772c040b82c7d43567177b5fc07 /engines/sherlock/tattoo/widget_talk.cpp | |
parent | 9634e185d249d3c7783b5b44a0ae799113f764e1 (diff) | |
download | scummvm-rg350-323a16e51c5925a07e9316ed69cc23a25401db16.tar.gz scummvm-rg350-323a16e51c5925a07e9316ed69cc23a25401db16.tar.bz2 scummvm-rg350-323a16e51c5925a07e9316ed69cc23a25401db16.zip |
SHERLOCK: RT: Implement scrollbar event handling
Diffstat (limited to 'engines/sherlock/tattoo/widget_talk.cpp')
-rw-r--r-- | engines/sherlock/tattoo/widget_talk.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/sherlock/tattoo/widget_talk.cpp b/engines/sherlock/tattoo/widget_talk.cpp index bfbf10e24f..e53a3d8170 100644 --- a/engines/sherlock/tattoo/widget_talk.cpp +++ b/engines/sherlock/tattoo/widget_talk.cpp @@ -35,7 +35,6 @@ namespace Tattoo { #define VISIBLE_TALK_LINES 6 WidgetTalk::WidgetTalk(SherlockEngine *vm) : WidgetBase(vm) { - _talkScroll = false; _talkScrollIndex = 0; _selector = _oldSelector = -1; _talkTextX = 0; @@ -71,12 +70,12 @@ void WidgetTalk::getTalkWindowSize() { // Make sure that the window does not get too big if (numLines < 7) { height = (_surface.fontHeight() + 1) * numLines + 9; - _talkScroll = false; + _scroll = false; } else { // Set up the height to a constrained amount, and add extra width for the scrollbar width += BUTTON_SIZE + 3; height = (_surface.fontHeight() + 1) * 6 + 9; - _talkScroll = false; + _scroll = false; } _bounds = Common::Rect(width, height); @@ -129,7 +128,7 @@ void WidgetTalk::load() { makeInfoArea(); // If a scrollbar is needed, draw it in - if (_talkScroll) { + if (_scroll) { int xp = _surface.w() - BUTTON_SIZE - 6; _surface.vLine(xp, 3, _surface.h() - 4, INFO_TOP); _surface.vLine(xp + 1, 3, _surface.h() - 4, INFO_MIDDLE); @@ -140,6 +139,8 @@ void WidgetTalk::load() { } void WidgetTalk::handleEvents() { + handleScrollbarEvents(_talkScrollIndex, VISIBLE_TALK_LINES, _statementLines.size()); + // TODO } @@ -189,7 +190,7 @@ void WidgetTalk::render(Highlight highlightMode) { } // See if the scroll bar needs to be drawn - if (_talkScroll && highlightMode != HL_CHANGED_HIGHLIGHTS) + if (_scroll && highlightMode != HL_CHANGED_HIGHLIGHTS) drawScrollBar(_talkScrollIndex, VISIBLE_TALK_LINES, _statementLines.size()); } |