fullscreenmode and rect of a substack on mobile device ?
FlexibleLearning.com
admin at FlexibleLearning.com
Fri Aug 24 04:17:31 EDT 2018
First, I think you have a typo where "/25" should be "-25"...
set loc group "footer" to ( (item 2 of tRect)/2,(item 4 of tRect)/25 ) #
Typo: -25
Second, for safety, ensure integer values...
set loc group "footer" to round((item 2 of tRect)/2), (item 4 of tRect)-25
Third, if still not working on preOpenstack, try...
on preopenstack
if isMobile() then
mobileSetAllowedOrientations "portrait,portrait upside down,landscape
left,landscape right"
end if
hide this stack
end preopenstack
on openStack
setupStackRect
show this stack
end openStack
Hugh
> This thread will never finish (hehe)
>
> I am still have trouble getting the two object in the stack in place when
we
> open stack on mobile.
>
> The resize handlers wrok, and soon as we rotate the phone and back and
> geometry is implemented.
>
> But not on open stack..
>
> So I use your script. I was not orienting the stack size against the
screenrect
> first.
>
> Still not go:
>
> on preopenstack
> if isMobile() then
> mobileSetAllowedOrientations "portrait,portrait upside down,landscape
left,landscape right"
> setupStackRect
> end if
> end preopenstack
>
> ----------------------
>
> # Geometry
>
> on orientationChanged
> -- setupStackRect
> end orientationChanged
> on setupStackRect pWidth,pHeight
> if pWidth="" and pHeight="" then
> put the effective working screenRect into tRect
> set the rect of this stack to tRect
> set the topLeft of this stack to item 1 to 2 of tRect
> else
> put the rect of this stack into tRect
> put tWidth into item 3 of tRect # Typo: pWidth
> put tHeight into item 4 of tRect # Typo: pHeight
> set the rect of this stack to tRect
> end if
> set bottom of group "footer" to item 4 of tRect
> set loc group "footer" to ( (item 2 of tRect)/2,(item 4 of tRect)/25 ) #
Typo: -25
> subtract 50 from item 4 of tRect
> set the rect of widget "body" to tRect
> end setupStackRect
>
> on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
> # check it is landscape, turn off the navigation Bar
> if pNewWidth > pNewHeight then -- landscape
> put 0, 0, pNewWidth, pNewHeight into tBrowserRect
> set loc widget "body" to (pNewWidth/2,pNewHeight/2)
> hide group "footer"
> else
> put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
> set loc group "footer" to (pNewWidth/2,pNewHeight-25)
> show group "footer"
> end if
> set the rect of widget "body" of me to tBrowserRect
> end resizeStack
More information about the use-livecode
mailing list