Kaydet (Commit) 19dc7225 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

tabbar: scroll tabs with wheel

Change-Id: I9d7d1e16c34eac75652a1275b6e4ac3f7973cb56
üst d59ba6ac
......@@ -400,6 +400,7 @@ public:
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE;
virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
virtual void Select();
virtual void DoubleClick();
......
......@@ -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 )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment