scrolling an rTree in the same way as a text field

This is a forum focused on providing support for rTree

Moderators: heatherlaine, robinmiller, kevinmiller, wilstrand

Post Reply
jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 231
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

scrolling an rTree in the same way as a text field

Post by jameshale » Sun Jul 01, 2012 8:55 am

When I place the cursor over a text field and scroll (i.e use a scroll wheel or two finger drag) the text in the field scrolls.
If I do the same thing over an rTree object it doesn't.
I have to actually click and drag on the scrollbars to get the "field" scrolling.

Can I get it to behave like a text field?

James

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5132
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: scrolling an rTree in the same way as a text field

Post by Mark » Sun Jul 01, 2012 9:01 pm

Hi James,

You can problaby catch the rawKeyUp message, check the target and if the target is the long id of the tree (group or field) then you can change the scroll of that group or field. If that doesn't work, then try a front script.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/livecodebook

jameshale
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 231
Joined: Thu Sep 04, 2008 6:23 am
Location: Melbourne Australia

Re: scrolling an rTree in the same way as a text field

Post by jameshale » Mon Jul 02, 2012 3:12 am

Thanks Mark,

Set me on the right track.
I had inadvertantly stopped this behaviour in my text field by trapping the rawkeydown as I didn't want any text added or modified in the field but wanted user to still be able to select text. Seems when the field has its text locked only lines can be selected.
I then put the the raw key value as I "scrolled" and noted the values (65308 and 65309).

Looking at my rTree object I noted that I was already switching on a rawKeyDown event to provide arrow key control so I just added cases to pass the scroll values.

works a treat.

Thanks again.

Post Reply

Return to “rTree”