diff options
-rw-r--r-- | vcl/inc/window.h | 1 | ||||
-rw-r--r-- | vcl/source/control/imp_listbox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 1 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 20 |
4 files changed, 26 insertions, 0 deletions
diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 452a88e6f9f5..1f61f2b1d4a7 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -159,6 +159,7 @@ struct ImplFrameData bool mbInSysObjFocusHdl; //< within a SysChildren's GetFocus handler bool mbInSysObjToTopHdl; //< within a SysChildren's ToTop handler bool mbSysObjFocus; //< does a SysChild have focus + sal_Int32 mnTouchPanPosition; css::uno::Reference< css::datatransfer::dnd::XDragSource > mxDragSource; css::uno::Reference< css::datatransfer::dnd::XDropTarget > mxDropTarget; diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 41750ae91eca..4aa9b820ccb4 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -2506,6 +2506,10 @@ bool ImplListBox::EventNotify( NotifyEvent& rNEvt ) bDone = HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar ); } } + else if (rCEvt.GetCommand() == CommandEventId::Gesture) + { + bDone = HandleScrollCommand(rCEvt, mpHScrollBar, mpVScrollBar); + } } return bDone || Window::EventNotify( rNEvt ); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 8df50b57da1f..1a4257760118 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -810,6 +810,7 @@ ImplFrameData::ImplFrameData( vcl::Window *pWindow ) mbInBufferedPaint = false; mnDPIX = 96; mnDPIY = 96; + mnTouchPanPosition = -1; } namespace vcl { diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 922b4b4ab161..eb631d3edc8c 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -755,6 +755,26 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd, } break; + case CommandEventId::Gesture: + { + const CommandGestureData* pData = rCmd.GetGestureData(); + if (pData->meEventType == GestureEventType::PanningBegin) + { + mpWindowImpl->mpFrameData->mnTouchPanPosition = pVScrl->GetThumbPos(); + } + else if(pData->meEventType == GestureEventType::PanningUpdate) + { + long nOriginalPosition = mpWindowImpl->mpFrameData->mnTouchPanPosition; + pVScrl->DoScroll(nOriginalPosition + (pData->mfOffset)); + } + if (pData->meEventType == GestureEventType::PanningEnd) + { + mpWindowImpl->mpFrameData->mnTouchPanPosition = -1; + } + bRet = true; + } + break; + case CommandEventId::AutoScroll: { const CommandScrollData* pData = rCmd.GetAutoScrollData(); |