Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 7 of 7 total |
Scrollbar affects Y cursor position, but how to account for it? |
Sun, Sep 21 2014 11:20 PM | Permanent Link |
Almanac | Hey there, I tracked down weird behavior to getting negative Y cursor positions on my images as a result of the browser window having a vertical scrollbar. Form.top nor image.top changes with the browser scroll bar, so how can I get the browser-caused displacement? Of course all I need is the cursor relative to the top left of my image control.
Thanks, Alister. |
Mon, Sep 22 2014 4:38 AM | Permanent Link |
Matthew Jones | Almanac wrote:
> so how can I get the browser-caused displacement? The ScrollTop property contains the "how scrolled" value. You can also set it to zero if you need to jump to top. -- Matthew Jones |
Mon, Sep 22 2014 7:33 PM | Permanent Link |
Almanac | Hi Matthew, thanks for replying so quickly. Perhaps we have misunderstood each other.
My form does not have a scrollbar, it's the "outside" browser container that has the scrollbar. I was thinking of a workaround trying to force the cursor to jump to 0,0 on the Timage then reading its X,Y, but that seems rather circular. Regards, Alister. "Matthew Jones" wrote: Almanac wrote: > so how can I get the browser-caused displacement? The ScrollTop property contains the "how scrolled" value. You can also set it to zero if you need to jump to top. -- Matthew Jones |
Tue, Sep 23 2014 4:33 AM | Permanent Link |
Matthew Jones | I've not found this - the XY matches the main form, even if scrolled.
But then maybe I'm doing it differently - I tend to auto-size to the desktop. I wasn't aware you could move the mouse from the browser, so not sure what you are doing. But other than to say "it works for me", I can't help further. If you have an example, perhaps that might be worth putting together from a fresh start. -- Matthew Jones |
Wed, Sep 24 2014 12:10 AM | Permanent Link |
Almanac | I shall try and re-jig the form so there are no scroll bars - a good end around to the problem - thanks Matthew.
FYI, here is a screengrab of the negative Y: https://flic.kr/p/pnnVc4; of course you can't see the mouse in the screengrab, but I positioned it a smidgen below the title bar. Note the outer vertical scrollbar is positioned so the title bar is half hidden, hence the value of FormY being -13 or -14. It's not a big deal, it just (partially) surprised me. In Java I would retrieve the X,Y of the object's upper left corner and subtract those to get frame relative X,Y, but since java is "invisible" here in EWB, I wouldn't want to go there. Alister. "Matthew Jones" wrote: I've not found this - the XY matches the main form, even if scrolled. But then maybe I'm doing it differently - I tend to auto-size to the desktop. I wasn't aware you could move the mouse from the browser, so not sure what you are doing. But other than to say "it works for me", I can't help further. If you have an example, perhaps that might be worth putting together from a fresh start. -- Matthew Jones |
Wed, Sep 24 2014 6:47 AM | Permanent Link |
Matthew Jones | I've done some testing, and you are right - it is odd. I've not looked
in detail at the framework code, but I suspect that ... [fx: has a look] Okay, the key is in TEventManager.MouseMoveHandler and in particular where it calls FTargetControl.BodyToBaseX and FTargetControl.BodyToBaseY. These end up in ParentToClientY which iterates up the parents applying ScrollTop values. It would be interesting to apply ClientToParentY to get the original value, and then do a walk up and work out which of the parents is "wrong". I'll leave that as an exercise for the reader who cares deeply about it. 8-) -- Matthew Jones |
Fri, Sep 26 2014 7:31 PM | Permanent Link |
Almanac | Matthew, I took your advice and simplified my interface so the scrolling never happens.
I've gone as as far as I need with my web app, so I've zipped up the project and posted it in the demos section for all to use: http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_demos&page=1&msg=162#162 I really appreciate your help and pointers over the past few months! Alister. P.S. This thread can be considered at an end until someone wants to dig farther as you noted. |
This web page was last updated on Sunday, May 19, 2024 at 08:46 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |