Page 1 of 1

How to scroll a group with unboundedHScroll?

Posted: Sun Jan 23, 2011 9:55 pm
by JosepM
Hi,

How I must scroll a group using the unboundedHScroll and unboundedVScroll? I'm lost... :cry:


Salut,
Josep

Re: How to scroll a group with unboundedHScroll?

Posted: Sun Jan 23, 2011 10:09 pm
by JosepM
:)

Reply myself...

local sScrollerId
local sBottomScrollRect

on preopencard

set the unboundedHScroll of group "gr_1" to true
set the unboundedVScroll of group "gr_1" to true

if the environment is not "mobile" then
exit preOpenCard
end if
iphoneControlCreate "scroller"
put the result into sScrollerId
put the rect of group "gr_1" into tRect
put item 4 of tRect into sBottomScrollRect
iphoneControlSet sScrollerId, "rect", tRect
put the formattedHeight of group "gr_1" into tHeight
put the width of group "gr_1" into tWidth
iphoneControlSet sScrollerId, "contentRect", (0, 0, tWidth, tHeight)

iphoneControlSet sScrollerId, "visible", "true"
iphoneControlSet sScrollerId, "canBounce", true

iphoneControlSet sScrollerId, "declerationRate", fast
iphoneControlSet sScrollerId, "scrollingEnabled", true
iphoneControlSet sScrollerId, "canScrollToTop", true
iphoneControlSet sScrollerId, "delayTouches", true


iphoneControlSet sScrollerId, "hscroll", 0
iphoneControlSet sScrollerId, "vscroll", 0
set the hScroll of group "gr_1" to 0
set the vScroll of group "gr_1" to 0

end preopencard

on scrollerDidScroll pOffsetX, pOffsetY
lock screen
set the hScroll of group "gr_1" to pOffsetX
set the vScroll of group "gr_1" to pOffsetY
unlock screen
end scrollerDidScroll

Re: How to scroll a group with unboundedHScroll?

Posted: Sun Jan 23, 2011 10:34 pm
by JosepM
:? How to scroll a group inside another group? I can't...

UPDATED

Yes, I can :)
My problem was forget to check the "Lock size and position" of the group inside the group.

Also I detected that if the group isn't completely show don't work.
I have a group that appear like a panel with a scroller inside. If the scroller group isn't completely showed it don't scroll.

Someone can confirm this?


Salut,
Josep

Re: How to scroll a group with unboundedHScroll?

Posted: Sun Jan 23, 2011 11:21 pm
by JosepM
Hi again,

Other strange issue...

The scroller group and the scroller bars work although it are hidden... and work "only" into the space that the group occupies when it are showed...

I have a group that I move to a location to show to the user and the touch again, the group move to a location out of the bounds of the screen. Like a panel. Although the group is hidden the scrollbars appear if you drag over the zone that the group occupies when is showed.

A bug?

Salut,
Josep