fullscreenmode and rect of a substack on mobile device ?

FlexibleLearning.com admin at FlexibleLearning.com
Thu Aug 23 08:20:40 EDT 2018


Coming in late to the thread, but would this not work on all platforms?

on preOpenStack
  setupStackRect
end preOpenStack

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
    put tHeight into item 4 of tRect
    set the rect of this stack to tRect
  end if
end setupStackRect

You would obviously need to handle individual control geometry as needed,
but I found using a (hidden) master group of template graphics to define
regions a straightforward way to implement consistent geometry settings...

Set [the geometry] of [object] to [the geometry] of [graphic]
e.g. set the topleft of fld "About" to the topLeft of grc "template_Body"

Hugh Senior


> Le 22 ao?t 2018 ? 22:24, J. Landman Gay via use-livecode
<use-livecode at lists.runrev.com> a ?crit :
> 
> On 8/22/18 3:13 PM, J. Landman Gay via use-livecode wrote:
>> But the stack should still fill the screen and it doesn't.
> 
> This will resize the stack the same way as your "adapt" handler does, so
you can eliminate that entirely:
> 
> on preopenstack
>  mobileSetAllowedOrientations("portrait")
>  iphoneUseDeviceResolution true,true
>  set the fullscreenmode of stack "ipad" to "exactFit"
> end preopenstack

Many thanks for finding that this command !
Sadly, it?s only for iOS.





More information about the use-livecode mailing list