ScrolldeltaX and ScrolldeltaY in a WE app not working?

Hi All,

The realbasic.mouseevent.scrolldeltaX or …Y don’t seem to work. They allways return 0. I tried in Xojo 2013r2 and the latest version and both show the same.
I tried on Windows 7, 8.1 and 10, no difference.

Anyone here having other experiance with this? There is also nothing to find in the feedback-system.

Thanks,
Andre

Where are you trying to get ScrollDelta ? There is no MouseWheel event in Web…

You could get these values with the JavaScript WheelEvent object http://www.w3schools.com/jsref/dom_obj_event.asp (bottom of page) in the onWheel event http://www.w3schools.com/jsref/event_onwheel.asp

I try to get them within the mousedown, mouseup and mousemove events from a canvas. It is in the docs and should work, but as far as i know it is not working from the beginning of the WE version about 2 and a half year ago. By now something should have been done about this.

And this is just about the distance the mouse has traveled acording to the documentation and IMHO has nothing to do with turning of the wheel.

[quote=210140:@Andre Kuiper]I try to get them within the mousedown, mouseup and mousemove events from a canvas. It is in the docs and should work, but as far as i know it is not working from the beginning of the WE version about 2 and a half year ago. By now something should have been done about this.

And this is just about the distance the mouse has traveled acording to the documentation and IMHO has nothing to do with turning of the wheel.[/quote]

Indeed none of those events are meant to provide any information about MouseWheel. The property in details is there, but it is not set.

MouseWheel is an entirely different matter. It is internally an event of onto itself. It is just not exposed by Xojo Web.

Here is an implementation of the JavaScript event, based on the JavaScript onMouseWheel event, taken from
http://www.javascriptkit.com/javatutors/onmousewheel.shtml

Xojo project :

scrolldelta.xojo_binary_project

At present it just gives the ScrollY. It is possible it may provide ScrollX ; I have not researched that yet.

Thanks Michel, i had hoped to stay away from javascript, but it seems that’s not possible. Will study your solutions tomorrow.
Again thanks!

[quote=210146:@Andre Kuiper]Thanks Michel, i had hoped to stay away from javascript, but it seems that’s not possible. Will study your solutions tomorrow.
Again thanks![/quote]

I tried to make it as easy for you as possible. I just added code to put the value in a hashtag. So now you can get the value back in Xojo in the Session.HashTagChanged event.

Just download again if you had already.

You know, JavaScript is what powers Xojo Web inside. Think about it as declares for the Web :wink:

There are scroll properties for WebContainers you know.

@Greg O’Lone I know, but i was looking for a way to track mousemovement and the traveled distance, and that’s what is ‘promissed’ by the description in the docs for realbasic.mouseevents.scrolldeltaX…/…Y.

@Michel Bujardet as i just told Greg, i was looking for a way to track mouse movement and the traveled distance of the mouse, and the description of the scrolldeltaX…/…Y events is just talking about that, nothing about the scrollwheel. I now see that the naming in the Xojo language and in the docs, in this case, is very confusing.
As you will understand your solution unfortunately doesn’t do what i was after. Nevertheless thanks very much for putting all that energie and time in trying to deliver a way to solve the problem. I still think that you ROCK!

I couldn’t however resist to try your example program in different browsers on Windows 10 and it seems that only one browser works in accordance with the specs in the documentation of the website you mentioned and that is Firefox.
Edge, Opera and Safari gave a result of 120 or -120 and Firefox gave 360 or -360. Because i have the settings for the mouse scrollwheel set to 3 lines per click only FF gives the right answer, the others allways gave 120/-120 no matter what number of lines i set the linecount for the mousescrollwheel.
Maybe Greg should look in that too.

Your mention of ScrollDelta was indeed very misleading.

Seems to me you need to look into MouseMove http://documentation.xojo.com/index.php/WebControl.MouseMove

I’d encourage you to approach this differently if you can. MouseMove produces a LOT of traffic and will slow sow your app considerably on the Internet.

Michel, please look at the description given here, that’s where the confusion is coming from:
http://documentation.xojo.com/index.php/MouseEvent.ScrollDeltaX

The explanation given is: “The horizontal distance that the mouse was moved or dragged.”

Greg, i did know that, that’s why i was looking into this scrolldelta thing. Because i expected to get a single value expressing the distance the mouse has traveled and not a whole range of values while the mouse was moving. The explanation gave me the impression that that was the case.

[quote=210294:@Andre Kuiper]Michel, please look at the description given here, that’s where the confusion is coming from:
http://documentation.xojo.com/index.php/MouseEvent.ScrollDeltaX

The explanation given is: “The horizontal distance that the mouse was moved or dragged.”

Greg, i did know that, that’s why i was looking into this scrolldelta thing. Because i expected to get a single value expressing the distance the mouse has traveled and not a whole range of values while the mouse was moving. The explanation gave me the impression that that was the case.[/quote]

If instead of going here and there, you tried to share what you are trying accomplish ? There are sometimes other options than all out MouseMove on the whole page.

Michel, I am trying to implement some kind of splitter in a web app. First tried it with under the cover a slider, just to get live moevement, but it worked too unreliable because the value of the slider sometimes in total unexpected moments jumped to zero and then back to the mouseposition. After that i used the mouseup and mousedown events of a containercontrol, but that blocked the rowselection in a listbox in that containercontrol and also the scrolling of the listbox was totally wonky.
Now i am experimenting with the mouseup and mousedown events in a canvas and that looks more promissing but i still haven’t achieved exact positioning of the controls next to the splitter. The splitter itself is also a narrow canvas.

I hope you understand what i am after. In case i explained it not well enough, please forgive me, and i’ll try again.

@Andre Kuiper — If you want this to be responsive, it would need to be implemented completely on the browser side.

You’re right, but for now i have decided to not do live repositioning the splitter but just use the different x/y values on mousedown and mouseup.
Thanks anyway.

I have implemented live resize in RubberViewsWE client side with code that is probably very similar to what you would need.

It is not extremely difficult, but indeed, JavaScript is not the same language as Xojo Web.

Not for someone as multilingual as you are, i have seen you replying to english, french and spanish questions here and changing code from VB and C to Xojo, but thats far beyond my simple mind!

However i have to admit that your RubberviewsWE realy looks great!

[quote=210582:@Andre Kuiper]Not for someone as multilingual as you are, i have seen you replying to english, french and spanish questions here and changing code from VB and C to Xojo, but thats far beyond my simple mind!

However i have to admit that your RubberviewsWE realy looks great![/quote]

Thank you. But you know, I am just a child compared to that waiter in an Amsterdam restaurant long ago who was serving transparently in Deutch, English, German, French and Italian. At the time, I really thought “That is how Europe is supposed to be .” !