Xojo example of CanvasScrolling works ok, but meh...

I’m using the CanvasScrolling example that is supplied with 2016R3 . I’m using Win7. I’ve implemented the code from the example into my code and it works fine except for a couple of issues/gripes.

The scrolling using the mouse wheel is veeerrrry slow, also scrolling using the up/down arrow keys and the scroll bar, are all way too slow. What does work as expected is the scrollbar “thumb” thingy, and the mouse drag up/down works great.

I double checked and ran the supplied example, and it’s the same - so no problem with my code. The example is under Graphics and Multimedia/CanvasScrolling

All I could figure out to adjust was kScrollUnit (I’ve removed the horizontal scrollbar because I don’t need it):

[code]
Const kUpArrow = 30
Const kDownArrow = 31
Const kScrollUnit = 8 // pixels to scroll per keypress

// Move the scrollbar based on the key that was pressed
Select Case Asc(Key)

Case kUpArrow
VerticalScrollBar.Value = VerticalScrollBar.Value - kScrollUnit

Case kDownArrow
VerticalScrollBar.Value = VerticalScrollBar.Value + kScrollUnit

End Select

Return True[/code]

Adjusting kScrollUnit from 8 to any other random number makes no difference whatsoever, in my code, or the example.

Interesting. It’s not a big issue but preferable if it worked as per the usual - ie. what you see in this forum is the mouse wheel moves the window contents as expected. I have noticed in Xojo’s own IDE that the mouse wheel moves much more, but seems to be “stepped”?

In any case, MouseWheel, Scrollbar (select) and key dow/up and almost not worth being there. Waay toooo slowww. Perhaps it’s an OS settings issue?

Your thoughts much appreciated.

VerticalScrollBar.Value = VerticalScrollBar.Value - kScrollUnit

that just changes the values of the SCROLLBAR… but had NO EFFECT on anything else
UNLESS, there is a VALUECHANGED event…

Is there?

Thanks Dave,

Yes, as per the Xojo example, there is a ValueChanged Event:

[code] // Calculate the delta that the scrollbar was
// moved and scroll the image accordingly.

Dim delta As Integer
delta = hVerticalScrollBarLast - Me.Value
hYScroll = hYScroll + delta

cnvHelp_MODE.Scroll(0, delta)

hVerticalScrollBarLast = Me.Value[/code]

I can’t see anything there that I can test and change.

Like I said, the xojo example itself has the same issue.

All good.