HA! No comment!gpb01 wrote:+1Jellicle wrote:Just checked and double-checked - setting the visible of the scroller control deactivates it here
Exactly the same here ...
Livecode 6.1.0 build 2005 - Commercial Edition
Guglielmo
Disable the scroller when scrollGroup is hidden
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Disable the scroller when scrollGroup is hidden
Re: Disable the scroller when scrollGroup is hidden
OK. please bear with me since i am a newbie. Had to leave this behind for awhile since I had to present a mockup. I used another card instead to display the hidden mode. Lousy of me. Anyways tried it today. Here is my card script.
I have 2 buttons that hides and unhides
I tried it inside the buttons but i get the error
where did you guys place them that will allow me to toggle the Hide and Show states?
Thanks,
Pol
Code: Select all
global scrollid
on preOpenCard
# default state upon opening
hide group "scrollGroup"
hide grp "ClientOff"
show btn "ClientOn"
if environment() is not "mobile" then exit preOpenCard
if scrollID is not empty then
iphoneControlSet scrollid, "visible", true
exit preOpenCard
end if
put the rect of fld 1 into fldRect
put the formattedHeight of fld 1 into fldHeight
put the width of fld 1 into fldWidth
set the height of fld 1 to fldHeight
set the unboundedVScroll of group "scrollGroup" to true
iphoneControlCreate "scroller"
put the result into scrollid
iphoneControlSet scrollid, "rect", fldRect
iphoneControlSet scrollid, "contentRect", (0, 0, fldWidth, fldHeight)
iphoneControlSet scrollid, "visible", true
iphoneControlSet scrollid, "canBounce", true
iphoneControlSet scrollid, "decelerationRate", slow
iphoneControlSet scrollid, "scrollingEnabled", true
iphoneControlSet scrollid, "canScrollToTop",true
iphoneControlSet scrollid, "canCancelTouches",true
iphoneControlSet scrollid, "delayTouches", true
iphoneControlSet scrollid, "vIndicator", true
iphoneControlSet scrollid, "indicatorStyle", black
iphoneControlSet scrollid, "indicatorInsets", "0,0,0,0"
iphoneControlSet scrollid, "hscroll", 0
iphoneControlSet scrollid, "vscroll", 0
repeat with count = 1 to the number of lines of fld 1
set the textShift of line count of fld 1 to - 10
end repeat
put the vScroll of group "scrollGroup" into fld 3
end preOpenCard
on closeCard
if environment() is not "mobile" then exit closeCard
iphoneControlSet scrollid, "visible", false
set the vscroll of group "ScrollGroup" to 0
iphoneControlSet scrollId, "vscroll", 0
end closeCard
on scrollerBeginDrag
set the hilitedLine of fld 1 to empty
put empty into fld 2
end scrollerBeginDrag
on scrollerScrollToTop
iphoneControlSet scrollId, "vscroll", 0
end scrollerScrollToTop
on scrollerDidScroll hOffset, vOffset
set the vScroll of group "scrollGroup" to vOffset
put vOffset into fld 3
end scrollerDidScroll
I tried it inside the buttons but i get the error
Code: Select all
iphoneControlSet scrollid, "visible", false
Thanks,
Pol
Re: Disable the scroller when scrollGroup is hidden
Hi Pol,
you need to tell the script that you are using a GLOBAL variable!
A global variable need to be declared in EVERY script you use it!
You already have it correct in your stackscript!
Put this in your "hide/show" buttons:
Best
Klaus
you need to tell the script that you are using a GLOBAL variable!
A global variable need to be declared in EVERY script you use it!
You already have it correct in your stackscript!
Put this in your "hide/show" buttons:
Code: Select all
##!!!!!
global scrollid
on mouseup
iphoneControlSet scrollid, "visible", false
end mouseupKlaus
Re: Disable the scroller when scrollGroup is hidden
Not just in the buttons - declare the global variable everywhere you make a call to get or set a property of the control.
Gerry
Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Disable the scroller when scrollGroup is hidden
Ooops. Just re-read you post 
g
g
14" MacBook Pro
Former LiveCode developer.
Now recovering.
Former LiveCode developer.
Now recovering.
Re: Disable the scroller when scrollGroup is hidden
I don't have this problem on android via LiveCode 6.1. When the native control (not the content/group) is hidden, no scroll bar.
Re: Disable the scroller when scrollGroup is hidden
Hi Guys,
I actually added my global scrollid on the buttons.
Card Script
Show button. I did place the global variable as well.
As well as on my hide button.
But somewhat I still get an error on the buttons
button "ClientOn": execution error at line 4 (Handler:can't find handler) near "iphoneControlSet", char 1
I actually added my global scrollid on the buttons.
Card Script
Code: Select all
global scrollid
on preOpenCard
hide group "scrollGroup"
disable group "scrollGroup"
hide grp "ClientOff"
show btn "ClientOn"
if environment() is not "mobile" then exit preOpenCard
if scrollID is not empty then
iphoneControlSet scrollid, "visible", true
exit preOpenCard
end if
put the rect of fld 1 into fldRect
put the formattedHeight of fld 1 into fldHeight
put the width of fld 1 into fldWidth
set the height of fld 1 to fldHeight
set the unboundedVScroll of group "scrollGroup" to true
iphoneControlCreate "scroller"
put the result into scrollid
iphoneControlSet scrollid, "rect", fldRect
iphoneControlSet scrollid, "contentRect", (0, 0, fldWidth, fldHeight)
iphoneControlSet scrollid, "visible", true
iphoneControlSet scrollid, "canBounce", true
iphoneControlSet scrollid, "decelerationRate", slow
iphoneControlSet scrollid, "scrollingEnabled", true
iphoneControlSet scrollid, "canScrollToTop",true
iphoneControlSet scrollid, "canCancelTouches",true
iphoneControlSet scrollid, "delayTouches", true
iphoneControlSet scrollid, "vIndicator", true
iphoneControlSet scrollid, "indicatorStyle", black
iphoneControlSet scrollid, "indicatorInsets", "0,0,0,0"
iphoneControlSet scrollid, "hscroll", 0
iphoneControlSet scrollid, "vscroll", 0
repeat with count = 1 to the number of lines of fld 1
set the textShift of line count of fld 1 to - 10
end repeat
put the vScroll of group "scrollGroup" into fld 3
end preOpenCard
on closeCard
if environment() is not "mobile" then exit closeCard
iphoneControlSet scrollid, "visible", false
set the vscroll of group "ScrollGroup" to 0
iphoneControlSet scrollId, "vscroll", 0
end closeCard
on scrollerBeginDrag
set the hilitedLine of fld 1 to empty
put empty into fld 2
end scrollerBeginDrag
on scrollerScrollToTop
iphoneControlSet scrollId, "vscroll", 0
end scrollerScrollToTop
on scrollerDidScroll hOffset, vOffset
set the vScroll of group "scrollGroup" to vOffset
put vOffset into fld 3
end scrollerDidScroll
Code: Select all
global scrollid
on mouseUp
iphoneControlSet scrollid, "visible", true
show grp "ClientOff"
hide me
show group "scrollGroup" with visual effect dissolve very fast
end mouseUp
Code: Select all
global scrollid
on mouseUp
iphoneControlSet scrollid, "visible", false
hide group "scrollGroup"
show btn "ClientOn"
hide me
end mouseUp
button "ClientOn": execution error at line 4 (Handler:can't find handler) near "iphoneControlSet", char 1
Re: Disable the scroller when scrollGroup is hidden
Here is actually my LC file.
- Attachments
-
- ShowHide.livecode.zip
- (4.48 KiB) Downloaded 284 times
Re: Disable the scroller when scrollGroup is hidden
Hi Pol,
you have the answer in your "preOpenCard" script!:
You need to check this before every MOBILE command!
Best
Klaus
you have the answer in your "preOpenCard" script!:
Code: Select all
on mouseup
if environment() <> "mobile" then
exit mouseup
end if
## NOW do your MOBILE thing:
iphoneControlSet scrollid, "visible", true
...Best
Klaus
Re: Disable the scroller when scrollGroup is hidden
Awesome!!
It now works flawlessly!
Thank you all!
It now works flawlessly!
Thank you all!