Get location of click in scrolling field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Get location of click in scrolling field

Post by trenatos »

Is it possible to get the line number of where a user clicks in a scrolling field?
Marcus
trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Re: Get location of click in scrolling field

Post by trenatos »

Woo, answering lots of my own questions today.

on mouseDown
put word 2 of the clickline
end mouseDown
Marcus
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Get location of click in scrolling field

Post by FourthWorld »

Well done, Marcus. You'll make us obsolete in no time. :)
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Get location of click in scrolling field

Post by Klaus »

Love it! :D
trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Contact:

Re: Get location of click in scrolling field

Post by trenatos »

In this case I'm mimicking the Sublime IDE mini-map, so with that I can grab the line clicked in the mini-map, multiply by line-height in the target window, and set the scroll to the right position :)
Marcus
Klaus
Posts: 14324
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Get location of click in scrolling field

Post by Klaus »

You cunning fox! :D
Post Reply