diff options
author | Paul Gilbert | 2015-07-25 21:25:59 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-07-25 21:25:59 -0400 |
commit | 1d16677e3571add7baefecb9ee630e2e99e8e48d (patch) | |
tree | 5c40b5a09fd570b05474f9b19fff6206fc67a172 /engines/sherlock/tattoo/widget_base.cpp | |
parent | e754adbf776c9c591772090f59c2d9a2a63d9313 (diff) | |
download | scummvm-rg350-1d16677e3571add7baefecb9ee630e2e99e8e48d.tar.gz scummvm-rg350-1d16677e3571add7baefecb9ee630e2e99e8e48d.tar.bz2 scummvm-rg350-1d16677e3571add7baefecb9ee630e2e99e8e48d.zip |
SHERLOCK: RT: Implemented rendering of Files dialog
Diffstat (limited to 'engines/sherlock/tattoo/widget_base.cpp')
-rw-r--r-- | engines/sherlock/tattoo/widget_base.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp index ba4aee26f3..60d057edfc 100644 --- a/engines/sherlock/tattoo/widget_base.cpp +++ b/engines/sherlock/tattoo/widget_base.cpp @@ -223,15 +223,18 @@ void WidgetBase::checkTabbingKeys(int numOptions) { } void WidgetBase::drawScrollBar(int index, int pageSize, int count) { + Common::Rect r(BUTTON_SIZE, _bounds.height() - 6); + r.moveTo(_bounds.width() - BUTTON_SIZE - 3, 3); + drawScrollBar(index, pageSize, count, r); +} + +void WidgetBase::drawScrollBar(int index, int pageSize, int count, const Common::Rect &r) { TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui; - bool raised; // Fill the area with transparency - Common::Rect r(BUTTON_SIZE, _bounds.height() - 6); - r.moveTo(_bounds.width() - BUTTON_SIZE - 3, 3); _surface.fillRect(r, TRANSPARENCY); - raised = ui._scrollHighlight != 1; + bool raised = ui._scrollHighlight != 1; _surface.fillRect(Common::Rect(r.left + 2, r.top + 2, r.right - 2, r.top + BUTTON_SIZE - 2), INFO_MIDDLE); ui.drawDialogRect(_surface, Common::Rect(r.left, r.top, r.left + BUTTON_SIZE, r.top + BUTTON_SIZE), raised); @@ -269,6 +272,10 @@ void WidgetBase::drawScrollBar(int index, int pageSize, int count) { } void WidgetBase::handleScrollbarEvents(int index, int pageSize, int count) { + handleScrollbarEvents(index, pageSize, count, Common::Rect(_bounds.right - BUTTON_SIZE - 3, _bounds.top + 3, _bounds.right - 3, _bounds.bottom - 3)); +} + +void WidgetBase::handleScrollbarEvents(int index, int pageSize, int count, const Common::Rect &r) { Events &events = *_vm->_events; TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui; Common::Point mousePos = events.mousePos(); @@ -282,8 +289,6 @@ void WidgetBase::handleScrollbarEvents(int index, int pageSize, int count) { if ((!events._pressed && !events._rightReleased) || !_scroll) return; - Common::Rect r(_bounds.right - BUTTON_SIZE - 3, _bounds.top + 3, _bounds.right - 3, _bounds.bottom - 3); - // Calculate the Scroll Position bar int barHeight = (_bounds.height() - BUTTON_SIZE * 2) * pageSize / count; barHeight = CLIP(barHeight, BUTTON_SIZE, _bounds.height() - BUTTON_SIZE * 2); |