From 96c0943ad698733128a46200ddb017bc24310abc Mon Sep 17 00:00:00 2001 From: AngryGamer Date: Sat, 18 Mar 2017 18:55:34 -0700 Subject: [PATCH] Fix tab switching hotkeys in multi-line (shift+MW, ctrl+MW, shift+ctrl+MW) --- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 0c8d45b76..8da73f503 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -486,15 +486,15 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara return TRUE; const bool isForward = ((short)HIWORD(wParam)) < 0; // wheel rotation towards the user will be considered as forward direction - const LRESULT lastTabIndex = ::SendMessage(_hSelf, TCM_GETITEMCOUNT, 0, 0) - 1; + const int lastTabIndex = static_cast(::SendMessage(_hSelf, TCM_GETITEMCOUNT, 0, 0) - 1); if ((wParam & MK_CONTROL) && (wParam & MK_SHIFT)) { - ::SendMessage(_hSelf, TCM_SETCURFOCUS, (isForward ? lastTabIndex : 0), 0); + setActiveTab((isForward ? lastTabIndex : 0)); } else if (wParam & (MK_CONTROL | MK_SHIFT)) { - LRESULT tabIndex = ::SendMessage(_hSelf, TCM_GETCURSEL, 0, 0) + (isForward ? 1 : -1); + int tabIndex = static_cast(::SendMessage(_hSelf, TCM_GETCURSEL, 0, 0) + (isForward ? 1 : -1)); if (tabIndex < 0) { if (wParam & MK_CONTROL) @@ -509,7 +509,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara else return TRUE; } - ::SendMessage(_hSelf, TCM_SETCURFOCUS, tabIndex, 0); + setActiveTab(tabIndex); } else if (not _isMultiLine) // don't scroll if in multi-line mode { @@ -521,7 +521,7 @@ LRESULT TabBarPlus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPara TC_HITTESTINFO hti; LONG xy = NppParameters::getInstance()->_dpiManager.scaleX(12); // an arbitrary coordinate inside the first visible tab hti.pt = { xy, xy }; - LRESULT scrollTabIndex = ::SendMessage(_hSelf, TCM_HITTEST, 0, reinterpret_cast(&hti)); + int scrollTabIndex = static_cast(::SendMessage(_hSelf, TCM_HITTEST, 0, reinterpret_cast(&hti))); if (scrollTabIndex < 1 && (_isVertical ? rcLastTab.bottom < rcTabCtrl.bottom : rcLastTab.right < rcTabCtrl.right)) // nothing to scroll return TRUE;