From 45bd7a8b75ebd8227ec4a09e427a66b1bb2796d1 Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Sun, 19 Feb 2017 20:14:51 -0600 Subject: SDL: Fix erratic analog pointer + control options Fixes erratic speeds in analog pointer motion Implemented option to set analog/keyboard pointer speed and control the analog joystick deadzone. The deadzone option appears only if the build supports analog joystick (via JOY_ANALOG define) --- gui/widgets/tab.cpp | 10 ++++++++++ gui/widgets/tab.h | 2 ++ 2 files changed, 12 insertions(+) (limited to 'gui/widgets') diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp index cf9dd5d962..8e8c6b48a1 100644 --- a/gui/widgets/tab.cpp +++ b/gui/widgets/tab.cpp @@ -277,6 +277,16 @@ void TabWidget::adjustTabs(int value) { setActiveTab(tabID); } +int TabWidget::getFirstVisible() { + return _firstVisibleTab; +} + +void TabWidget::setFirstVisible(int tabID) { + assert(0 <= tabID && tabID < (int)_tabs.size()); + _firstVisibleTab = tabID; + _boss->draw(); +} + void TabWidget::reflowLayout() { Widget::reflowLayout(); diff --git a/gui/widgets/tab.h b/gui/widgets/tab.h index 17b85986b5..4516c3c831 100644 --- a/gui/widgets/tab.h +++ b/gui/widgets/tab.h @@ -101,6 +101,8 @@ public: virtual void handleMouseDown(int x, int y, int button, int clickCount); virtual bool handleKeyDown(Common::KeyState state); virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); + virtual int getFirstVisible(); + virtual void setFirstVisible(int tabID); virtual void reflowLayout(); -- cgit v1.2.3