Page 1 of 2

Disable the scroller when scrollGroup is hidden

Posted: Tue Jul 16, 2013 9:51 am
by poliks
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

Re: Disable the scroller when scrollGroup is hidden

Posted: Tue Jul 16, 2013 11:30 am
by Klaus
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

Re: Disable the scroller when scrollGroup is hidden

Posted: Tue Jul 16, 2013 11:33 am
by Dixie
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

Re: Disable the scroller when scrollGroup is hidden

Posted: Wed Jul 17, 2013 3:48 am
by poliks
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.

Re: Disable the scroller when scrollGroup is hidden

Posted: Wed Jul 17, 2013 10:05 am
by strongbow
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.

Re: Disable the scroller when scrollGroup is hidden

Posted: Wed Jul 17, 2013 11:34 am
by Dixie
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...

Re: Disable the scroller when scrollGroup is hidden

Posted: Wed Jul 17, 2013 12:32 pm
by Klaus
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-)

Re: Disable the scroller when scrollGroup is hidden

Posted: Wed Jul 17, 2013 3:38 pm
by gpb01
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

Re: Disable the scroller when scrollGroup is hidden

Posted: Wed Jul 17, 2013 4:10 pm
by Klaus
Hmm, OK, I believe you! :-D

Re: Disable the scroller when scrollGroup is hidden

Posted: Thu Jul 18, 2013 9:36 am
by Jellicle
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

Re: Disable the scroller when scrollGroup is hidden

Posted: Thu Jul 18, 2013 11:01 am
by Klaus
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

Re: Disable the scroller when scrollGroup is hidden

Posted: Thu Jul 18, 2013 11:32 am
by Dixie
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...

Re: Disable the scroller when scrollGroup is hidden

Posted: Thu Jul 18, 2013 11:52 am
by Klaus
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

Re: Disable the scroller when scrollGroup is hidden

Posted: Thu Jul 18, 2013 1:09 pm
by Jellicle
Just checked and double-checked - setting the visible of the scroller control deactivates it here :)

Gerry

Re: Disable the scroller when scrollGroup is hidden

Posted: Thu Jul 18, 2013 5:36 pm
by gpb01
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