Scrolling a panel by dragging


#1

Hi, I am surprised if nobody asked about before, but I haven’t found anything regarding this.

I have a panel with several components horizontally or vertically aligned. (buttons, sliders, custom components, whatever).
Now I am using viewport to scroll the panel to click a button or drag a slider.

I would like to scroll the viewport by dragging the mouse (finger) along the component, because in order to do it in mobile devices, the viewport scrollbar thickness has to be much wider to fit the finger width.

But, if I start dragging over a component (button for example) the mouse drag event is only “seen” in that child component, not over the viewport component, so I can’t catch that event to set the scrollbar position manually.

In the case of a button is OK, but I am also wondering if the component is a slider, how to decide if to move the viewport, or to move the slider…

Regarding the viewport, I would like to know if it is possible to scroll the viewport only when i drag along the bar “space”, not wherever i click over the bar “space”, because if the real bar is very small comparing the viewport component height (bar “space”) is very dificult to click just on the bar, and the viewport moves quickly to the clicked point.

I hope I have explained myself ;D

ANy idea??thanks!!


#2

Ohh, I missed the dragonScroll feature,

It works, the only problem I have got is that, if I have buttons in the viewport, and I start scrolling over a button, when I release the mouse over a button the buttonclick event is triggered.


#3

Would be possible to have a timer so if the mouse has not been Down for certain period of time, it is not detected as buttonclicked?so i could drag without clicking?