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
Location: Virginia, USA
Contact:

Get location of click in scrolling field

Post by trenatos » Fri Apr 24, 2015 8:16 pm

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
Location: Virginia, USA
Contact:

Re: Get location of click in scrolling field

Post by trenatos » Fri Apr 24, 2015 8:19 pm

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: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Get location of click in scrolling field

Post by FourthWorld » Fri Apr 24, 2015 9:00 pm

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: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Get location of click in scrolling field

Post by Klaus » Fri Apr 24, 2015 10:14 pm

Love it! :D

trenatos
Posts: 189
Joined: Wed Jul 03, 2013 6:46 am
Location: Virginia, USA
Contact:

Re: Get location of click in scrolling field

Post by trenatos » Fri Apr 24, 2015 10:44 pm

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: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Get location of click in scrolling field

Post by Klaus » Fri Apr 24, 2015 11:22 pm

You cunning fox! :D

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”