diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-05 19:36:39 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-03-06 11:57:02 +0900 |
commit | 19dc7225603284184e04190ed6b6926e5e5a196a (patch) | |
tree | 44dad16b154a4022f15cf32ff8ad4ea0928aa9a0 /svtools | |
parent | d59ba6ac9f837f398ee0a212bb2cc612a8a2f20c (diff) |
tabbar: scroll tabs with wheel
Change-Id: I9d7d1e16c34eac75652a1275b6e4ac3f7973cb56
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/tabbar.cxx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 217174cc960e..c3a983e01fb1 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1519,7 +1519,31 @@ void TabBar::Resize() ImplEnableControls(); } - +bool TabBar::PreNotify( NotifyEvent& rNEvt ) +{ + if (rNEvt.GetType() == MouseNotifyEvent::COMMAND) + { + if (rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL) + { + const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData(); + sal_uInt16 nNewPos = mnFirstPos; + if (pData->GetNotchDelta() > 0) + { + if (mnFirstPos) + nNewPos = mnFirstPos - 1; + } + else if (pData->GetNotchDelta() < 0) + { + sal_uInt16 nCount = GetPageCount(); + if (mnFirstPos < nCount) + nNewPos = mnFirstPos + 1; + } + if (nNewPos != mnFirstPos) + SetFirstPageId(GetPageId(nNewPos)); + } + } + return Window::PreNotify( rNEvt ); +} void TabBar::RequestHelp( const HelpEvent& rHEvt ) { |