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: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

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: 6684
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
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Klaus
Posts: 11012
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: 11012
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”