Disable the scroller when scrollGroup is hidden

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

poliks
Posts: 15
Joined: Mon Jul 01, 2013 8:00 am

Disable the scroller when scrollGroup is hidden

Post by poliks » Tue Jul 16, 2013 9:51 am

Hi,

Newbie LC user here.
I wanted to toggle hide and unhide my scrollGroup that contains an ios scroller using a control button. But i noticed that even when the field is hidden, when
i touch the screen the scroller will show up and will still move in relation to the finger movements as if the hidden fields are still there. Is there away to completely disable the ios scrolling when that scrollGroup is hidden. That way it will not also interfere with the swipe gestures on going from card to card.

I tried disable "scrollGroup" directly when it is on hidden state but no effect.
I also tried moving the scrollGroup while hidden but it creates a lag plus no effect.

I know that i must disable the ios scrolling altogether but since this was called on the preOpenCard i am not sure what to do.

I have read this post but inside there where no solutions offered on how to disable it.
http://forums.runrev.com/viewtopic.php?f=49&t=7285

Where do we set this on the card or on the button itself?

Thanks,
Pol

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Disable the scroller when scrollGroup is hidden

Post by Klaus » Tue Jul 16, 2013 11:30 am

Hi Pol,

you mean you can even scroll after you have HIDDEN the native iOS Scroller?
That's what I was talking about in the linked posting.


Best

Klaus

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Disable the scroller when scrollGroup is hidden

Post by Dixie » Tue Jul 16, 2013 11:33 am

You could just disable the scrolling of the iOS scroller...

Code: Select all

 iphoneControlSet theIDofTheScroller, "scrollingEnabled", "false"
and when you want it to be able to scroll again set the 'scrollingEnabled' to true

poliks
Posts: 15
Joined: Mon Jul 01, 2013 8:00 am

Re: Disable the scroller when scrollGroup is hidden

Post by poliks » Wed Jul 17, 2013 3:48 am

Klaus,

Yes, when i touch the screen and pretend to scroll on the hidden area the scroll indicator will show up. Thus technically its scrolling but just cannot see the field that is scrolling.

Dixie,

Where will this code be placed on the card or on the button that controls the hide/show. I tried directly calling this

iphoneControlSet scrollid, "scrollingEnabled", true

inside my control but gives out an error handler.

Thanks.

strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 146
Joined: Mon Jul 31, 2006 1:39 am
Contact:

Re: Disable the scroller when scrollGroup is hidden

Post by strongbow » Wed Jul 17, 2013 10:05 am

It must be placed in the same location (card or control or ...) where the control was created. So if you created it in your card script, then hide/disable it there.

[Correction] Sorry, above is not quite correct - that's to do with messages originating from the control itself... From the docs:

Note: In general, messages dispatched by the native control are sent to the object containing the script which created it.
Last edited by strongbow on Wed Jul 17, 2013 12:58 pm, edited 1 time in total.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Disable the scroller when scrollGroup is hidden

Post by Dixie » Wed Jul 17, 2013 11:34 am

You can place the command to hide/show your scroller anywhere you want as long as it can 'know' its ID... So

Code: Select all

global scrollID
iphoneControlSet scrollid, "scrollingEnabled", true
Would work if you set the reference to the scroller using a global variable or custom property...

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Disable the scroller when scrollGroup is hidden

Post by Klaus » Wed Jul 17, 2013 12:32 pm

poliks wrote:Yes, when i touch the screen and pretend to scroll on the hidden area the scroll indicator will show up. Thus technically its scrolling but just cannot see the field that is scrolling.
hmm, too funky, how can we use a HIDDEN control, native or not?
I would consider this as a bug, although uncertain it its Apple's or Livecode's fault 8-)

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: Disable the scroller when scrollGroup is hidden

Post by gpb01 » Wed Jul 17, 2013 3:38 pm

Klaus wrote: hmm, too funky, how can we use a HIDDEN control, native or not?
I would consider this as a bug, although uncertain it its Apple's or Livecode's fault 8-)
No Klaus, you can't consider this a bug ... ;)

Livecode controls are one thing, native another and one know nothing about the other ...
... you create a Livecode scrolling field, next you create a native scroller ...they are two different things. Is so true that you're having to operate one with the messages coming from the other ... :)

Is your job to handle the two object ... if you hide one, you have to hide also the other and vice versa ... ;)

Guglielmo

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Disable the scroller when scrollGroup is hidden

Post by Klaus » Wed Jul 17, 2013 4:10 pm

Hmm, OK, I believe you! :-D

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Disable the scroller when scrollGroup is hidden

Post by Jellicle » Thu Jul 18, 2013 9:36 am

Just set the visible of the native scroller to false e.g. iphoneControlSet gScrollerID, "visible", "false". It doesn't work while it's visible is false.

g
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Disable the scroller when scrollGroup is hidden

Post by Klaus » Thu Jul 18, 2013 11:01 am

Jellicle wrote:Just set the visible of the native scroller to false e.g. iphoneControlSet gScrollerID, "visible", "false". It doesn't work while it's visible is false.
g
Well, that's what I was talking about all the time!?
Try to convince Guglielmo! :-D

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Disable the scroller when scrollGroup is hidden

Post by Dixie » Thu Jul 18, 2013 11:32 am

Klaus...

I'm not seeing what you guys are... maybe it's something in the air... but for me the scroller still scrolls when invisible... it still shows the scrollbars of the native scroller... the only way I have found to successfully stop the scroll is to set 'scrollingEnabled' to false...

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Disable the scroller when scrollGroup is hidden

Post by Klaus » Thu Jul 18, 2013 11:52 am

Dixie wrote:... but for me the scroller still scrolls when invisible...
That's what's puzzling my naive mind, hidden object should act as if not being there at all!
So what's the use of setting a native scoller/object to INVISIBLE if it does not have any effect?
Can you enter text into an invisible native text input field? I doubt!
So this looks like a bug to me :-D

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Disable the scroller when scrollGroup is hidden

Post by Jellicle » Thu Jul 18, 2013 1:09 pm

Just checked and double-checked - setting the visible of the scroller control deactivates it here :)

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: Disable the scroller when scrollGroup is hidden

Post by gpb01 » Thu Jul 18, 2013 5:36 pm

Jellicle wrote:Just checked and double-checked - setting the visible of the scroller control deactivates it here :)
+1

Exactly the same here ... :)

Livecode 6.1.0 build 2005 - Commercial Edition

Guglielmo

Post Reply