summaryrefslogtreecommitdiff
path: root/svtools/source/control/tabbar.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/control/tabbar.cxx')
-rw-r--r--svtools/source/control/tabbar.cxx26
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 )
{