Re: fullscreenmode and rect of a substack on mobile device ?

2018-09-04 Thread Sannyasin Brahmanathaswami via use-livecode
I woke up with a "dream" saying ..."hmmm maybe it just a timing issue;
stay away from "preopen[anything]

At least in my case, this worked out of box, super simple

9 line of code to get initial placement
12 line of code in my resize handler

!

So long as

a) the card is rendered
b) all other open and close stack  operation are finished
c) and you stay away from preopenstack/preopencard

# disclaimer -- could have kept going to find the exact recipe in the
pre* handlers
# may be they would work 
# But I have spent too much time to fiddle with it more.




*local*LocalArray, sScreenRect

*on*openCard

*# hide browser for now
*

*hide*widget"body"

*if* isMobile() *then*

*send*"setUpStackRect"tomein500milliseconds

*end* *if*

*end*openCard

*-*

*--# Geometry, initial placement
*

*on*setupStackRect 

*put*mobileRectGet() intosScreenRect 

# get to screenrect of the main backscript library

*# place footer*

*set*bottomof*group*"footer"toitem4ofsScreenRect

*   
set*loc*group*"footer"toround((item3ofsScreenRect)/2),(item4ofsScreenRect)-25

*show**group*"footer"

*# place Browser*

*subtract*50fromitem4ofsScreenRect

*set*therectofwidget"body"tosScreenRect

*show*widget"body"

*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 intotBrowserRect

*set*locwidget"body"to( round(pNewWidth/2), round(pNewHeight/2) )

*hide**group*"footer"

*else*

*put*0, 0, pNewWidth, pNewHeight - 50intotBrowserRect

*set*loc*group*"footer"to( round(pNewWidth/2),pNewHeight-25)

*show**group*"footer"

*end* *if*

*set*therectofwidget"body"ofmetotBrowserRect

*end*resizeStack


BR


On 8/24/18 5:43 PM, J. Landman Gay via use-livecode wrote:
> It's more complicated than that. Using the iPad Air simulator and this 
> preOpenCard handler:
>
> on preopenstack
>mobileSetAllowedOrientations("portrait")
>iphoneUseDeviceResolution true,true
> end preopenstack
>
> When I press the "Get the rect" button it reports the stack, card, and 
> screenrect are all 0,0,640,960. 


-- 
Svasti Astu, Be Well!
Brahmanathaswami
 
Get the SivaSiva app, it's free:
https://www.himalayanacademy.com/apps/sivasiva


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-31 Thread Sannyasin Brahmanathaswami via use-livecode
@Brian

That was interesting an experiment.

I reduced all geometry to this

*on*openCard

*put*mobileRectGet() intotStackRect

#mobileRectSet get the screenrect on app init

 *if* isMobile() *then*

  *if* theplatformisandroid *then*

*set*therectofwidget"body"to0,0,486,765

*else*

*set*rectrectofwidget"body"to0,0,414,680

*end* *if*

*put*thelocofthiscardintotCardLoc

*answer*tCardLoc with"OK"

*set*thelocofwidget"body"to( item1oftCardLoc, (item2of   
tCharLoc)-50)

*end* *if*

*end*openCard


I get the card loc alright in the answe; but the browser widget "does
not obey"

You said: "What I'm not clear about is whether you can set the rect of
the stack to the known screen rect and have it display correctly."

Answer is "no" but it may be just the (browser on android) OR (it may be that 
the attempt to place *any* object on opencard, doesn't *really* know to coords 
of the stack/card, even if you get them) until resizestack is triggered.

And, additional caveat (on Android, every works on iOS)  if you start playing a 
youTube in portrait mode and, while it is playing, rotate to phone... the 
browse "disappears" , you can still hear the audio... so I suspect the browser 
it "off in space", but it you *do not* starting play, are rotate the phone, you 
get the "web page" as expected and then you can play the video, rotate the 
phone (portrait) still playing... rotate again and YouTube disappears. this 
does happen in a "regular web page" 

all working fine on iOS,

I have roll back a few commits, and then next I'll try Ralphs Hack... we use 
the same method "SivaSiva.livecode" is a stack that is always open, does the 
same job/app init as Ralph "stub-stack" 

BR




On 8/30/18 8:36 AM, Brian Milby via use-livecode wrote:
>  If setting the
> rect manually doesn't work, then there is an issue that is deeper than just
> knowing what the rect needs to be.
>
> From earlier in the thread it appears that on Android, the first
> "resizestack" is not getting sent.  You don't get one until you rotate the
> device.  What I'm not clear about is whether you can set the rect of the
> stack to the known screen rect and have it display correctl

-- 
Svasti Astu, Be Well!
Brahmanathaswami
 
Get the SivaSiva app, it's free:
https://www.himalayanacademy.com/apps/sivasiva


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-31 Thread Brian Milby via use-livecode
I still think you are working too hard.  I just put this on my Fire.  (I
had to manually code the FSM).  This short handler sets everything properly:

on fixBackground
   local tCardW, tScreenW, tScreenH, tNewH, tRect
   put the width of this card into tCardW
   put the effective working screenRect into tRect
   put item 3 of tRect - item 1 of tRect into tScreenW
   put item 4 of tRect - item 2 of tRect into tScreenH
   put tCardW / (tScreenW / tScreenH) into tNewH
   set the height of grc "bkg" to tNewH
   set the loc of grc "bkg" to the loc of this card
   set the top of grc "lineTop" to item 2 of the rect of grc "bkg"
   set the bottom of grc "lineBottom" to item 4 of the rect of grc "bkg"
end fixBackground

The problem with the lines being off screen is that you need to use the
"effective working screenrect" to account for the area that you cannot
address.  On iOS, the top of the screen is within the card rect.  On the
Fire, it is not.  On my device, the top 24px are reserved.

Brian

On Fri, Aug 31, 2018 at 10:06 AM Ludovic THEBAULT via use-livecode <
use-livecode@lists.runrev.com> wrote:

>
> > Le 30 août 2018 à 20:44, Ludovic THEBAULT via use-livecode <
> use-livecode@lists.runrev.com> a écrit :
> >
> > You can download my test stack here :
> > https://www.dropbox.com/s/iwwm2syiqzqamtg/testsubstack2.livecode?dl=1
> >
> > Note : my script doesn’t work properly : i tested it on an android
> tablet and the result is not accurate.
>
>
> I updated the script, now it’s work for all screen size (in fullscreenmode
> showall). You can also test for other fullscreenmode.
> I noticed that with some devices the top and bottom of the screenrect
> could be slightly hidden by the physical border of the screen (about ten
> pixels). I added a button to shift the dotted lines representing the screen
> boundaries by 10 pixels with each click to test this.
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-31 Thread Ludovic THEBAULT via use-livecode

> Le 30 août 2018 à 20:44, Ludovic THEBAULT via use-livecode 
>  a écrit :
> 
> You can download my test stack here :
> https://www.dropbox.com/s/iwwm2syiqzqamtg/testsubstack2.livecode?dl=1
> 
> Note : my script doesn’t work properly : i tested it on an android tablet and 
> the result is not accurate.


I updated the script, now it’s work for all screen size (in fullscreenmode 
showall). You can also test for other fullscreenmode.
I noticed that with some devices the top and bottom of the screenrect could be 
slightly hidden by the physical border of the screen (about ten pixels). I 
added a button to shift the dotted lines representing the screen boundaries by 
10 pixels with each click to test this.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-30 Thread Ludovic THEBAULT via use-livecode

> Le 30 août 2018 à 17:14, Sannyasin Brahmanathaswami via use-livecode 
>  a écrit :
> 
> Ludovic
> 
> Can you copy that whole handler to the list?
> 
> round((item 4 of the screenrect*the systemscale)/2)-theight // +theight 
> 
> only seems partial?

Hello,

You can download my test stack here :
https://www.dropbox.com/s/iwwm2syiqzqamtg/testsubstack2.livecode?dl=0 


Note : my script doesn’t work properly : i tested it on an android tablet and 
the result is not accurate.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-30 Thread Brian Milby via use-livecode
In the above code, I don't see a "local sRect" declaration which would need
to be outside the handlers to work as intended.

What about just hard coding the rect as a test?  If you can set the stack
rect to what you know the screen to be that way, then we can proceed to
figure out why that value isn't getting there properly.  If setting the
rect manually doesn't work, then there is an issue that is deeper than just
knowing what the rect needs to be.

>From earlier in the thread it appears that on Android, the first
"resizestack" is not getting sent.  You don't get one until you rotate the
device.  What I'm not clear about is whether you can set the rect of the
stack to the known screen rect and have it display correctly.

I don't think Ludovic's code will help this particular issue since you are
having a problem getting the screen rect.  If you have the screen rect, you
shouldn't need to do anything with the scale.  You are doing everything
with logical pixels.

On Thu, Aug 30, 2018 at 10:36 AM Ralph DiMola via use-livecode <
use-livecode@lists.runrev.com> wrote:

> I don't use a sub-stack to move from the splash to the main GUI stack. My
> stub-stack (after using my hack to display the splash card correctly) does
> 1: load all library stacks, sets all behaviors/back scripts,... 2: a send
> in
> 10 ticks to a handler that opens the GUI stack. After that there is no
> issues with getting the correct card rect. The splash stack sits invisible
> in the background and houses the engine and any inclusions/extensions... Of
> course in the IDE the splash stack remains open and visible, but who cares?
>
> Ralph DiMola
> IT Director
> Evergreen Information Services
> rdim...@evergreeninfo.net
>
> -Original Message-
> From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On
> Behalf
> Of Sannyasin Brahmanathaswami via use-livecode
> Sent: Thursday, August 30, 2018 10:16 AM
> To: How to use LiveCode
> Cc: Sannyasin Brahmanathaswami
> Subject: Re: fullscreenmode and rect of a substack on mobile device ?
>
> Ha! One has to thank our community for "never giving up!"  That spirit
> alone
> is worth it weight in gold -- the Indy License!
>
> @ Brain  "Gee, why didn't I think of that!"
>
> Not calling as substack; I use this as navigation between mainstack (the
> splash screen and that has the stack files  is always open but hidden)
>
>
> command portal_GoStack cardOrStackObject
>
> # save where we are coming from locally
>
> put the short name of this stack into oStackName
>
> [snip]
>
> # Attempt to fix Android by dealing with mobile controls
>
> # and Accelereated Rendering from here
>
> # We deal with the each stack case
>
> if oStackName <> empty then
>
> # this is not the first run boot of portal
>
> deleteAllMobileControls # will destroy all except audioPlayer
>
> end if
>
> --> Variations on stack transition methods.
> --> timing is important, else android crashes
>
> set the acceleratedRendering of stack oStackName to false
>
> go cardOrStackObject
>
> # e.g go "gems" (or this string) go card 3 of "gems"
>
> wait 20 milliseconds with messages
>
> close stack oStackName
>
> wait 20 milliseconds with messages
>
> ## this does not work! -->
>
> ## go to cardOrStackObject in window oStackName
>
> end portal_GoStack
>
> So, since the whole app is running I could get the screenrect when the
> "portal" (index, TOC of the whole app) loads. And save to a local in main
> lib_SIvaSiva.livecodescript (always open)
>
> but still, I don't think screenRect will register in LC RAM *without*
> running "resizestack" so how would I force that?
>
> (thinking out loud) just running a handler to check may suffice to get the
> coords of the phone.
>
> local sMobileRect
> ...
> send "mobileRectSet" to me in 1 second
> end  portal_GoStack
>
> command mobileRectSet
>   put the screenRect into sMobileRect
> end mobileRectSet
>
> function mobileRectGet
> return sMobileRect
> end mobileRectGet
>
> I will try it
>
> @ Ralph
>
> Wow! That is quite a hack. I may try it. If the above  does not work.
>
> BR
>
>
> On 8/29/18 10:09 AM, Brian Milby via use-livecode wrote:
>
> Aren't you calling this as a sub-stack?  If so, could you capture the
> screen
> rect before the switch and pass in the data or cache to the file system and
> read it in?
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list

RE: fullscreenmode and rect of a substack on mobile device ?

2018-08-30 Thread Ralph DiMola via use-livecode
I don't use a sub-stack to move from the splash to the main GUI stack. My
stub-stack (after using my hack to display the splash card correctly) does
1: load all library stacks, sets all behaviors/back scripts,... 2: a send in
10 ticks to a handler that opens the GUI stack. After that there is no
issues with getting the correct card rect. The splash stack sits invisible
in the background and houses the engine and any inclusions/extensions... Of
course in the IDE the splash stack remains open and visible, but who cares?

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net

-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf
Of Sannyasin Brahmanathaswami via use-livecode
Sent: Thursday, August 30, 2018 10:16 AM
To: How to use LiveCode
Cc: Sannyasin Brahmanathaswami
Subject: Re: fullscreenmode and rect of a substack on mobile device ?

Ha! One has to thank our community for "never giving up!"  That spirit alone
is worth it weight in gold -- the Indy License!

@ Brain  "Gee, why didn't I think of that!"

Not calling as substack; I use this as navigation between mainstack (the
splash screen and that has the stack files  is always open but hidden)


command portal_GoStack cardOrStackObject

# save where we are coming from locally

put the short name of this stack into oStackName

[snip]

# Attempt to fix Android by dealing with mobile controls

# and Accelereated Rendering from here

# We deal with the each stack case

if oStackName <> empty then

# this is not the first run boot of portal

deleteAllMobileControls # will destroy all except audioPlayer

end if

--> Variations on stack transition methods.
--> timing is important, else android crashes

set the acceleratedRendering of stack oStackName to false

go cardOrStackObject

# e.g go "gems" (or this string) go card 3 of "gems"

wait 20 milliseconds with messages

close stack oStackName

wait 20 milliseconds with messages

## this does not work! -->

## go to cardOrStackObject in window oStackName

end portal_GoStack

So, since the whole app is running I could get the screenrect when the
"portal" (index, TOC of the whole app) loads. And save to a local in main
lib_SIvaSiva.livecodescript (always open)

but still, I don't think screenRect will register in LC RAM *without*
running "resizestack" so how would I force that?

(thinking out loud) just running a handler to check may suffice to get the
coords of the phone.

local sMobileRect
...
send "mobileRectSet" to me in 1 second
end  portal_GoStack

command mobileRectSet
  put the screenRect into sMobileRect
end mobileRectSet

function mobileRectGet
return sMobileRect
end mobileRectGet

I will try it

@ Ralph

Wow! That is quite a hack. I may try it. If the above  does not work.

BR


On 8/29/18 10:09 AM, Brian Milby via use-livecode wrote:

Aren't you calling this as a sub-stack?  If so, could you capture the screen
rect before the switch and pass in the data or cache to the file system and
read it in?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-30 Thread Sannyasin Brahmanathaswami via use-livecode
I tried it.

Sure, I get the screenrect in advance; I put an answer sRect in a one stack 
opencard script...

I get an answer...

but this does not work on the stack the has browser...

so I now suspect to browser widget is blocking "registration" the screen rect. 
Now only that it may be blocking openCard handler.


on preopencard

if isMobile() then

put mobileRectGet() into sRect

send "setUpStackRect" to me in 500 milliseconds

end if

end preopencard

on opencard

answer sRect with "OK"  # does not fire...

end opencard


openstack

On 8/30/18 4:24 AM, Sannyasin Brahmanathaswami via use-livecode wrote:

but still, I don't think screenRect will register in LC RAM *without* running 
"resizestack" so how would I force that?

(thinking out loud) just running a handler to check may suffice to get the 
coords of the phone.

local sMobileRect
...
send "mobileRectSet" to me in 1 second
end  portal_GoStack

command mobileRectSet
  put the screenRect into sMobileRect
end mobileRectSet

function mobileRectGet
return sMobileRect
end mobileRectGet

I will try it

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-30 Thread Sannyasin Brahmanathaswami via use-livecode
Ludovic

Can you copy that whole handler to the list?

round((item 4 of the screenrect*the systemscale)/2)-theight // +theight 

only seems partial?

On 8/19/18 6:11 PM, Ludovic THEBAULT via use-livecode wrote:
> But i found i can get the « real » top and bottom with : round((item 4 of the 
> screenrect*the systemscale)/2)-theight // +theight (for the bottom)
> where theight is the height of my stack before fullscreenmode.



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-30 Thread Sannyasin Brahmanathaswami via use-livecode
Ha! One has to thank our community for "never giving up!"  That spirit alone is 
worth it weight in gold -- the Indy License!

@ Brain  "Gee, why didn't I think of that!"

Not calling as substack; I use this as navigation between mainstack (the splash 
screen and that has the stack files  is always open but hidden)


command portal_GoStack cardOrStackObject

# save where we are coming from locally

put the short name of this stack into oStackName

[snip]

# Attempt to fix Android by dealing with mobile controls

# and Accelereated Rendering from here

# We deal with the each stack case

if oStackName <> empty then

# this is not the first run boot of portal

deleteAllMobileControls # will destroy all except audioPlayer

end if

--> Variations on stack transition methods.
--> timing is important, else android crashes

set the acceleratedRendering of stack oStackName to false

go cardOrStackObject

# e.g go "gems" (or this string) go card 3 of "gems"

wait 20 milliseconds with messages

close stack oStackName

wait 20 milliseconds with messages

## this does not work! -->

## go to cardOrStackObject in window oStackName

end portal_GoStack

So, since the whole app is running I could get the screenrect when the "portal" 
(index, TOC of the whole app) loads. And save to a local in main 
lib_SIvaSiva.livecodescript (always open)

but still, I don't think screenRect will register in LC RAM *without* running 
"resizestack" so how would I force that?

(thinking out loud) just running a handler to check may suffice to get the 
coords of the phone.

local sMobileRect
...
send "mobileRectSet" to me in 1 second
end  portal_GoStack

command mobileRectSet
  put the screenRect into sMobileRect
end mobileRectSet

function mobileRectGet
return sMobileRect
end mobileRectGet

I will try it

@ Ralph

Wow! That is quite a hack. I may try it. If the above  does not work.

BR


On 8/29/18 10:09 AM, Brian Milby via use-livecode wrote:

Aren't you calling this as a sub-stack?  If so, could you capture the
screen rect before the switch and pass in the data or cache to the file
system and read it in?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: fullscreenmode and rect of a substack on mobile device ?

2018-08-29 Thread Ralph DiMola via use-livecode
This function does a lot but takes care of the bad screen rect on startup.
It also allows for either sliding up the screen or shrinking the screen. It
also allows for the iPhone X safe area. If you get the aspect ratio in the
IDE like the iPhone X you can see how the app will look in the safe area. I
roll my own control placement using getCardRect to define the screen area. I
also always set the pixelScale to 1. This was written on day 2 of using
LiveCode so it's not pretty. The nuts and bolts of the bad rect on startup
is the line==> "if R2<0 and not the KeyboardOffset of this stack is a number
then"

The bad rect thing started way back in the middle of the 6s I think
This might not help if you use the built in geometry tools, but for what
it's worth getCardRect has never failed me 

function getCardRect
   
   /* Hi all ... if this is helpful to anyone, I've been able to work out
the exact pixel values for the safe area for 
   /*iPhone X using Xcode 9.0.
   
   iPhone X overall dimensions
   2436 x 1125 pixels
   
   Overall safe area
   2172 x 1062 pixels
   
   Left & right insets (accounts for the notch and curved corners, plus a
margin)
   132 pixels each
   
   Bottom inset (accounts for the bottom nav bar)
   63 pixels
   
   Top inset zero pixels
   
   Portrait dimensions  Landscape dimensions
   1125px × 2436px (375pt × 812pt @3x)  2436px × 1125px (812pt × 375pt @3x)
   
   Portrait right side up:
   Left: 0
   Top: 44 Pts 132 Pixels
   Right: 0
   Bottom: 34 Pts 102 Pixels
   
   Portrait upside down: NOT SUPPORTED
   
   Landscape left and right:
   Left: 16 Pts 48 Pixels
   Top: 32 Pts 96 Pixels
   Right: 16 Pts 48 Pixels
   Bottom: 23 Pts 69 Pixels
   
   
   */
   
   local r1 , r2 , r3 , r4 , tR2 , tR4
   
   --return the rect of this card
   if the environment is not "mobile" then
  put item 1 of the rect of this card into R1
  put item 2 of the rect of this card into R2
  put item 3 of the rect of this card into R3
  put item 4 of the rect of this card into R4
   else -- Mobile
  --put the screenrect into tRectTemp
  if the ignorekeyboard of this stack then
 put item 1 of the rect of this card into R1
 put item 2 of the rect of this card into R2
 put item 3 of the rect of this card into R3
 put item 4 of the rect of this card into R4
 --answer "Here 1"
  else -- Dont Ignore Keyboard
 --answer "Here 2"
 put 0 into R1
 put item 3 of the effective working screenrect - item 1 of the
effective working screenrect into R3
 if the ShrinkKeyboard of this stack then
--answer "Here 3"
put 0 into R2
put item 4 of the effective working screenrect - item 2 of the
effective working screenrect into R4
 else -- Dont Shrink Keyboard Slide Up if Instructed
--answer "Here 4"
put item 2 of the rect of this card into R2
put item 4 of the rect of this card into R4
if the KeyboardOffset of this stack is not empty and the
KeyboardOffset of this stack is a number then -- Slide Up
   --answer "Here 5"
   --put (item 2 of the effective working screenrect - the
KeyboardOffet of this stack) into tR2
   --put (item 4 of the effective working screenrect - the
KeyboardOffet of this stack) into tR4
   put R2 - the KeyboardOffset of this stack into tR2
   put R4 - the KeyboardOffset of this stack into tR4
   if tR4 > tR2 then
  --answer "Here 6",tR2,tR4
  put tR2 into R2
  put tR4 into R4
   end if -- Offset out of range
end if -- Keyboard Offset
 end if -- Shrink Keyboard
  end if --Ignore Keyboard
   end if -- Mobile
   if R2<0 and not the KeyboardOffset of this stack is a number then
  --answer "Here 7",R2,R4
  put abs(R2) + R4 into R4
  put 0 into R2
   end if
   --return (R1,R2,R3,R4)
   if the platform = "iPhone" or Dev () then
  switch
 case the width of this card = 1125 and the height of this card =
2436 -- Portrait iPhone X
return (R1,R2+132,R3,R4-102)
break
 case the width of this card = 2436 and the height of this card =
1125  -- Landscape iPhone X
return (R1+48,R2+96,R3-48,R4-69)
break
 case Dev() and the width of this card / the height of this card >=
.455 and  \
   the width of this card / the height of this card <= .467  --
Portrait iPhone X
return (R1,R2+(132*(the height of this card /
2436)),R3,R4-(102*(the height of this card / 2436)))
break
 case Dev() and the height of this card / the width of this card >=
.455 and  \
   the height of this card / the width of this card <= .467  --
Landscape iPhone X
return (R1+(48*(the width of this card / 2436)),R2+(96*(the
height of this card 

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-29 Thread Brian Milby via use-livecode
Aren't you calling this as a sub-stack?  If so, could you capture the
screen rect before the switch and pass in the data or cache to the file
system and read it in?

On Wed, Aug 29, 2018 at 2:39 PM Sannyasin Brahmanathaswami via use-livecode
 wrote:

> @Hugh
>
> quick update
>
> your code worked; but only after turning the phone (resize handler sent)
>
> but on preopenstack, preopencard, or opencard
>
> setupStackRect
>
>
> fails,  because the screenRect is not registered yet (my guess, might be
> something else)
>
> https://quality.livecode.com/show_bug.cgi?id=21538
>
>
> As a result browser is out a place.
>
> Fortunately the user can hit the hardware button  to go back. So not
> having my footer is "not big deal." Android users are using to doing that.
>
> So I'm going to release Google Play, can't wait any longer.
>
> But if anyone else expects the screenrect to work on
>
> preopenstack, preopencard, or opencard
>
> if you having trouble.. that's the reason
>
> BR
>
>
>
> on Android the device does not appear to "know it rect)
>
> On 8/24/18 4:20 AM, Sannyasin Brahmanathaswami via use-livecode wrote:
> > I caught typo.
> >
> > I get it to work on iOS but not an Android, so I have a ticket to
> support and that.
> >
> > in an app, there is a lot change from on stack another, I frequently
> have add time from Android to keep up (never on iOS)
> >
> > This is so straight  forward, I have to assume there is bug (just a
> quess) in the browser widget "knowing" about the screenRect on Android.
> > I get the screenrect ( on a button the answer the screen rect) but
> the browser widget does pay attention to this following
> >
> >
> >
> > on preopenstack
> >
> > if isMobile() then
> >
> > mobileSetAllowedOrientations "portrait,portrait upside
> down,landscape left,landscape"
> >
> > end if
> >
> > end preopenstack
> >
> > --
> >
> > # Geometry
> >
> > on preopencard
> >
> > if isMobile() then
> >
> > send "setUpStackRect" to me in 500 milliseconds
> >
> > end if
> >
> > end preopencard
> >
> > on setupStackRect pWidth,pHeight
> >
> > if pWidth="" and pHeight="" then
> >
> > put the 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 pWidth into item 3 of tRect
> >
> > put pHeight into item 4 of tRect
> >
> > 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 round((item 3 of tRect)/2),(item 4 of
> tRect)-25
> >
> > subtract 50 from item 4 of tRect
> >
> > set the rect of widget "body" to tRect
> >
> > set the topleft of widget "body" to item 1 to 2 of 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 ( round(pNewWidth/2),
> round(pNewHeight/2) )
> >
> > hide group "footer"
> >
> > else
> >
> > put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
> >
> > set loc group "footer" to ( round(pNewWidth/2),pNewHeight-25)
> >
> > show group "footer"
> >
> > end if
> >
> > set the rect of widget "body" of me to tBrowserRect
> >
> > end resizeStack
> >
> >
> >  On 8/23/18 10:17 PM, FlexibleLearning.com via use-livecode wrote:
> >
> > First, I think you have a typo where "/25" should be "-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
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-29 Thread Sannyasin Brahmanathaswami via use-livecode
@Hugh

quick update

your code worked; but only after turning the phone (resize handler sent)

but on preopenstack, preopencard, or opencard

setupStackRect


fails,  because the screenRect is not registered yet (my guess, might be
something else)

https://quality.livecode.com/show_bug.cgi?id=21538


As a result browser is out a place.

Fortunately the user can hit the hardware button  to go back. So not
having my footer is "not big deal." Android users are using to doing that.

So I'm going to release Google Play, can't wait any longer.

But if anyone else expects the screenrect to work on

preopenstack, preopencard, or opencard

if you having trouble.. that's the reason

BR



on Android the device does not appear to "know it rect)

On 8/24/18 4:20 AM, Sannyasin Brahmanathaswami via use-livecode wrote:
> I caught typo.
>
> I get it to work on iOS but not an Android, so I have a ticket to support and 
> that.
>
> in an app, there is a lot change from on stack another, I frequently have add 
> time from Android to keep up (never on iOS)
>
> This is so straight  forward, I have to assume there is bug (just a quess) in 
> the browser widget "knowing" about the screenRect on Android.
> I get the screenrect ( on a button the answer the screen rect) but the 
> browser widget does pay attention to this following
>
>
>
> on preopenstack
>
> if isMobile() then
>
> mobileSetAllowedOrientations "portrait,portrait upside 
> down,landscape left,landscape"
>
> end if
>
> end preopenstack
>
> --
>
> # Geometry
>
> on preopencard
>
> if isMobile() then
>
> send "setUpStackRect" to me in 500 milliseconds
>
> end if
>
> end preopencard
>
> on setupStackRect pWidth,pHeight
>
> if pWidth="" and pHeight="" then
>
> put the 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 pWidth into item 3 of tRect
>
> put pHeight into item 4 of tRect
>
> 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 round((item 3 of tRect)/2),(item 4 of tRect)-25
>
> subtract 50 from item 4 of tRect
>
> set the rect of widget "body" to tRect
>
> set the topleft of widget "body" to item 1 to 2 of 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 ( round(pNewWidth/2), round(pNewHeight/2) )
>
> hide group "footer"
>
> else
>
> put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
>
> set loc group "footer" to ( round(pNewWidth/2),pNewHeight-25)
>
> show group "footer"
>
> end if
>
> set the rect of widget "body" of me to tBrowserRect
>
> end resizeStack
>
>
>  On 8/23/18 10:17 PM, FlexibleLearning.com via use-livecode wrote:
>
> First, I think you have a typo where "/25" should be "-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



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-24 Thread J. Landman Gay via use-livecode
It's more complicated than that. Using the iPad Air simulator and this 
preOpenCard handler:


on preopenstack
  mobileSetAllowedOrientations("portrait")
  iphoneUseDeviceResolution true,true
end preopenstack

When I press the "Get the rect" button it reports the stack, card, and 
screenrect are all 0,0,640,960. Also, the right and bottom of the stack 
are clipped and the controls are not centered, they're shifted right and 
down.


If I comment out iphoneUseDeviceResolution so that only the orientation 
is set, the stack is huge, runs off the right and bottom, and no fields 
or buttons are shown because they are offscreen. I see only the topleft 
corner of the stack. I don't know what it thinks the rects are because I 
can't see the buttons.


If I hit the 1X button in the simulator, which doubles the resolution to 
emulate retina, the card gets half as big, floats in the middle of the 
screen, and still shows only the topleft corner of the stack (no buttons 
or fields.)


If I change the handler to this:

on preopenstack
  mobileSetAllowedOrientations("portrait")
  set the fullscreenmode of stack "ipad" to "showall"
end preopenstack

The stack doesn't fill the screen and leaves blank, black edges at sides 
and bottom. The content does not resize, showing the default card color 
at the top and bottom of the card. The button reports:


Stack rect: 469,116,1237,1140
Card rect: 0,0,768,1024
Screenrect: 0,0,320,480

An iPad with a screenrect of 320x480? When I was trying to fix this with 
a resizing handler similar to what you wrote, nothing I did would change 
the stack rect. It stayed stuck at 640x960 with black, blank edges 
around it.



On 8/24/18 4:38 PM, Brian Milby via use-livecode wrote:

H
So it reports that the stack and screen are 768/1024 yet does not fill the 
screen? That is very odd. For me it did fill the screen until I changed it to 
be short on purpose.




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-24 Thread Brian Milby via use-livecode
H
So it reports that the stack and screen are 768/1024 yet does not fill the 
screen? That is very odd. For me it did fill the screen until I changed it to 
be short on purpose.

And yes, the sim is pretty fast once it boots.

Thanks,
Brian
On Aug 24, 2018, 4:26 PM -0500, J. Landman Gay via use-livecode 
, wrote:
> That's the deal though...it shouldn't need to resize at all, but in the
> simulator it doesn't fill the screen. The XCode simulators are really
> fast though. If you ever do get into Android, avoid their emulator, it's
> dog slow.
>
> This thread is approaching cheese dimensions. I hope non-interested
> parties have good email filters. ;)
>
>
> On 8/24/18 3:50 PM, Brian Milby via use-livecode wrote:
> > I was just able to test in the iPad Air. It does not need to resize
> > though. In order to do an effective test, I shrank the stack by 100 px
> > (just moved all the stuff at the bottom up that much and shortened the
> > stack height).
> >
> > At that point, if I included my "fixBackground" handler in the
> > (pre)openCard/Stack, then it would end up with the whole screen orange.
> > Using the button would move the lines to the top/bottom, but I just use my
> > handler and the last 2 lines to move the lines.
> >
> > On Fri, Aug 24, 2018 at 2:56 PM, Brian Milby  wrote:
> >
> > > I never even try the sim. I’ll give it a try this weekend though.
> > > None of the regular iPads should require a resize. Only the pro models
> > > have a different rect.
> > >
> > > Thanks,
> > > Brian
> > > On Aug 24, 2018, 2:39 PM -0500, J. Landman Gay via use-livecode <
> > > use-livecode@lists.runrev.com>, wrote:
> > >
> > > On 8/23/18 8:30 PM, Brian Milby via use-livecode wrote:
> > >
> > > The original stack worked fine on my iPad (since it was sized at the same
> > > resolution).
> > >
> > >
> > > Maybe I chose the wrong simulator, but on an iPad Air it failed to
> > > resize correctly with or without FSM. I looked up the screenrect and it
> > > claimed to be the same size as the stack. So maybe the problem is the
> > > simulator?
> > >
> > > --
> > > Jacqueline Landman Gay | jac...@hyperactivesw.com
> > > HyperActive Software | http://www.hyperactivesw.com
> > >
> > > ___
> > > use-livecode mailing list
> > > use-livecode@lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > >
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your 
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-24 Thread J. Landman Gay via use-livecode
That's the deal though...it shouldn't need to resize at all, but in the 
simulator it doesn't fill the screen. The XCode simulators are really 
fast though. If you ever do get into Android, avoid their emulator, it's 
dog slow.


This thread is approaching cheese dimensions. I hope non-interested 
parties have good email filters. ;)



On 8/24/18 3:50 PM, Brian Milby via use-livecode wrote:

I was just able to test in the iPad Air.  It does not need to resize
though.  In order to do an effective test, I shrank the stack by 100 px
(just moved all the stuff at the bottom up that much and shortened the
stack height).

At that point, if I included my "fixBackground" handler in the
(pre)openCard/Stack, then it would end up with the whole screen orange.
Using the button would move the lines to the top/bottom, but I just use my
handler and the last 2 lines to move the lines.

On Fri, Aug 24, 2018 at 2:56 PM, Brian Milby  wrote:


I never even try the sim. I’ll give it a try this weekend though.
None of the regular iPads should require a resize. Only the pro models
have a different rect.

Thanks,
Brian
On Aug 24, 2018, 2:39 PM -0500, J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com>, wrote:

On 8/23/18 8:30 PM, Brian Milby via use-livecode wrote:

The original stack worked fine on my iPad (since it was sized at the same
resolution).


Maybe I chose the wrong simulator, but on an iPad Air it failed to
resize correctly with or without FSM. I looked up the screenrect and it
claimed to be the same size as the stack. So maybe the problem is the
simulator?

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode




--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-24 Thread Brian Milby via use-livecode
I was just able to test in the iPad Air.  It does not need to resize
though.  In order to do an effective test, I shrank the stack by 100 px
(just moved all the stuff at the bottom up that much and shortened the
stack height).

At that point, if I included my "fixBackground" handler in the
(pre)openCard/Stack, then it would end up with the whole screen orange.
Using the button would move the lines to the top/bottom, but I just use my
handler and the last 2 lines to move the lines.

On Fri, Aug 24, 2018 at 2:56 PM, Brian Milby  wrote:

> I never even try the sim. I’ll give it a try this weekend though.
> None of the regular iPads should require a resize. Only the pro models
> have a different rect.
>
> Thanks,
> Brian
> On Aug 24, 2018, 2:39 PM -0500, J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com>, wrote:
>
> On 8/23/18 8:30 PM, Brian Milby via use-livecode wrote:
>
> The original stack worked fine on my iPad (since it was sized at the same
> resolution).
>
>
> Maybe I chose the wrong simulator, but on an iPad Air it failed to
> resize correctly with or without FSM. I looked up the screenrect and it
> claimed to be the same size as the stack. So maybe the problem is the
> simulator?
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-24 Thread Brian Milby via use-livecode
I never even try the sim. I’ll give it a try this weekend though.
None of the regular iPads should require a resize. Only the pro models have a 
different rect.

Thanks,
Brian
On Aug 24, 2018, 2:39 PM -0500, J. Landman Gay via use-livecode 
, wrote:
> On 8/23/18 8:30 PM, Brian Milby via use-livecode wrote:
> > The original stack worked fine on my iPad (since it was sized at the same
> > resolution).
>
> Maybe I chose the wrong simulator, but on an iPad Air it failed to
> resize correctly with or without FSM. I looked up the screenrect and it
> claimed to be the same size as the stack. So maybe the problem is the
> simulator?
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-24 Thread J. Landman Gay via use-livecode

On 8/23/18 8:30 PM, Brian Milby via use-livecode wrote:

The original stack worked fine on my iPad (since it was sized at the same
resolution).


Maybe I chose the wrong simulator, but on an iPad Air it failed to 
resize correctly with or without FSM. I looked up the screenrect and it 
claimed to be the same size as the stack. So maybe the problem is the 
simulator?


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-24 Thread Sannyasin Brahmanathaswami via use-livecode
I caught typo.

I get it to work on iOS but not an Android, so I have a ticket to support and 
that.

in an app, there is a lot change from on stack another, I frequently have add 
time from Android to keep up (never on iOS)

This is so straight  forward, I have to assume there is bug (just a quess) in 
the browser widget "knowing" about the screenRect on Android.
I get the screenrect ( on a button the answer the screen rect) but the 
browser widget does pay attention to this following



on preopenstack

if isMobile() then

mobileSetAllowedOrientations "portrait,portrait upside 
down,landscape left,landscape"

end if

end preopenstack

--

# Geometry

on preopencard

if isMobile() then

send "setUpStackRect" to me in 500 milliseconds

end if

end preopencard

on setupStackRect pWidth,pHeight

if pWidth="" and pHeight="" then

put the 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 pWidth into item 3 of tRect

put pHeight into item 4 of tRect

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 round((item 3 of tRect)/2),(item 4 of tRect)-25

subtract 50 from item 4 of tRect

set the rect of widget "body" to tRect

set the topleft of widget "body" to item 1 to 2 of 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 ( round(pNewWidth/2), round(pNewHeight/2) )

hide group "footer"

else

put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect

set loc group "footer" to ( round(pNewWidth/2),pNewHeight-25)

show group "footer"

end if

set the rect of widget "body" of me to tBrowserRect

end resizeStack


 On 8/23/18 10:17 PM, FlexibleLearning.com via use-livecode wrote:

First, I think you have a typo where "/25" should be "-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

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-24 Thread FlexibleLearning.com via use-livecode
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


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-23 Thread Brian Milby via use-livecode
@ Sannyasin Brahmanathaswami

I was finally able to take some time and load the _r9 version of your demo
stack.  When initially loaded, the image did fill the browser window, but
when I pressed the play button it did not take over the entire screen.
When I rotated, it did resize as expected.  I'm not sure if the web code
changed or if I just don't see the issue.  My test was a iPad 6G.  I'm
using 9.0.1rc2 to build my tests.

In your latest response about layout when the stack opens... is that on
Android and iPad?  I do not see that issue on my iPhone/iPad.  Since the
stack is designed at the Plus size, no surprise on my phone.  But it also
resizes properly on load on my iPad.  I had my mobileProfile stack
configured with a button to launch your stack (which should be similar to
how you would be using it).

Here's a preOpenCard that you could try:

on preOpenCard
   local tRect
   if isMobile() then
 mobileSetAllowedOrientations "portrait,portrait upside down,landscape
left,landscape right"
  end if
  put the effective working screenrect into tRect
  resizeStack item 3 of tRect, item 4 of tRect
end preOpenCard

I don't see any difference with that code in place for my devices.

Thanks,
Brian
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-23 Thread Brian Milby via use-livecode
@Ludovic / @Jacque

If you are just wanting a background to cover the extra space, why not just
make it oversized and not worry about adjusting it?

The original stack worked fine on my iPad (since it was sized at the same
resolution).  I made it a substack of another one and used a button to "go
stack ipad".  It filled the entire screen.  On my iPhone 8 Plus, the resize
did not work correctly.  Here's a handler that will take care of it on my
phone properly:

on fixBackground
   local tCardW, tScreenW, tScreenH, tNewH
   put the width of this card into tCardW
   put item 3 of the screenrect into tScreenW
   put item 4 of the screenrect into tScreenH
   put tCardW / (tScreenW / tScreenH) into tNewH
   set the height of grc "bkg" to tNewH
   set the loc of grc "bkg" to the loc of this card
end fixBackground

I added the size logging to the `openCard` handler and everything reports
the dimensions of the phone (this stack/this cd/stack "ipad").  Same
numbers before/after the FSM call.  If I did a send "fixbackground" to me
in 0 ms, then it was wrong (based on screenrect).  If I did a send
"fixbackground" to me in 10 ms then it worked fine (I can see the
background jump though).

The above code only works in one direction (W/H ratio is smaller than
iPad).  To cover both variations, you would need to check and possibly do
the opposite (adjust the background width).  I don't know if any
phones/tablets would cause an issue there.  The code wouldn't be difficult
though.

As to the location of the stack... since resize is not sent when in FSM,
the stack is reporting the rect from when it was last saved on the
desktop.  It doesn't really matter though.  My approach doesn't care about
the actual stack rect, only the H/W dimensions.

Thanks,
Brian
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-23 Thread J. Landman Gay via use-livecode

On 8/23/18 12:59 AM, Ludovic THEBAULT via use-livecode wrote:



Le 22 août 2018 à 22:24, J. Landman Gay via use-livecode 
 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.

But your previous script must used on android.


The strange thing about your stack is that it doesn't fill the screen on 
an iPad no matter what I try. I turned off FSM entirely, and did this on 
preopenstack:


on preopenstack
  mobileSetAllowedOrientations("portrait")
  set the rect of this stack to the screenrect
end preopenstack

Even that doesn't work. The stack simply won't resize, there are still 
blank areas around all four edges. I next removed the line that sets the 
rect, and allowed LC to resize it by default with the same results.


I decided to try it on Android. PreOpenStack is this:

on preopenstack
  mobileSetAllowedOrientations("portrait")
  set the fullscreenmode of stack "ipad" to "noborder"
end preopenstack

This works perfectly, the entire screen is filled as expected, the "get 
rect" button reports accurate information, and no size adaptation is 
necessary. All objects were placed correctly on screen without distortion.


I then tried it in the iPhone 6 Plus simulator. That worked perfectly 
too. Only the iPad failed. Thinking it might be related to actual size, 
I resized the stack to 640x960 (the screenrect reported on iPad with 
iPhoneUseDeviceResolution true) but that didn't work either.


It would be useful for someone with a real iPad to try a test. If it 
doesn't work there then I think the LC team should look.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-23 Thread Sannyasin Brahmanathaswami via use-livecode
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

put tHeight into item 4 of tRect

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 )

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



On 8/23/18 2:21 AM, FlexibleLearning.com via use-livecode wrote:

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"

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-23 Thread FlexibleLearning.com via use-livecode
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
 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.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-23 Thread Ludovic THEBAULT via use-livecode

> Le 22 août 2018 à 22:24, J. Landman Gay via use-livecode 
>  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.

But your previous script must used on android.

Thanks again.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-22 Thread J. Landman Gay via use-livecode

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

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-22 Thread J. Landman Gay via use-livecode

On 8/21/18 2:11 PM, Ludovic THEBAULT via use-livecode wrote:


But even « the rect of this cd » return the rect of the stack i created 
(0,0,768,1024) not the rect of the screen.
I’ve made a test stack. It’s an « iPad » stack. Test it with iOS simulator on 
an iPhone device.
https://www.dropbox.com/s/iwwm2syiqzqamtg/testsubstack2.livecode?dl=0

Click on « get the rect » and click on « Adapt » to set the rect of the 
background to the rect of the screen


I played with this for a while. I changed the opencard handler to a 
preOpenCard, which is when FSM is usually set. But there's something odd 
going on. When I tap the "get rect" button it says:


Rect of this stack: 170,172,938,1196
Rect of this cd: 0,0,768,1024
Screenrect: 0,0,320,480

If I use "exactfit" instead of "showAll" it does sort of work and is an 
easier way to get what you scripted. Since your app is targeted only for 
iPad, exactFit may be one of the few times it's appropriate. That said, 
it still isn't resizing to the screen even with "exactFit", and it 
should. Using "NoBorder" also gives the same results where it shouldn't.


I was able to repro your scripted solution by setting fullscreenMode to 
"noBorder" and simplifying the "adapt" script this way:


on adaptrect
  put the height of this cd into tHt
  put the width of this cd into tWd
  set the rect of this stack to 0,0,tWd,tHt -- doesn't really do that
  set the rect of grc "bkg" to 0,0,tWd,tHt
  put "Rect of bg = real rect :" & the rect of grc "bkg"  after fld "datas"
  set the top of grc "lineTop" to 0
  set the bottom of grc "lineBottom" to tHt
end adaptrect

But the stack should still fill the screen and it doesn't. Either I'm 
missing something or there's a problem with FSM.


Tested in LC 9.0.1 rc1, as it's the only version I have a compatible 
XCode for. I wonder if it's different in LC 8.x.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Richard Gaskin via use-livecode

Brian Milby wrote:

> Richard wrote:
>> ...another useful detail when placing things within groups under
>> most circumstances is to set the lockLoc of the group and everything
>> within it.  So much becomes so simple that way, and without it the
>> automatic accommodate of interior objects within a group can
>> sometimes be mystifying.  All that becomes confidently predictable
>> with lockLoc.
>
> @Richard, could you elaborate on the lockLoc?  I assume you are
> talking about the part where the group will not resize based on
> control positions within and that if you set H/W of a control the
> topLeft remains the same along with images not resizing back to
> their source's size.  Did I miss anything?

By default groups are unlocked and resize to accommodate whatever's 
within them.  If you move something within the group, the group will 
adjust itself to what is more or less its formattedRect.


This is often useful if you're using the group as a general container, 
but starts to get squirrelly when you're moving stuff within the group 
from the group's own script and the rect of the group matters to your 
layout.


The sequence is:

- A group gets its resizeControl, where it moves its
  interior controls.

- Moving an interior control may alter the rect of the group
  to something different from what the card script intended.

- Depending on the placement of things, a change to the group's
  rect may also move other controls within it.

LockLoc locks things down so they only change according to what your 
script dictates.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Brian Milby via use-livecode
@Richard, could you elaborate on the lockLoc?  I assume you are talking
about the part where the group will not resize based on control positions
within and that if you set H/W of a control the topLeft remains the same
along with images not resizing back to their source's size.  Did I miss
anything?
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Bob Sneidar via use-livecode
Winner gets to eat the worm! 

Bob S


> On Aug 21, 2018, at 13:43 , Richard Gaskin via use-livecode 
>  wrote:
> 
> J. Landman Gay wrote:
> 
> > But yeah, maybe you and I could team up and do a one-on-one debate.
> > Someone could set up a rope ring and we could wear boxing gloves. :)
> 
> Given that we've never disagreed on how to solve a specific resizing problem, 
> I would imagine it would be the most boring debate ever.
> 
> Let's at least spice it up with tequila. If we make it into an interactive 
> drinking game with the audience we may have a winner. :)


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Richard Gaskin via use-livecode

J. Landman Gay wrote:

> But yeah, maybe you and I could team up and do a one-on-one debate.
> Someone could set up a rope ring and we could wear boxing gloves. :)

Given that we've never disagreed on how to solve a specific resizing 
problem, I would imagine it would be the most boring debate ever.


Let's at least spice it up with tequila. If we make it into an 
interactive drinking game with the audience we may have a winner. :)



> On 8/21/18 1:26 PM, Richard Gaskin via use-livecode wrote:
>> The stretch-or-gap solution FSM provides can be an excellent fit for
>> those
>
> That's where I think you're missing something. Those aren't the only
> options. Nobody uses stretch (not even Monument Valley) due to the
> distortion.

When stretched proportionately there is no distortion.  It's just larger.

Monument Valley stretches proportionately.


> But you aren't limited to seeing gaps, there are ways to avoid that.

The gaps need not be blank.

Monument Valley centers its content region within a generous decorative 
backdrop, so the unused portions of the screen are rendered as a 
continuation of the background art.


Proportionality avoids gaps where the ratio is constant.  Change the 
ratio, and the layout can either extend outside the screen or have a gap 
within it. I can't conceive of how it could do anything either than one 
or both of those.



> The result is closer to what you describe with manual resizing. No
> gaps, and use of the edges around the stack.
>
> I do agree we should use whatever method is best for our needs, so
> we're in sync there. But I think you are doing way more work than you
> need to.

How would it be used to make an email form that looks great on both a 4" 
phone and an 11" tablet, in both orientations on each?


How can FSM be used to produce the layouts of Evernote, or Twitter, or 
SimpleNote, or Maps, or Instagram, etc.?


My experience with FSM is admittedly limited. Its description suggests 
it does not attempt to make intelligent decisions about the placement of 
specific controls relative to each other, or make some objects wider 
while preserving their height, etc.


If I've missed something and there's a way to get a 70px button to 
remain 70px but at a different location relative to another object on 
all screen sizes without writing a line of code, of course I'd love it.


But at the moment, my primitive ways places me at no greater 
disadvantage than most app devs and nearly all web devs.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Richard Gaskin via use-livecode

Sannyasin Brahmanathaswami wrote:

> @ Richard I did not ask to a "simple" example.
>
> "Just yesterday I delivered a UI with several hundred controls on a
> card, some quite deeply nested within groups.  But the layout did not
> require writing anywhere close to one line per object.  Some was
> handled in loops, others handled by simply grouping objects and
> placing the group. Some don't need to be moved at all because their
> natural placement relative to topleft need not change.  Others were
> handled by combinations of the above in reusable behaviors."
>
> I want to see that e.g *as an actual stack*  - not a long explanation
> of how it is possible, which you have to provide that on least 6
> occasion that past two year. But but I want see code!

But but I want the time to do that!  :)

I would love to be able to deliver all sorts of example stacks, and I'd 
enjoy writing the tech notes to guide their dissection.  But the 
requirements of my work limit how much I can deliver here to an 
occasional description which may, admittedly, be unsatisfying.  If 
someone wants to send me a grant to spend a few weeks crafting 
instructional examples I'd prefer it over much of what I'm working on. 
But at the moment my obligations are where they are.


Besides, that particular layout was for an organization's internal 
needs, and even more relevant here than that it's proprietary to them is 
that their specific layout needs are unlikely to match the specific 
needs of your app.


So instead of throwing a pile of code over the wall as an irrelevant 
example of *what* to do for that one layout, it seemed more useful to go 
a level deeper and discuss *why* it's done which can help inform many 
layouts.


--

I used to hate writing object placement code.  In the olden days 
resizeStack handlers tended to be long monolithic blocks of code with 
cumbersomely long object references.  Mind numbing.


Then somewhere in the v5.x(?) cycle a small change was made to 
resizeControl that has big implications for layout management:


Previously, resizeControl was only sent to an object when it was resized 
interactively by the user with the pointer tool.


Today that message is also sent to a group when the group is resized by 
ANY means, including from another script.


That. Is. Big.

--

Most apps are comprised of regions, each of which contains controls or 
sometimes other sub-regions.  A navbar is a region comprised of a row of 
buttons, for example; a form is a region comprised of entry fields; etc.


Look at the apps you use, and think about them in terms of regions.

Regions of a screen are well expressed in LiveCode with groups.

With resizeControl triggered by scripts, instead of one long resizeStack 
handler in the card with tediously long object references, we can just 
set the rect of the few regions we have, and the mere act of adjusting 
our group rects will trigger the cascade of messages for each one.


Each group can then take care of itself.  And in doing so, the object 
references are much simpler. And the metrics are also simpler, able make 
use of the group itself as the bounds to work within.


Now you can modify the contents of a region, or even replace the group 
altogether, and all changes are localized in the group - nothing else is 
affected.


Add behaviors to the mix where useful, and things get ever simpler.

In broad terms:

- Consider UI patterns, look for sections that contain related
  functionality.

- Code the card for those regions. Its small resizeStack handler will
  trigger the cascade of resizeControl across the groups.

- Let the regions take care of their interior contents themselves.

- Nest groups wherever helpful, allowing each to enjoy
  the benefits of being self-contained.

- Use behaviors where practical.

Beyond that general gestalt of regions and localized code, another 
useful detail when placing things within groups under most circumstances 
is to set the lockLoc of the group and everything within it.  So much 
becomes so simple that way, and without it the automatic accommodate of 
interior objects within a group can sometimes be mystifying.  All that 
becomes confidently predictable with lockLoc.


--

None of this may matter much with regard to the app you're working on at 
the moment, since Jacque's description suggests it's a good fit for FSM, 
which you're already using.


So the description above may be more helpful for others, whose apps' 
layout needs follow more common patterns.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Sannyasin Brahmanathaswami via use-livecode
I should step into middle this because our app is under discussion.

Jacque: I appreciate your support of LC amazing auto-resizing options.
They are truly marvelous

But perhaps we take a Big View of Landscape. You have to realize I done
web development since 1993. Currently we "evolving" two new web sites,
(while I do the Siva Siva app). I have been involved in the Hinduism
Today Web site (XOOPS/PHP) and did "php" for a while 'till I got fed up
with it.

So from where I sit as production manager/web coordinator with some
fingers attached to the budgets. Some thing are obvious.

1) The web site "Saiva Bible" under construction by young Indian man in
Delhi tech section. Is being done PHP and jQuery And misc JS.   This is
relatively simple app (the UI) But is has 1000's in line of code in the
Style CSS sheet alone, and 1000 line of JS dedication to the UI.

2) about to be released (next week)

Himalayan Academy Musuem of Spiritual Art

http://dev.himalayanacadem.com/hamsa

is also relatively simple UI...

this developed in ELM and output to JS and CSS.  

[[FYI to all the content people out there, this art work is free for
taking, no license required.]]

Suffice it to say that building  UI in these environment involves an
*enormous* amount code. Most of it extremely opaque. And building that
is a "pain" and the cost 5-10X the cost of LC development (where we hire
out html5 programming)

Meanwhile I get up a 2:15am and start coding at 3:00 and really consider
it "fun" to do in Livecode. If the app gets traction (it cannot until
Android working! When is RC2 coming!) I may be able hire to some help
for here.

So one of the reason I push the team on SivaSiva app, is because I need
their help. And to push (like others do also) the LC tech to the next
level.

So, if Richard say that "some manually coding" it required, it does
"daunt"  me in the least. I'm sure it would, rational, English like, and
perfect sense.  Compared to web, coding resize handlers in LC, would be
a "dream machine"

An another important trend is the "rise of vector graphics" which means
"look good at any scale"...means this "resize any to fit device" (yes, i
know a lot of applications down need that) will have big implications
for content developers.

OK so @Richard: send the stack that the handles 100 objects or more!

BR





On 8/21/18 7:48 AM, Richard Gaskin via use-livecode wrote:
> Please let me clarify, as I have in every discussion of this topic, that 
> I fully recognize FSM exists for a reason, and there are cases where 
> it's a good choice.



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread J. Landman Gay via use-livecode

On 8/21/18 10:28 AM, Sannyasin Brahmanathaswami via use-livecode wrote:

@ Monte:

"mobileSetFullScreenRectForOrientations to set the rects you want the stack to be 
for each orientation"

you mean we can actually set up several of these with the same preopenstack 
handler! That big news...


I think he meant just the four variations on the two main orientations 
-- portrait and landscape.


But we can set mobileSetFullScreenRectForOrientations whenever it's 
needed so that it's dynamic, which I think you already do in the browser 
stack. Then set it to empty when the stack closes to go back to the 
default sizing.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread J. Landman Gay via use-livecode

On 8/21/18 1:26 PM, Richard Gaskin via use-livecode wrote:

Jim Lambert wrote:

 > A shootout between FSM vs. scripted resizing might make a good LC
 > Global presentation.
 > The pros and cons of each. Cases where one may be better than the
 > other. Etc.
 > Examples.

I touched on it in my LCG talk on UX in October last year.


I devoted a lot of my hour to it in my Android Tips talk last year too. 
But yeah, maybe you and I could team up and do a one-on-one debate. 
Someone could set up a rope ring and we could wear boxing gloves. :)


For the onlookers: Richard and I have been friends forever, but I bet we 
could fake it.



The stretch-or-gap solution FSM provides can be an excellent fit for those


That's where I think you're missing something. Those aren't the only 
options. Nobody uses stretch (not even Monument Valley) due to the 
distortion. But you aren't limited to seeing gaps, there are ways to 
avoid that. That's what my talk covered. The result is closer to what 
you describe with manual resizing. No gaps, and use of the edges around 
the stack.


I do agree we should use whatever method is best for our needs, so we're 
in sync there. But I think you are doing way more work than you need to.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Ludovic THEBAULT via use-livecode

> Le 20 août 2018 à 22:36, J. Landman Gay via use-livecode 
>  a écrit :
> 
> On 8/19/18 11:11 PM, Ludovic THEBAULT via use-livecode wrote:
>> But i found i can get the « real » top and bottom with : round((item 4 of 
>> the screenrect*the systemscale)/2)-theight // +theight (for the bottom)
>> where theight is the height of my stack before fullscreenmode.
> 
> You should be able to get the stack rect from "the rect of this card", or 
> "the rect of this stack". That may have been lost in the long conversation 
> that followed your question.
> 
> The card rect will tell you the width and height, the stack rect will tell 
> you the pixel locations of the top, sides, and bottom. Does that work for 
> you? Brian observed that the actual mobile size isn't defined yet on 
> preOpenCard (I haven't tested that) so you may need to query it after the app 
> has fully loaded.
> 

Hello, thanks

But even « the rect of this cd » return the rect of the stack i created 
(0,0,768,1024) not the rect of the screen.
I’ve made a test stack. It’s an « iPad » stack. Test it with iOS simulator on 
an iPhone device.
https://www.dropbox.com/s/iwwm2syiqzqamtg/testsubstack2.livecode?dl=0

Click on « get the rect » and click on « Adapt » to set the rect of the 
background to the rect of the screen
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Richard Gaskin via use-livecode

Jim Lambert wrote:

> A shootout between FSM vs. scripted resizing might make a good LC
> Global presentation.
> The pros and cons of each. Cases where one may be better than the
> other. Etc.
> Examples.

I touched on it in my LCG talk on UX in October last year.

It was only a brief part of the discussion because there really isn't 
much to compare.  They're so very different that it's rare one would 
feel the need to choose between them.  The nature of the layout dictates 
which will do what you need.


If there's any general guidance, the pattern that seems to have emerged 
in the complete agreement Jacque and I have on the applicability of each 
method to a given layout might come down to this:


In broad terms, many apps could be categorized as either "productivity 
apps" or "multimedia presentations".


Many games, and perhaps apps like Swami's, provide good examples of 
multimedia presentations.  The stretch-or-gap solution FSM provides can 
be an excellent fit for those, and indeed it is simple to use as long as 
what you need to do fits with what it does.


Apps like gMmail, Firefox, YouTube, Twitter, Instagram, LinkedIn, Skype,
SimpleNote, Play Music, Nextcloud, Hangouts, Telegram, Maps, Calculator, 
and others are examples of productivity apps.


In those, we often see a focus on consistent text and object sizes 
across device types, with regions that adjust relative to others to make 
optimal use of every pixel on the user's screen.  That's the sort of 
stuff we've been doing for years with resizeStack handlers on the 
desktop, providing us with transferable knowledge for mobile as well.


Look at the layout you want to make.  Look at the apps on your phone. 
Find some that look like what you want to make.  Do that.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Richard Gaskin via use-livecode

Bob Sneidar wrote:

> I've said this before, and perhaps it bears repeating. Many apps do
> not support resizing simply because the nature of the app does not
> lend itself to it.

I think everyone here would agree with that.

When an app doesn't need to do something, don't do it.

While most apps allow the user to resize the window, "most" is not "all".


Mobile is a special case because although the window is not 
user-resizable it will resize at least once to fit the device screen.


How one handles that depends on what the app needs to do.

Look at the apps on your phone, find some that look like what you want, 
and do that.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Richard Gaskin via use-livecode

J. Landman Gay wrote:

> Auto-resizing does require an awareness during initial layout of how
> fullscreenMode works. The objections you've raised can all be dealt
> with if you're a stickler for HIG (which even the companies who
> publish them don't follow. They're just guidelines.)

Of course. But beneath the niggly dictates of the HIGs are some 
fundamental principles worth considering.  Nothing as onerous as 
skinning details, just basics like making sure text is readable, buttons 
tappable, and, when practical, that an app looks and behaves in ways 
that blend well with the rest of the user's experience.


Please let me clarify, as I have in every discussion of this topic, that 
I fully recognize FSM exists for a reason, and there are cases where 
it's a good choice.


Despite the ardent back-and-forth here and in related discussions, I've 
never seen any disagreement at all on the applicability of one resizing 
method over another as it relates to a specific layout.


This discussion of Swami's app is a good example:  based on your 
previous description of the particulars of his layout, I'd already 
written that FSM may be a good fit for that.


As with anything in software design, it helps to stand on the shoulders 
of those before us:


When we want to make an app, look at other apps of its kind and do that.

If there's any caution at all merited for FSM, it's simply that as 
useful as it, when we look at the apps we have on our devices we see 
that the stretch-or-gap method FSM provides is less common than specific 
control placement.


Of course "less common" does not mean "non-existent".  I keep supporting 
use of FSM in cases like Monument Valley because it's a gorgeous and 
successful app, and uses exactly what FSM offers quite easily.


But if one is making other types of apps, use the methods those apps use.


>> We're scripters; we generally enjoy scripting. But reasons I
>> don't yet understand, writing the relatively small part of the code
>> to deliver a precise UI annoys people to the point of spending a
>> multiple of the time the task requires trying to find ways of
>> avoiding the task.
>
> In my experience this is exactly backwards, maybe because we develop
> different types of apps.

"Yes!", "Bingo!", "Hallelujah!", and every other enthusiastic 
affirmative I can find. :)


That's the thing:  Not all apps are the same.

To say one must always use one method over another without regard for 
the specifics of the app would be as ineffectual as requiring a raincoat 
every time you leave the house regardless what season it is.


The two methods are as different as sandals and galoshes.  They're so 
different there's usually no question at all when we would choose one 
over another.



> Tell you what. Let's have one of our friendly chats some time and I'll
> will either convince you or hit you over the head with my goody bag at
> the next conference. :P

I always enjoy talking with you and you're always welcome to call.  But 
given that you and I have never disagreed on the applicability of one 
resizing method over another for a given layout, I would imagine that 
part of the conversation would be very short.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


RE: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Ralph DiMola via use-livecode
I'm having the opposite problem with 9.0.1 rc1. I'm narrowing down on the 
strange rendering in 9.0.1 that doesn't happen in 9.0. Some controls don't show 
up at all other partially render(only 3 words of a page of text). This happens 
during the startup procedure before the first time the engine goes to idle so 
to speak. The app goes from splash card to the "Please Wait" card and then the 
card with the problems. This card has an image in the masthead, a page of text 
and 2 LC buttons. The text flashes 3 words in the middle of the text then all 
the text appears but the buttons are not there. I'm trying to make a small-ish 
stack with a recipe.

Ralph DiMola
IT Director
Evergreen Information Services
rdim...@evergreeninfo.net


-Original Message-
From: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] On Behalf Of 
Richard Gaskin via use-livecode
Sent: Tuesday, August 21, 2018 1:09 PM
To: use-livecode@lists.runrev.com
Cc: Richard Gaskin
Subject: Re: fullscreenmode and rect of a substack on mobile device ?

Monte Goulding wrote:

 > Aha… yes a number of members of the team (myself included) have become  > 
 > quite familiar with the Siva Siva app. It has exposed/highlighted  > quite a 
 > number of accelerated rendering issues that we have fixed in  > 9.0.1.

Thanks, Monte.  v9.0.1 is shaping up nicely, everything I've been enjoying 
about v9 with a bit more fit-and-finish here and there.

--
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Richard Gaskin via use-livecode

Monte Goulding wrote:

> Aha… yes a number of members of the team (myself included) have become
> quite familiar with the Siva Siva app. It has exposed/highlighted
> quite a number of accelerated rendering issues that we have fixed in
> 9.0.1.

Thanks, Monte.  v9.0.1 is shaping up nicely, everything I've been 
enjoying about v9 with a bit more fit-and-finish here and there.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Jim Lambert via use-livecode
A shootout between FSM vs. scripted resizing might make a good LC Global 
presentation.
The pros and cons of each. Cases where one may be better than the other. Etc.
Examples.

Jim Lambert
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Sannyasin Brahmanathaswami via use-livecode
Wonderful discussion!


@ Bob: agreed that "from ground up" could be one approach. But i have use cases 
where fully response screen is need and uses case where FSM is the best 
decision. it not "either" or "or" using resizestack of fullScreedMode

So the "tension" behind making that decision can to set aside.

@ Richard I did not ask to a "simple" example.

"Just yesterday I delivered a UI with several hundred controls on a card, 
some quite deeply nested within groups.  But the layout did not require 
writing anywhere close to one line per object.  Some was handled in 
loops, others handled by simply grouping objects and placing the group. 
Some don't need to be moved at all because their natural placement 
relative to topleft need not change.  Others were handled by 
combinations of the above in reusable behaviors."

I want to see that e.g *as an actual stack*  - not a long explanation of how it 
is possible, which you have to provide that on least 6 occasion that past two 
year. But but I want see code!

@ Monte: 

"mobileSetFullScreenRectForOrientations to set the rects you want the stack to 
be for each orientation"

you mean we can actually set up several of these with the same preopenstack 
handler! That big news... 







On 8/20/18 3:50 PM, Monte Goulding via use-livecode wrote:
>
>> On 21 Aug 2018, at 11:32 am, Richard Gaskin via use-livecode 
>>  wrote:
>>
>> - In this thread we have at least half a dozen people, including two from 
>> the core team, all working together to explore various options for placing 
>> one object within a resizing method chosen for its ostensible ease of use. :)
> Hmm… I only see one response from core team and it was from me responding to 
> your queries about when you might get an orientationChanged message and not 
> get a resizeStack message. I did not make any recommendation about which of 
> those handlers to do object placement in if that’s what you are suggesting. 
> By definition if you want to script layout changes when the stack changes 
> size doing so in resizeStack is the only place that makes any sense.
>
> If you want to use a fullscreenMode on mobile and have an app with layouts 
> for portrait and landscape then use mobileSetFullScreenRectForOrientations to 
> set the rects you want the stack to be for each orientation then handle 
> resizeStack to update the layout.
>
> Cheers
>
> Monte
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-21 Thread Bob Sneidar via use-livecode
I've said this before, and perhaps it bears repeating. Many apps do not support 
resizing simply because the nature of the app does not lend itself to it. We 
use an ERP called eAutomate. If you try to load the app on a monitor below a 
minimum resolution, it bugs out and fails to display a detail pane. And if on a 
larger monitor you decide to increase the Windows display percentage to make 
text more readable, anything above 125% bugs the app in a different way. This 
is a very popular service management application in use throughout the world. 
Our users constantly complain about readability on their monitors. The 
company's response is, sorry. It has to be that way given the amount of 
information we need to show at any given time. 

For an app to be resizable, it has to be designed from the ground up to be so. 
It's not a simple thing to do, and there is no magic bullet. If a single screen 
has many hundreds of controls, I begin to question whether or not screen 
resizing was something the developer had in mind when he started. 

The way I handle cards with a lot of controls is I use the Tab button, then 
create a group for each tab. On menuPick I hide ALL the groups, then show the 
group for the one tab. It's set up in such a way that all I have to do is 
properly name the group and the tab, and it "just works". 

Bob S


> On Aug 20, 2018, at 18:49 , Monte Goulding via use-livecode 
>  wrote:
> 
>> On 21 Aug 2018, at 11:32 am, Richard Gaskin via use-livecode 
>>  wrote:
>> 
>> - In this thread we have at least half a dozen people, including two from 
>> the core team, all working together to explore various options for placing 
>> one object within a resizing method chosen for its ostensible ease of use. :)
> 
> Hmm… I only see one response from core team and it was from me responding to 
> your queries about when you might get an orientationChanged message and not 
> get a resizeStack message. I did not make any recommendation about which of 
> those handlers to do object placement in if that’s what you are suggesting. 
> By definition if you want to script layout changes when the stack changes 
> size doing so in resizeStack is the only place that makes any sense.
> 
> If you want to use a fullscreenMode on mobile and have an app with layouts 
> for portrait and landscape then use mobileSetFullScreenRectForOrientations to 
> set the rects you want the stack to be for each orientation then handle 
> resizeStack to update the layout.
> 
> Cheers
> 
> Monte

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread J. Landman Gay via use-livecode

On 8/20/18 8:32 PM, Richard Gaskin via use-livecode wrote:
Swami has not asked me to evaluate strategies for precise control of his 
layouts.  That would not be possible until I see how things are 
constructed.


He estimated months, and that sounds about right. Every card is laid out 
differently. The project is gigantic.


Just yesterday I delivered a UI with several hundred controls on a card, 
some quite deeply nested within groups.  But the layout did not require 
writing anywhere close to one line per object.  Some was handled in 
loops, others handled by simply grouping objects and placing the group. 
Some don't need to be moved at all because their natural placement 
relative to topleft need not change.  Others were handled by 
combinations of the above in reusable behaviors.


It's not always like that. Like the sample stack we were working on 
here, just moving a group doesn't always work. The group needs to be 
resized, as do all its components. Field properties often need to be 
managed manually, text sizes and heights adjusted. Loops are fine if 
you're dealing with grid-type things, but useless when no two objects 
are the same. FSM manages all that without any scripts at all.


Auto-resizing does require an awareness during initial layout of how 
fullscreenMode works. The objections you've raised can all be dealt with 
if you're a stickler for HIG (which even the companies who publish them 
don't follow. They're just guidelines.)


I'm not saying FSM is the be-all and end-all, and as we've seen here 
there may be cases where manual adjustment is necessary, but for what I 
mostly do it's a lifesaver.


We're scripters; we generally enjoy scripting. But reasons I 
don't yet understand, writing the relatively small part of the code to 
deliver a precise UI annoys people to the point of spending a multiple 
of the time the task requires trying to find ways of avoiding the task.


In my experience this is exactly backwards, maybe because we develop 
different types of apps. The core code goes pretty quickly, and manual 
scaling takes more time than anything else. Even if the lines of script 
aren't overwhelmingly numerous (though sometimes they are) the 
calculations are a time sink. It usually takes more than just aligning 
the rects of controls on a card. Maybe that's not true for things like 
utility apps or straightforward layouts, but for multimedia and games 
you can't just put the top of one thing at the bottom of another; it's 
all percentages and ratios and placement of objects in a calculated area 
of the screen. Compare that against doing nothing at all except for a 
single line of code and there's no contest.


I suppose people are pretty tired of this conversation now, but the 
reason I keep answering is because I really believe that FSM is one of 
the greatest boons the team has given us, and it's saved me hours and 
hours of effort. I'd be sorry if users think they have to spend all that 
time scripting individual objects and writing repeat loops. It doesn't 
have to be that hard (and it is hard. It's tedious and tiresome and 
fiddly and not at all fun.)


There is a quick and gentle way to get your apps on any device with much 
less effort. If people don't like the default results, it is still 
possible to adjust the fiddly stuff as needed while allowing the engine 
to do most of the work.


Tell you what. Let's have one of our friendly chats some time and I'll 
will either convince you or hit you over the head with my goody bag at 
the next conference. :P


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Monte Goulding via use-livecode


> On 21 Aug 2018, at 12:08 pm, Richard Gaskin via use-livecode 
>  wrote:
> 
> I was referring to a post earlier in this thread which mentioned some 
> additional support via email with the author from Panos and Eleanor.

Aha… yes a number of members of the team (myself included) have become quite 
familiar with the Siva Siva app. It has exposed/highlighted quite a number of 
accelerated rendering issues that we have fixed in 9.0.1. I think the report 
mentioned https://quality.livecode.com/show_bug.cgi?id=21506 
 was a case of BR getting a 
bit used to assuming an engine problem on Android which is fair enough as there 
is a regression I resolved for the upcoming RC 2 which seems like what he was 
seeing.

Cheers

Monte
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Richard Gaskin via use-livecode

Monte Goulding wrote:

>> On 21 Aug 2018, at 11:32 am, Richard Gaskin wrote:
>>
>> - In this thread we have at least half a dozen people, including two
>> from the core team, all working together to explore various options
>> for placing one object within a resizing method chosen for its
>> ostensible ease of use. :)
>
> Hmm… I only see one response from core team and it was from me
> responding to your queries about when you might get an
> orientationChanged message and not get a resizeStack message. I did
> not make any recommendation about which of those handlers to do object
> placement in if that’s what you are suggesting.

I wasn't, but always good to see you here just the same.

I was referring to a post earlier in this thread which mentioned some 
additional support via email with the author from Panos and Eleanor.



> By definition if you want to script layout changes when the stack
> changes size doing so in resizeStack is the only place that makes
> any sense.

You write much more concisely than I do.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Monte Goulding via use-livecode


> On 21 Aug 2018, at 11:32 am, Richard Gaskin via use-livecode 
>  wrote:
> 
> - In this thread we have at least half a dozen people, including two from the 
> core team, all working together to explore various options for placing one 
> object within a resizing method chosen for its ostensible ease of use. :)

Hmm… I only see one response from core team and it was from me responding to 
your queries about when you might get an orientationChanged message and not get 
a resizeStack message. I did not make any recommendation about which of those 
handlers to do object placement in if that’s what you are suggesting. By 
definition if you want to script layout changes when the stack changes size 
doing so in resizeStack is the only place that makes any sense.

If you want to use a fullscreenMode on mobile and have an app with layouts for 
portrait and landscape then use mobileSetFullScreenRectForOrientations to set 
the rects you want the stack to be for each orientation then handle resizeStack 
to update the layout.

Cheers

Monte
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Richard Gaskin via use-livecode

J. Landman Gay wrote:

> On 8/19/18 11:45 PM, Richard Gaskin via use-livecode wrote:
>> Consider a Note app.  At the top is a navbar that spans the width of
>> the device at 60 px tall; below is a field for the user to type in;
>> centered below that is a "Save" button.
>>
>> This is in the card script:
>>
>> on resizeStack x,y
>>set the rect of grp "Navbar" to 0,0,x,60
>>set the rect of fld "Main" to 0,the bottom of grp "Nav",x,y-100
>>set the loc of btn "Save" to (item 1 of the loc of this cd, y-40)
>> end resizeStack
>
> Yup. Would you do this for, say, 200 controls per card on 1000 unique
> cards? Toss in a handful of groups nested three deep each. (I have
> Swami's project in mind.)

Swami asked for a simple example.  That was all I delivered.

Swami has not asked me to evaluate strategies for precise control of his 
layouts.  That would not be possible until I see how things are constructed.


Just yesterday I delivered a UI with several hundred controls on a card, 
some quite deeply nested within groups.  But the layout did not require 
writing anywhere close to one line per object.  Some was handled in 
loops, others handled by simply grouping objects and placing the group. 
Some don't need to be moved at all because their natural placement 
relative to topleft need not change.  Others were handled by 
combinations of the above in reusable behaviors.


But for every option there is an edge case. It may be that his app is so 
unusual as to be completely unconstructable using the methods most apps 
and web sites are made with.


As we see in the other thread today on performance of arrays vs chunks, 
so much depends on details, and there is rarely any one best answer for 
all possible cases.


If what he has is done and working and he's happy with it, regardless of 
the method use that would seem a good measure of his chosen method's 
fitness for that task.



Two general observations about resizing:

- We write thousands of lines of code in our apps, for everything from 
data storage to image manipulation and everything else. And for all 
those thousands of lines, no one complains about any of that - except 
for the only part the user directly interacts with, the UI. When we 
consider the widespread availability of data binding options in other 
systems, you'd think the tediousness of dealing with translating between 
LiveCode Script and SQL statements, and the repetitiveness of 
hand-crafting two-way bindings would be a more popular pet peeve.  But 
no, folks are happy to write tons of code for that. And for everything 
else.  We're scripters; we generally enjoy scripting. But reasons I 
don't yet understand, writing the relatively small part of the code to 
deliver a precise UI annoys people to the point of spending a multiple 
of the time the task requires trying to find ways of avoiding the task.


- In this thread we have at least half a dozen people, including two 
from the core team, all working together to explore various options for 
placing one object within a resizing method chosen for its ostensible 
ease of use. :)


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread J. Landman Gay via use-livecode

On 8/19/18 11:45 PM, Richard Gaskin via use-livecode wrote:
Consider a Note app.  At the top is a navbar that spans the width of the 
device at 60 px tall; below is a field for the user to type in; centered 
below that is a "Save" button.


This is in the card script:

on resizeStack x,y
   set the rect of grp "Navbar" to 0,0,x,60
   set the rect of fld "Main" to 0,the bottom of grp "Nav",x,y-100
   set the loc of btn "Save" to (item 1 of the loc of this cd, y-40)
end resizeStack


Yup. Would you do this for, say, 200 controls per card on 1000 unique 
cards? Toss in a handful of groups nested three deep each. (I have 
Swami's project in mind.)


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread J. Landman Gay via use-livecode

On 8/19/18 11:11 PM, Ludovic THEBAULT via use-livecode wrote:

But i found i can get the « real » top and bottom with : round((item 4 of the 
screenrect*the systemscale)/2)-theight // +theight (for the bottom)
where theight is the height of my stack before fullscreenmode.


You should be able to get the stack rect from "the rect of this card", 
or "the rect of this stack". That may have been lost in the long 
conversation that followed your question.


The card rect will tell you the width and height, the stack rect will 
tell you the pixel locations of the top, sides, and bottom. Does that 
work for you? Brian observed that the actual mobile size isn't defined 
yet on preOpenCard (I haven't tested that) so you may need to query it 
after the app has fully loaded.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Andrew Bell via use-livecode

From: Brian Milby 
To: How to use LiveCode 
Subject: Re: fullscreenmode and rect of a substack on mobile device ?
Message-ID: 

In the end, I guess I need to get an Android device so I can start testing.




My go-to source for Android test devices is the local grocery store so  
I can buy a pre-paid phone (AKA a burner). It's not the  
latest/greatest Pixel or Galaxy, but you'll find a variety of devices  
with different sized screens and OSs ranging from $20-$100. You never  
need to register them, just turn on the wi-fi and begin testing.


My other source is the hand-me-down my wife gives me every 2 years  
when she renews her contract. I buy my iPhones outright and keep my  
old models to run a variety of OSs.


--Andrew Bell




___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Sannyasin Brahmanathaswami via use-livecode
@ Brian and Jacque

Thanks for digging to this. Panos write on QA and that line 14 (position
the group explicitly) in required.

The background is set "super wide" for that I was using FullScreenMode,
do that it would appear at the way across on iPad. Clearly set the
explicitly is required

@Brian, Oh yes footer is below not need to hide in. down to from 19
lines of card to 17 :-)

@ Jacque good to know the child control maintains their  relative
position in relation to group coords. that is what I get on my Pixel

2 notes"

1. Elanor suggestion using the nav bar widget, and the will out itself
out automatcally (!)
 
2. There is another issue when try YouTube videos (a major use case for
this  browser card) it happens on iOS and Android. Automatically, the
browser want to go to fullScreen (in the video) and co-ops the entire
screen rect and the native LC coords to any object overridden. Rather,
they probably are behind the video. So as soon as you hit "play" , the 
footer disappear-- the user thinks he had lost navigation -- until you
to Stop, the screen revert to "regular mode" and the footer appears. 
Could have sworn this did not happen in LC version <9. OR it could be
passing the parameter to YouTube of ?rel=0 (which gets rid of all extra
YouTube furniture)

try it:

go stack URL
"http://wiki.hindu.org/uploads/BrowserLandscapeTest_r9.livecode;



Would should open different thread on that one...


 

 

On 8/19/18 5:00 PM, Brian Milby via use-livecode wrote:
> I was mistaken on the show/hide thing.  The controls were behind the
> browser the whole time.



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Richard Gaskin via use-livecode

Terry Judd wrote:

> On 20 Aug 2018, at 4:50 pm, Richard Gaskin wrote:
>>
>> Terry Judd wrote:
>>
>> > Yeah, I've used FSM in combination with scripting in the android
>> > versions a couple of apps (admittedly they were only designed to
>> > work in portrait mode) and it seemed to work well enough.
>>
>> If you make a button that looks HIG-savvy finger-sized on a 4" phone,
>> what happens when you run the app on an 11" tablet?
>>
> My guess is that it would look pretty bad ;)
>
> I was only targeting phones in portrait mode though so things looked
> reasonable as long as the phone wasn’t huge. I’d probably develop a
> separate interface for tablets.
>
> Oh, and my apps probably weren't terribly HIG compliant either. I used
> custom buttons and controls that looked and functioned identically on
> Android and iOS versions of the same app.

That's pretty common.  My reference to "HIG-savvy" wasn't so much 
slavish devotion to whatever appearance scheme happens to be in vogue at 
the moment, but more about metrics, making sure text is readable and 
touchable objects are of good size and comfortably reachable.  Of course 
we still don't have swipe transitions, so some LC apps will feel a bit 
off until the engine team adds that, but at least the other basics can 
meet user expectations well.


With many mobile deployments all device types are expected, so with 
device-specific sizing a button that's finger-sized on a 4" phone 
becomes fist-sized on a 11" tablet, and text that looks at 13px on a 
small phone becomes street signage on a tablet.


As long as you're in a position to restrict device types, and don't mind 
futzing with the extra math, if it works for you it works for you.


If you have a layout where fullScreenMode makes sense I guess the trick 
is to design for the very smallest devices.  Better to have super-large 
text on 7" phone than unreadably small text on a 4".


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread J. Landman Gay via use-livecode

On 8/20/18 2:29 AM, Terry Judd via use-livecode wrote:

Oh, and my apps probably weren't terribly HIG compliant either. I used custom 
buttons and controls that looked and functioned identically on Android and iOS 
versions of the same app.


Ditto. I don't think I've ever had to work on a stack that followed the 
OS model, they've all been heavily skinned. The slight variation in 
control sizes aren't noticeable and it's painless to go cross platform 
that way.


One of my current projects does duplicate the Android Material theme, 
but it's only targeted to small screens and the differences in control 
sizes aren't apparent.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread J. Landman Gay via use-livecode

On 8/19/18 11:11 PM, Brian Milby via use-livecode wrote:

When the engine resizes the stack, I’m assuming that it takes into account any 
system furniture? That isn’t a consideration for iOS (at least yet). I’m 
excluding keyboard for the moment.


The screenrect is always the actual size of the screen. The stack rect 
is the size of the available space minus the OS furniture. On my old 
Nexus tablet:


Actual stack size in IDE: 493 x 597
Nexus screenrect: 0,0,600,912
Nexus stack rect: 0,24,600,912 -- 24 px status bar at the top
Nexus card rect: 0,0,600,888

These are logical pixels. The Nexus 7 has a pixel density of 323 ppi, 
aspect ratio 16:10, screen pixels 1920 x 1200.



I’m not sure why there should be a difference between any platform though. Line 
14 put the group’s center 25px above the bottom of the stack which should have 
put it right on the bottom edge of the screen. The group is 50px tall and the 
icons are 32px square. I can see them being off left/right side of narrower 
devices, but if off the bottom that does not seem right. Maybe we should 
replace the group with a single grc as a test. Also, the top of the group rect 
should match the bottom of the browser rect. Everything is done by logical px 
on iOS... is it different on Android?


On Android, screen sizes and pixel densities vary a lot. LC does use 
logical pixels for some metrics but without fullScreenMode you're on 
your own to figure out what ratio and resizing you need to use to get 
the placement just right. I'm guessing that the group wasn't scaled for 
my phone and was just too tall to display fully.


LC automatically calculates and scales logical pixels on iOS, so 
non-retina and retina devices give you back the same numbers. You can 
work with the real screen pixels on iOS by setting the 
iphoneUseDeviceResolution, which may show a difference. Without 
fullscreenMode, LC doesn't auto-scale controls on Android, you need to 
set the rects of everything.




In the end, I guess I need to get an Android device so I can start testing.


To really test on Android you need 5 or 6 devices. :)

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Terry Judd via use-livecode
On 20/08/2018 5:01 pm, "use-livecode on behalf of Terry Judd via use-livecode" 
 wrote:

On 20 Aug 2018, at 4:50 pm, Richard Gaskin via use-livecode 
 wrote:
> 
> Terry Judd wrote:
> 
> > Yeah, I've used FSM in combination with scripting in the android
> > versions a couple of apps (admittedly they were only designed to work
> > in portrait mode) and it seemed to work well enough.
> 
> If you make a button that looks HIG-savvy finger-sized on a 4" phone, 
what happens when you run the app on an 11" tablet?
> 
My guess is that it would look pretty bad ;)

I was only targeting phones in portrait mode though so things looked 
reasonable as long as the phone wasn’t huge. I’d probably develop a separate 
interface for tablets.

Oh, and my apps probably weren't terribly HIG compliant either. I used 
custom buttons and controls that looked and functioned identically on Android 
and iOS versions of the same app. So I guess it depends on what you are trying 
to achieve (these were teaching/research related apps).

Terry...  

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Terry Judd via use-livecode
On 20 Aug 2018, at 4:50 pm, Richard Gaskin via use-livecode 
 wrote:
> 
> Terry Judd wrote:
> 
> > Yeah, I've used FSM in combination with scripting in the android
> > versions a couple of apps (admittedly they were only designed to work
> > in portrait mode) and it seemed to work well enough.
> 
> If you make a button that looks HIG-savvy finger-sized on a 4" phone, what 
> happens when you run the app on an 11" tablet?
> 
My guess is that it would look pretty bad ;)

I was only targeting phones in portrait mode though so things looked reasonable 
as long as the phone wasn’t huge. I’d probably develop a separate interface for 
tablets.

Terry...
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Richard Gaskin via use-livecode

Terry Judd wrote:

> Yeah, I've used FSM in combination with scripting in the android
> versions a couple of apps (admittedly they were only designed to work
> in portrait mode) and it seemed to work well enough.

If you make a button that looks HIG-savvy finger-sized on a 4" phone, 
what happens when you run the app on an 11" tablet?


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-20 Thread Terry Judd via use-livecode
On 20/08/2018 2:45 pm, "use-livecode on behalf of Richard Gaskin via 
use-livecode"  wrote:

Most of the lengthier discussions I've seen about layout handling here 
and on the forums stem from attempting to get precise control from FSM. 
In some cases it may be possible to mix FSM with scripted placement, but 
as you suggest it's often murkier than just having precise control over 
everything without bringing FSM into it at all.

Yeah, I've used FSM in combination with scripting in the android versions a 
couple of apps (admittedly they were only designed to work in portrait mode) 
and it seemed to work well enough. In those cases I developed the app using 
fairly squat stack aspect ratio and set the fullscreenmode to letterbox in my 
preopenstack handler. Then in each opencard handler (and this was pre navbar 
etc. widgets) used something like the following as the basis for sizing/placing 
elements on the screen (relative to tB). Seemed to work fine for a range of 
actual device aspect ratios (that all equivalent to or larger than my original 
stack).

if environment() = "mobile" then
  put the working screenrect into tWR
  put (item 4 of tWR)/(item 3 of tWR) into tAspectRatio
  put (item 3 of tWR)/320 into tScaleFactor
  put 10*(trunc (tAspectRatio*320/10)) into tB
  set the height of this stack to tB
 else
  put the height of this card into tB
 end if

Terry...

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Richard Gaskin via use-livecode

Brahmanathaswami wrote:
> re Geometry: You keep telling us this again and again, but you never
> provide an example.

Given how many years most of the members of this list have been 
scripting, it hadn't occurred to me that would be useful.  Here's a 
simple example that illustrates the basics, then extended for reuse:



Consider a Note app.  At the top is a navbar that spans the width of the 
device at 60 px tall; below is a field for the user to type in; centered 
below that is a "Save" button.


This is in the card script:

on resizeStack x,y
  set the rect of grp "Navbar" to 0,0,x,60
  set the rect of fld "Main" to 0,the bottom of grp "Nav",x,y-100
  set the loc of btn "Save" to (item 1 of the loc of this cd, y-40)
end resizeStack

On mobile OSes the resizeStack message is sent when the stack is first 
opened, and again when changed by the user changing the device orientation.



Suppose the Navbar group has three objects within it: a button at left 
and another at right, with a label field filling the space in the middle.


You could add a couple lines for those in the card's resizeStack handler 
shown above, but you might reuse the group elsewhere so it would be 
useful to keep the code within the group.


Just put this in the Navbar group script:

on resizeControl
   set the right of btn "RightSide" to the right of me - 10
   set the rect of fld "Label" to the right of btn "LeftSide", \
  0, the left of btn "RightSide", 60
end resizeControl

The resizeControl message is sent to a group whenever the group is 
resized by any means, whether interactively with the pointer tool or via 
any script that changes the group's rect.


If you have a lot of controls of the same type you probably already use 
behavior scripts for those, so you can put the resizeControl handler in 
the behavior script so every object of that type uses it.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Richard Gaskin via use-livecode

Brian Milby wrote:
> I can't speak directly to Android, but once you start doing resize
> handlers, I can't see using fullscreenmode.  If you are going to
> position anything, may as well position it based on actual device
> metrics.

That's all I was getting at when I wrote:
"FullScreenMode makes handling dynamic layout details complex."

Consider what FSM does. It stretches the card or adds empty space around it.

Then look at the apps on your phone.

Then determine how well FSM will support the type of layout your own 
apps need.


Depending on the app, FSM may be great.  But on my phone I have exactly 
one app that uses layout logic anything like it.  Everything else uses 
explicit placement.


FSM is very good for what it is, but it isn't a magic pony. In software 
design the only magic pony is the designer: our devotion applying the 
same tender loving care to scripting the user interface that we use when 
writing any other code.


The great thing with us LC scripters is that we've already been 
adjusting controls for resizable windows for many years, so we can 
leverage all that experience.


Extra bonus points that you can test scripted placement within the IDE 
in the simplest way possible: just resize the stack window you're 
working on.



Most of the lengthier discussions I've seen about layout handling here 
and on the forums stem from attempting to get precise control from FSM. 
In some cases it may be possible to mix FSM with scripted placement, but 
as you suggest it's often murkier than just having precise control over 
everything without bringing FSM into it at all.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Brian Milby via use-livecode
When the engine resizes the stack, I’m assuming that it takes into account any 
system furniture? That isn’t a consideration for iOS (at least yet). I’m 
excluding keyboard for the moment.

I’m not sure why there should be a difference between any platform though. Line 
14 put the group’s center 25px above the bottom of the stack which should have 
put it right on the bottom edge of the screen. The group is 50px tall and the 
icons are 32px square. I can see them being off left/right side of narrower 
devices, but if off the bottom that does not seem right. Maybe we should 
replace the group with a single grc as a test. Also, the top of the group rect 
should match the bottom of the browser rect. Everything is done by logical px 
on iOS... is it different on Android?

In the end, I guess I need to get an Android device so I can start testing.

Thanks,
Brian
On Aug 19, 2018, 11:05 PM -0500, J. Landman Gay via use-livecode 
, wrote:
> On 8/19/18 10:21 PM, Brian Milby via use-livecode wrote:
> > I'm not sure what the fleet of widths would
> > need to be supported on the Android side though.
>
> They vary all over the place. Basically you need to calculate a ratio
> and set all the control sizes accordingly.
>
> > I can't speak directly to Android, but once you start doing resize
> > handlers, I can't see using fullscreenmode. If you are going to position
> > anything, may as well position it based on actual device metrics.
>
> That's kind of what I meant. You either use fullscreenMode or you don't,
> but I can see a case for turning it off for a card or two when you want
> to use screen metrics only.
>
> > On iOS, all of the controls within the footer group moved without having to
> > touch them individually.
>
> I think it may be resolution-dependent. Unlike iOS, Android is all over
> the map, so when the group moved up (without auto-scaling) on the
> Samsung I was using, only the tops of the icons showed. The group's top
> margin was disproportionately large and the bottom half of the icons
> were still below the stack. On other Android devices you'd get different
> results, so you'd need to do all the calculations not just for size but
> also for resolution. At least, I think so. I'm not positive any more
> because I gave up all that work the moment the engine started doing it
> for me.
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Ludovic THEBAULT via use-livecode

> Le 18 août 2018 à 20:32, Richard Gaskin via use-livecode 
>  a écrit :
> 
> Ludovic THEBAULT wrote:
> 
> > How get the « real » rect of the stack ?
> 
> Without fullScreenMode it's as simple as:
> 
>get the rect of this stack
> 
> FullScreenMode makes handling dynamic layout details complex.
> 
> It's well suited for certain types of games or multimedia presentations, such 
> as Monument Valley.
> 
> In those types of layouts everything is stretched to fit, without needing 
> dynamic placement of individual controls.
> 
> But consider the apps on your phone.  The ones I use the most are gMmail, 
> Firefox, YouTube, Twitter, Instagram, LinkedIn, Skype, SimpleNote, Play 
> Music, Nextcloud, Hangouts, Telegram, Maps, Calculator, Ingres, and a few 
> others.
> 
> Every one of them uses dynamic positioning of the sort we've been doing in 
> LiveCode for decades by responding to the resizeStack message.
> 
> I don't know what you're working on so I can't have an opinion of whether 
> fullScreenMode is a good fit.
> 
> But in practice I so rarely see other apps use that sort of scaling that I 
> don't think about fullScreenMode much at all.
> 

Hello,

Thanks

My app use a lot of controls, so i think the fullscreenmode is more easy (and 
fast) to adapt the app to the screen, except that we cannot get the real rect 
of the stack.

But i found i can get the « real » top and bottom with : round((item 4 of the 
screenrect*the systemscale)/2)-theight // +theight (for the bottom)
where theight is the height of my stack before fullscreenmode.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread J. Landman Gay via use-livecode

On 8/19/18 10:21 PM, Brian Milby via use-livecode wrote:

I'm not sure what the fleet of widths would
need to be supported on the Android side though.


They vary all over the place. Basically you need to calculate a ratio 
and set all the control sizes accordingly.



I can't speak directly to Android, but once you start doing resize
handlers, I can't see using fullscreenmode.  If you are going to position
anything, may as well position it based on actual device metrics.


That's kind of what I meant. You either use fullscreenMode or you don't, 
but I can see a case for turning it off for a card or two when you want 
to use screen metrics only.



On iOS, all of the controls within the footer group moved without having to
touch them individually.


I think it may be resolution-dependent. Unlike iOS, Android is all over 
the map, so when the group moved up (without auto-scaling) on the 
Samsung I was using, only the tops of the icons showed. The group's top 
margin was disproportionately large and the bottom half of the icons 
were still below the stack. On other Android devices you'd get different 
results, so you'd need to do all the calculations not just for size but 
also for resolution. At least, I think so. I'm not positive any more 
because I gave up all that work the moment the engine started doing it 
for me.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Brian Milby via use-livecode
The stack is built for iPhone 6/7/8 Plus dimensions (414px wide).  This
means that the navigation bar is a little too wide to show properly on a
regular iPhone 6/7/8.  The icons are 384px wide (edge to edge) and those
phones are only 375px wide.  If you also want to target the iPhone 4/5/5s
then the max width is 320px.  I'm not sure what the fleet of widths would
need to be supported on the Android side though.

On Sun, Aug 19, 2018 at 10:13 PM, J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> It does work on Android, but you need to move all the group controls as
> well as the group. That's just how things are without fullscreenMode, you
> have to account for every object. I don't think it's a bug, more an
> enhancement request maybe, but the response may be that you should just use
> mobileSetFullScreenRectForOrientations, which was implemented just for
> that situation.


I can't speak directly to Android, but once you start doing resize
handlers, I can't see using fullscreenmode.  If you are going to position
anything, may as well position it based on actual device metrics.

On iOS, all of the controls within the footer group moved without having to
touch them individually.

Thanks,
Brian
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread J. Landman Gay via use-livecode

On 8/19/18 9:37 PM, Sannyasin Brahmanathaswami via use-livecode wrote:

"Intuitively" resize stack is all that is required.
And, "intuitively" a group should place all controls relative to itself.

And it does on iOS


I think that was just incidental. The original stack was sized to fit 
the same iPhone you own, so the footer didn't need to move. If you'd 
created the stack to fit an Android device I suspect it would have 
worked there and not on iOS. The ratios are different.



Jacque had her finger on it with this comment.

Jacque (off list)

"I see. That looks like a redraw problem. The resizeStack handler is working but the 
>redraw fails. I did notice the icons were missing but didn't try to 
figure out why. A quick

>
test says the footer is visible in portrait and false in landscape, but 
it isn't being drawn

>
to screen for some reason. I think that's the bug to report."

I was wrong, it wasn't a bug. It wasn't drawing because it was 
offscreen, so the engine didn't bother with it. Brian woke me up to 
that. Once you moved the footer into the stack region it redraws.


It work on iOS and Android! (if someone could try in an android tablet I would 

>appreciate), so it works, and I have a bug to report.

It does work on Android, but you need to move all the group controls as 
well as the group. That's just how things are without fullscreenMode, 
you have to account for every object. I don't think it's a bug, more an 
enhancement request maybe, but the response may be that you should just 
use mobileSetFullScreenRectForOrientations, which was implemented just 
for that situation.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Brian Milby via use-livecode
I was mistaken on the show/hide thing.  The controls were behind the
browser the whole time.

On Sun, Aug 19, 2018 at 9:55 PM, Brian Milby  wrote:

> Line 14 is required on iPad.  Otherwise the controls stay where they
> originated (behind the browser).  There is really no need to hide the icons
> anyway though... they will be below the physical screen when in landscape
> mode.  That saves 2 lines :)
>
> On Sun, Aug 19, 2018 at 9:49 PM, J. Landman Gay via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
>> On Android, hiding and showing a group works as expected, I don't need to
>> loop through the controls to show them. At first I thought they weren't
>> being drawn, but in fact the whole group was below the bottom of the stack.
>> --
>> Jacqueline Landman Gay | jac...@hyperactivesw.com
>> HyperActive Software | http://www.hyperactivesw.com
>> On August 19, 2018 6:23:00 PM Brian Milby via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>
>> I did figure out that within preOpenCard, the reported stack rect is still
>>> the dimensions of the saved stack file (at least on iOS).  There is also
>>> the detail that when you hide a group, it sets all of the objects to
>>> hidden
>>> which has to be undone in a loop.  I've worked out moving the group and
>>> the
>>> background grc, still looking at the math for the widget buttons.  This
>>> would probably be a good place for the Navigation Bar with the option to
>>> select none of the icons (PR submitted, still pending).
>>>
>>> On Sun, Aug 19, 2018 at 5:31 PM, J. Landman Gay via use-livecode <
>>> use-livecode@lists.runrev.com> wrote:
>>>
>>> Android does receive orientationChanged messages. I've been tinkering
 with
 Swami's test stack, and dynamic positioning (no fullscreenMode) works
 fine
 with some effort.

 The footer isn't a widget, it's a group containing half a dozen
 controls,
 so they all need to be individually managed. You were right that they
 weren't in the correct position on Android.

 Swami's real project has thousands of controls over many hundreds of
 unique cards. I'd hate to be the one to write all the positioning
 scripts
 for that. But for a single instance where he's having issues, turning
 off
 fullscreenMode for just that card is a feasible solution.

 On 8/19/18 4:05 PM, Brian Milby via use-livecode wrote:

 You probably still want to set the rect for the footer to be sure it
> lands
> where you want it on different size devices.  That could be done in the
> preOpenCard handler (just put it where it needs to be for portrait)
>
> on preOpenCard
> local tWidth, tHeight, tFooterRect
> put the width of this stack into tWidth
> put the height of this stack into tHeight
> if tWidth > tHeight then
>put 0,tWidth-50,tHeight,tWidth into tFooterRect
> else
>put 0,tHeight-50,tWidth,tHeight into tFooterRect
> end if
> set the rect of widget "footer" of me to tFooterRect
> resizeStack tWidth, tHeight
> end preOpenCard
>
> If the Pixel does receive the orientationChanged messages, then you
> could
> use my first example.  That code does actually work on the iPhone, it
> is
> just not necessary to manage it by hand like that.
>
> On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
> use-livecode  wrote:
>
> @Brian Milby
>
>>
>>
>
 --
 Jacqueline Landman Gay | jac...@hyperactivesw.com
 HyperActive Software   | http://www.hyperactivesw.com

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

 ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>
>>
>>
>>
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Brian Milby via use-livecode
Line 14 is required on iPad.  Otherwise the controls stay where they
originated (behind the browser).  There is really no need to hide the icons
anyway though... they will be below the physical screen when in landscape
mode.  That saves 2 lines :)

On Sun, Aug 19, 2018 at 9:49 PM, J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> On Android, hiding and showing a group works as expected, I don't need to
> loop through the controls to show them. At first I thought they weren't
> being drawn, but in fact the whole group was below the bottom of the stack.
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software | http://www.hyperactivesw.com
> On August 19, 2018 6:23:00 PM Brian Milby via use-livecode <
> use-livecode@lists.runrev.com> wrote:
>
> I did figure out that within preOpenCard, the reported stack rect is still
>> the dimensions of the saved stack file (at least on iOS).  There is also
>> the detail that when you hide a group, it sets all of the objects to
>> hidden
>> which has to be undone in a loop.  I've worked out moving the group and
>> the
>> background grc, still looking at the math for the widget buttons.  This
>> would probably be a good place for the Navigation Bar with the option to
>> select none of the icons (PR submitted, still pending).
>>
>> On Sun, Aug 19, 2018 at 5:31 PM, J. Landman Gay via use-livecode <
>> use-livecode@lists.runrev.com> wrote:
>>
>> Android does receive orientationChanged messages. I've been tinkering with
>>> Swami's test stack, and dynamic positioning (no fullscreenMode) works
>>> fine
>>> with some effort.
>>>
>>> The footer isn't a widget, it's a group containing half a dozen controls,
>>> so they all need to be individually managed. You were right that they
>>> weren't in the correct position on Android.
>>>
>>> Swami's real project has thousands of controls over many hundreds of
>>> unique cards. I'd hate to be the one to write all the positioning scripts
>>> for that. But for a single instance where he's having issues, turning off
>>> fullscreenMode for just that card is a feasible solution.
>>>
>>> On 8/19/18 4:05 PM, Brian Milby via use-livecode wrote:
>>>
>>> You probably still want to set the rect for the footer to be sure it
 lands
 where you want it on different size devices.  That could be done in the
 preOpenCard handler (just put it where it needs to be for portrait)

 on preOpenCard
 local tWidth, tHeight, tFooterRect
 put the width of this stack into tWidth
 put the height of this stack into tHeight
 if tWidth > tHeight then
put 0,tWidth-50,tHeight,tWidth into tFooterRect
 else
put 0,tHeight-50,tWidth,tHeight into tFooterRect
 end if
 set the rect of widget "footer" of me to tFooterRect
 resizeStack tWidth, tHeight
 end preOpenCard

 If the Pixel does receive the orientationChanged messages, then you
 could
 use my first example.  That code does actually work on the iPhone, it is
 just not necessary to manage it by hand like that.

 On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
 use-livecode  wrote:

 @Brian Milby

>
>

>>> --
>>> Jacqueline Landman Gay | jac...@hyperactivesw.com
>>> HyperActive Software   | http://www.hyperactivesw.com
>>>
>>> ___
>>> use-livecode mailing list
>>> use-livecode@lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Sannyasin Brahmanathaswami via use-livecode
Jacque wrote:

"I see. That looks like a redraw problem. The resizeStack handler
isworking but the redraw fails. I did notice the icons were missing but
didn't try to figure out why. A quick test says the footer is visible it
portrait and false in landscape, but it isn't being drawn to screen for
some reason. I think that's the bug to report."

not that we have a finger on it yet; could be the "visible/invisible"
issue that Brain mentioned. But here goes:
> https://quality.livecode.com/show_bug.cgi?id=21506



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread J. Landman Gay via use-livecode
On Android, hiding and showing a group works as expected, I don't need to 
loop through the controls to show them. At first I thought they weren't 
being drawn, but in fact the whole group was below the bottom of the stack.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On August 19, 2018 6:23:00 PM Brian Milby via use-livecode 
 wrote:



I did figure out that within preOpenCard, the reported stack rect is still
the dimensions of the saved stack file (at least on iOS).  There is also
the detail that when you hide a group, it sets all of the objects to hidden
which has to be undone in a loop.  I've worked out moving the group and the
background grc, still looking at the math for the widget buttons.  This
would probably be a good place for the Navigation Bar with the option to
select none of the icons (PR submitted, still pending).

On Sun, Aug 19, 2018 at 5:31 PM, J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:


Android does receive orientationChanged messages. I've been tinkering with
Swami's test stack, and dynamic positioning (no fullscreenMode) works fine
with some effort.

The footer isn't a widget, it's a group containing half a dozen controls,
so they all need to be individually managed. You were right that they
weren't in the correct position on Android.

Swami's real project has thousands of controls over many hundreds of
unique cards. I'd hate to be the one to write all the positioning scripts
for that. But for a single instance where he's having issues, turning off
fullscreenMode for just that card is a feasible solution.

On 8/19/18 4:05 PM, Brian Milby via use-livecode wrote:


You probably still want to set the rect for the footer to be sure it lands
where you want it on different size devices.  That could be done in the
preOpenCard handler (just put it where it needs to be for portrait)

on preOpenCard
local tWidth, tHeight, tFooterRect
put the width of this stack into tWidth
put the height of this stack into tHeight
if tWidth > tHeight then
   put 0,tWidth-50,tHeight,tWidth into tFooterRect
else
   put 0,tHeight-50,tWidth,tHeight into tFooterRect
end if
set the rect of widget "footer" of me to tFooterRect
resizeStack tWidth, tHeight
end preOpenCard

If the Pixel does receive the orientationChanged messages, then you could
use my first example.  That code does actually work on the iPhone, it is
just not necessary to manage it by hand like that.

On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
use-livecode  wrote:

@Brian Milby






--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-livecode





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Sannyasin Brahmanathaswami via use-livecode
@Brian and all > glad this opened an important discussion..

and thank to the attempt to make it work @Brian footer control were too far 
down on that card(android)

Many of cards in the SivaSiva app, would need major geometry refactoring 
(month(s) of work) without fullScreenMode...so I am not considering give that 
up. Any appreciation the on going discussion .

But a browsers are integral to app, with HTML5 "presentions" coming and 
slideshow.

I wanted "responsive to any screen size on all devices"  for a simple browser 
stack with has a "body" (browser widget) and 5 controls on the bottom -- group 
"footer" why? we want cover the whole screen, with "pillar boxes"  and the CSS 
will do the "real" positioning.

in the surface is appear that one does not need:

 FullScreenMode / mobileSetFullScreenRectForOrientations
orientationChanged

"Intuitively" resize stack is all that is required.
And, "intuitively" a group should place all controls relative to itself.

And it does on iOS

see:

go  stack url 
"http://wiki.hindu.org/uploads/BrowserLandscapeTest_r8.livecode;

without line 14, it works iOS


on preOpenCard

if isMobile() then

mobileSetAllowedOrientations "portrait,portrait upside down,landscape 
left,landscape right"

end if

end preOpenCard

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

hide group "footer"

else

put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect

  #line14   # 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

function isMobile

return environment() = "mobile"

end isMobile

But the group "footer" was no appearing on Android.

Jacque had her finger on it with this comment.

Jacque (off list)

"I see. That looks like a redraw problem. The resizeStack handler is working 
but the redraw fails. I did notice the icons were missing but didn't try to 
figure out why. A quick test says the footer is visible in portrait and false 
in landscape, but it isn't being drawn to screen for some reason. I think 
that's the bug to report."

My "gut" told me "we just have to make footer redraw"

This "gut" said: give the loc and it will redraw


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

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

and Bingo! It work on iOS and Android! (if someone could try in an android 
tablet I would appreciate), so it works, and I have a bug to report.

But responsive screen in 19 lines of code! The child controls-the widget in the 
footer can stay where to are, in portrait, regardless on screen size/ration, 
there is no reason to "work it that hard"

Brahmanathaswami






On 8/19/18 1:21 PM, Brian Milby via use-livecode wrote:

I did figure out that within preOpenCard, the reported stack rect is still
the dimensions of the saved stack file (at least on iOS).  There is also
the detail that when you hide a group, it sets all of the objects to hidden
which has to be undone in a loop.  I've worked out moving the group and the
background grc, still looking at the math for the widget buttons.  This
would probably be a good place for the Navigation Bar with the option to
select none of the icons (PR submitted, still pending).

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Monte Goulding via use-livecode


> On 20 Aug 2018, at 10:53 am, Richard Gaskin via use-livecode 
>  wrote:
> 
> As long as both messages are sent it may not matter, but that's the thing I'm 
> unclear on: what does orientationChanged tell us on a mobile device that 
> resizeStack doesn't?  When is one sent without the other sent immediately 
> after?

When you have a fullscreenMode set then the stack doesn’t resize unless you 
either explicitly set the rect or (since 8.1.10) use 
mobileSetFullScreenRectForOrientations to specify a different rect for the 
orientation you are moving to. If the stack does not resize then it does not 
get sent a resizeStack message. Also the stack is sent orientationChanged 
regardless of the state of allowed orientations so if it’s not an allowed 
orientation then there may be no change and therefore no resizeStack.

Cheers

Monte
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Richard Gaskin via use-livecode

Jacque wrote:
> Android does receive orientationChanged messages. I've been tinkering
> with Swami's test stack, and dynamic positioning (no fullscreenMode)
> works fine with some effort.

Is there a benefit to responding to orientationChanged instead of 
resizeStack?


As long as both messages are sent it may not matter, but that's the 
thing I'm unclear on: what does orientationChanged tell us on a mobile 
device that resizeStack doesn't?  When is one sent without the other 
sent immediately after?



Brian wrote:
> I did figure out that within preOpenCard, the reported stack rect is
> still the dimensions of the saved stack file (at least on iOS).

That makes sense in a way, in that preOpenCard is sent before rendering 
and on mobile devices the stack is automatically resized, seemingly at 
the start of the rendering queue.


Still, it seems unintuitive.  Is there a reason preOpenCard couldn't be 
sent after the stack is resized but before the rendering of the content 
region occurs?


FWIW I find resizeStack works well there too, apparently sent within the 
order of things where preOpenCard is expected here, after the stack is 
resized but before the user sees the rendering result.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Brian Milby via use-livecode
I did figure out that within preOpenCard, the reported stack rect is still
the dimensions of the saved stack file (at least on iOS).  There is also
the detail that when you hide a group, it sets all of the objects to hidden
which has to be undone in a loop.  I've worked out moving the group and the
background grc, still looking at the math for the widget buttons.  This
would probably be a good place for the Navigation Bar with the option to
select none of the icons (PR submitted, still pending).

On Sun, Aug 19, 2018 at 5:31 PM, J. Landman Gay via use-livecode <
use-livecode@lists.runrev.com> wrote:

> Android does receive orientationChanged messages. I've been tinkering with
> Swami's test stack, and dynamic positioning (no fullscreenMode) works fine
> with some effort.
>
> The footer isn't a widget, it's a group containing half a dozen controls,
> so they all need to be individually managed. You were right that they
> weren't in the correct position on Android.
>
> Swami's real project has thousands of controls over many hundreds of
> unique cards. I'd hate to be the one to write all the positioning scripts
> for that. But for a single instance where he's having issues, turning off
> fullscreenMode for just that card is a feasible solution.
>
> On 8/19/18 4:05 PM, Brian Milby via use-livecode wrote:
>
>> You probably still want to set the rect for the footer to be sure it lands
>> where you want it on different size devices.  That could be done in the
>> preOpenCard handler (just put it where it needs to be for portrait)
>>
>> on preOpenCard
>> local tWidth, tHeight, tFooterRect
>> put the width of this stack into tWidth
>> put the height of this stack into tHeight
>> if tWidth > tHeight then
>>put 0,tWidth-50,tHeight,tWidth into tFooterRect
>> else
>>put 0,tHeight-50,tWidth,tHeight into tFooterRect
>> end if
>> set the rect of widget "footer" of me to tFooterRect
>> resizeStack tWidth, tHeight
>> end preOpenCard
>>
>> If the Pixel does receive the orientationChanged messages, then you could
>> use my first example.  That code does actually work on the iPhone, it is
>> just not necessary to manage it by hand like that.
>>
>> On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
>> use-livecode  wrote:
>>
>> @Brian Milby
>>>
>>
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread J. Landman Gay via use-livecode
Android does receive orientationChanged messages. I've been tinkering 
with Swami's test stack, and dynamic positioning (no fullscreenMode) 
works fine with some effort.


The footer isn't a widget, it's a group containing half a dozen 
controls, so they all need to be individually managed. You were right 
that they weren't in the correct position on Android.


Swami's real project has thousands of controls over many hundreds of 
unique cards. I'd hate to be the one to write all the positioning 
scripts for that. But for a single instance where he's having issues, 
turning off fullscreenMode for just that card is a feasible solution.


On 8/19/18 4:05 PM, Brian Milby via use-livecode wrote:

You probably still want to set the rect for the footer to be sure it lands
where you want it on different size devices.  That could be done in the
preOpenCard handler (just put it where it needs to be for portrait)

on preOpenCard
local tWidth, tHeight, tFooterRect
put the width of this stack into tWidth
put the height of this stack into tHeight
if tWidth > tHeight then
   put 0,tWidth-50,tHeight,tWidth into tFooterRect
else
   put 0,tHeight-50,tWidth,tHeight into tFooterRect
end if
set the rect of widget "footer" of me to tFooterRect
resizeStack tWidth, tHeight
end preOpenCard

If the Pixel does receive the orientationChanged messages, then you could
use my first example.  That code does actually work on the iPhone, it is
just not necessary to manage it by hand like that.

On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
use-livecode  wrote:


@Brian Milby



--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Brian Milby via use-livecode
You probably still want to set the rect for the footer to be sure it lands
where you want it on different size devices.  That could be done in the
preOpenCard handler (just put it where it needs to be for portrait)

on preOpenCard
   local tWidth, tHeight, tFooterRect
   put the width of this stack into tWidth
   put the height of this stack into tHeight
   if tWidth > tHeight then
  put 0,tWidth-50,tHeight,tWidth into tFooterRect
   else
  put 0,tHeight-50,tWidth,tHeight into tFooterRect
   end if
   set the rect of widget "footer" of me to tFooterRect
   resizeStack tWidth, tHeight
end preOpenCard

If the Pixel does receive the orientationChanged messages, then you could
use my first example.  That code does actually work on the iPhone, it is
just not necessary to manage it by hand like that.

On Sun, Aug 19, 2018 at 2:40 PM, Sannyasin Brahmanathaswami via
use-livecode  wrote:

> @Brian Milby
>
> Something just clicked... if fullscreenmode is not empty, then resizestack
> messages are not generated.
>
> You are right!  No "fillscreenmode" and 14 line of code works on iPhone.
>
> But on not my Pixel.
>
>
> --
>
> # Geometry
>
> on preOpenCard
>
> resizeStack the width of this stack, the height of this stack
>
> end preOpenCard
>
> on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
>
># check it is landscape, turn off the navigation Bar
>
> if tNewWidth > pNewHeight then
>
> put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
>
> hide group "footer"
>
> else
>
> put 0, 0, pNewWidth, pNewHeight into tBrowserRect
>
> show group "footer"
>
> end if
>
> set the rect of widget "body" of me to tBrowserRect
>
> end resizeStack
>
>
> I will issue a bug report.
>
>
> BR
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Sannyasin Brahmanathaswami via use-livecode
@Brian Milby

Something just clicked... if fullscreenmode is not empty, then resizestack
messages are not generated.

You are right!  No "fillscreenmode" and 14 line of code works on iPhone.

But on not my Pixel.


--

# Geometry

on preOpenCard

resizeStack the width of this stack, the height of this stack

end preOpenCard

on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight

   # check it is landscape, turn off the navigation Bar

if tNewWidth > pNewHeight then

put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect

hide group "footer"

else

put 0, 0, pNewWidth, pNewHeight into tBrowserRect

show group "footer"

end if

set the rect of widget "body" of me to tBrowserRect

end resizeStack


I will issue a bug report.


BR

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Brian Milby via use-livecode
If you just want the controls to have the same relative position/size, then the 
GM can handle this. If you want to change metrics based on portrait/landscape 
then you either need to add PM or write a custom resize handler that takes 
orientation into account. My code above should work for the first case (does 
not use GM). I’ll add something later this afternoon that takes orientation 
into account.

Thanks,
Brian
On Aug 19, 2018, 9:19 AM -0500, Sannyasin Brahmanathaswami via use-livecode 
, wrote:
> On 8/18/18 8:46 AM, Richard Gaskin via use-livecode wrote:
> > With LC's logical pixels, have total control over our layouts to make
> > optimal use of every precious pixel on small screens, all with no more
> > work than we've already become accustomed to after years of scripting
> > for resizable windows.
>
> Aloha, Richard,
>
> How you are keeping well, the father-in-law health business, keeping 24
> hour vigil (we know about that!) et. al.
>
> re Geometry: You keep telling us this again and again, but you never
> provide an example. I would be great if you to put example stack of say,
> a card with 20 controls, where you make the UI responsive for any device
> rect, I beginning to think the "fullScreenMode [whatEver]" may not be
> the best fit for my needs. But would not no where to being-- "I need to
> see the code!" I am one who "builds on tradition" and we like to have
> have to re-invent the wheel.
>
> Brahmanathaswami
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-19 Thread Sannyasin Brahmanathaswami via use-livecode
On 8/18/18 8:46 AM, Richard Gaskin via use-livecode wrote:
> With LC's logical pixels, have total control over our layouts to make 
> optimal use of every precious pixel on small screens, all with no more 
> work than we've already become accustomed to after years of scripting 
> for resizable windows.

Aloha, Richard,

How you are keeping well, the father-in-law health business, keeping 24
hour vigil (we know about that!) et. al.

re Geometry: You keep telling us this again and again, but you never
provide an example. I would be great if you to put example stack of say,
a card with 20 controls, where you make the UI responsive for any device
rect,   I beginning to think the "fullScreenMode [whatEver]" may not be
the best fit for my needs. But would not no where to being-- "I need to
see the code!" I am one who "builds on tradition" and we like to have
have to re-invent the wheel.

Brahmanathaswami 


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-18 Thread Brian Milby via use-livecode
@Sannyasin

Something just clicked... if fullscreenmode is not empty, then resizestack
messages are not generated.  Which is part of why the new commands were
created.  For what you want with the browser, your handlers should be very
simple.  Here's what I came up with to put the browser widget and a nav bar
on a card.  I didn't need to mess with orientation changed messages at all
since the relative positions of everything is static.  Here's my very
simplified card script:

on preOpenCard
   if the environment is "mobile" then
  set the fullscreenmode of this stack to empty
   end if
   resizeStack the width of this stack, the height of this stack
end preOpenCard

on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
   local tBrowserRect, tNavbarRect

   put 0, 0, pNewWidth, pNewHeight - 50 into tBrowserRect
   put 0, pNewHeight - 50, pNewWidth, pNewHeight into tNavbarRect

   lock screen
   set the rect of widget "Browser" of me to tBrowserRect
   set the rect of widget "Navigation Bar" of me to tNavbarRect
   unlock screen
end resizeStack

I tested it out on my iPhone and it seemed to work well.  (The preOpenCard
resizeStack is needed or else the card will be displayed in whatever size
it was originally developed in at the top left of the screen.)

Thanks,
Brian
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-18 Thread J. Landman Gay via use-livecode

On 8/18/18 7:52 PM, J. Landman Gay via use-livecode wrote:
Actually, the rect of the stack remains constant in fullscreenmode, you 
don't need to account for the engine resizing. All placement 
calculations can be done normally. That's one of the beauties of it.


I didn't express this exactly right -- it remains constant in that the 
rect of the stack represents the current on-screen rect rather than the 
size it was created at.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-18 Thread J. Landman Gay via use-livecode
Actually, the rect of the stack remains constant in fullscreenmode, you 
don't need to account for the engine resizing. All placement calculations 
can be done normally. That's one of the beauties of it.


Handling dynamic placement is no different than without fullscreenmode, 
except that you don't need to worry about ratios, resolution, or any of that.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
On August 18, 2018 1:48:09 PM Richard Gaskin via use-livecode 
 wrote:


Without fullScreenMode it's as simple as:

get the rect of this stack

FullScreenMode makes handling dynamic layout details complex.





___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-18 Thread Brian Milby via use-livecode
Here is the card script that I just tested on iOS.  It will rotate a two
object card between portrait/landscape on my phone with no issues.  It
handles either orientation as the initial orientation.

local sOrientation, sLongSide, sShortSide

on preOpenCard
   local tScreenRect

   if the environment is "mobile" then
  set the fullscreenmode of this stack to "noScale"
   end if

   -- get the dimensions of the current screen
   put the screenRect into tScreenRect

   -- figure out long/short sides
   if item 3 of tScreenRect > item 4 of tScreenRect then
  put item 3 of tScreenRect into sLongSide
  put item 4 of tScreenRect into sShortSide
   else
  put item 4 of tScreenRect into sLongSide
  put item 3 of tScreenRect into sShortSide
   end if

   put word 1 of mobileDeviceOrientation() into sOrientation
   if sOrientation is not in "portrait,landscape" then
  put "portrait" into sOrientation
   end if
   resizeStack
end preOpenCard


on orientationChanged
   local tNewOrientation

   put word 1 of mobileDeviceOrientation() into tNewOrientation
   if tNewOrientation is in "portrait,landscape" then
  put tNewOrientation into sOrientation
  resizeStack
   end if
end orientationChanged


on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight
   local tStackRect, tBrowserRect, tNavbarRect

   if sOrientation is "landscape" then
  put 0, 0, sLongSide, sShortSide into tStackRect
   else
  put 0, 0, sShortSide, sLongSide into tStackRect
   end if

   put tStackRect into tBrowserRect
   put item 4 of tStackRect - 50 into item 4 of tBrowserRect
   put tStackRect into tNavbarRect
   put item 4 of tBrowserRect into item 2 of tNavbarRect

   lock screen
   set the rect of this stack to tStackRect
   set the rect of widget "Browser" of me to tBrowserRect
   set the rect of widget "Navigation Bar" of me to tNavbarRect
   unlock screen
end resizeStack


On Sat, Aug 18, 2018 at 12:22 PM, Brian Milby  wrote:

> For your browser example, you probably want to use noScale. You just need
> to be sure you capture the rect at the right time. You don’t know the new
> rect until after the orientation changed handler ends. I’ll see if I can
> locate that stack example again that you put up. Unfortunately I can only
> test on iOS right now.
>
> One good thing I discovered is that the content inside the browser widget
> is always native resolution (at least I thought so). So the only part of
> the screen that would have distortion would be the elements outside the
> widget if you used exactFit. It sounds like that was not the case for you
> though.
>
> I agree... the fullScreenModes are most useful when you want the elements
> of the application to scale with the device size.
>
> Thanks,
> Brian
> On Aug 18, 2018, 11:37 AM -0500, Sannyasin Brahmanathaswami via
> use-livecode , wrote:
>
> I have a similar issue with a stack that
>
> a) contains a browser that wants to fill the entire screen (of any device)
> b) a tool bar on the bottom, the background ( 50 px wide) which to set to
> 2000 wide
> c) a 4 widget that appear on bottom on top to background.
>
> It should work on portrait and landscape
>
> That's it, not a complicated screen to layout, responsive... or so we
> thought
>
> Going around and around with this on support, I was using "show all"
> set at 414x736 (iPhone); and with Jacque's help to optimize my code
>
> This left pillar boxes left and right (show the stack/card color) on my
> Android.
>
> Using all the "new methods"
>
> mobileSetFullScreenRectForOrientations "portrait,portrait upside
> down","0,0,414,736"
>
> etc
>
> We were unable to gain programmatic control to use screenrect to fit the
> device.
>
> My Guess/I am wrong, HQ could let us know:
>
> seems the fullscreenmode[what-Ever-It-Is] will, at an engine level will
> override any attempt to do the simple "responsive" handlers of
>
> 
>
> # snip the orientation changed handlers,
>
> # but it all comes down to this:
>
> put the screenrect into tRect
>
> set rect to widget "browser" to \
>
> (item 1 of the tRect, item 2 of the tRect, item 3 of tRect, item 4 of
> tRect-50)
>
> 
>
> Support said
>
> use fullscreenmode "exactFit"
>
> Jacque predicted it would fail, all kinds of distortion. I used tried it,
> worked on the Pixel. (ratio of the widget at bottom barely noticeable) I
> happily deployed to my "nightly" branch
>
> When I finally dug out an iPad to test--oh horror, Jacque was right -- the
> widget and the bottom were all stretched out!
>
> So, I was stuck, went on another project, but I too would like to
>
> Ludovic THEBAULT wrote:
>
> How get the « real » rect of the stack ?
>
> is seems, if you want to do "responsive" design, that it will need to be
> done *without* using fullscreenmode, and do it by handling the screenrect
> yourself. Which defeats the purpose of fullScreenMode "help" for the
> developer.
>
> @Andy I will try the effective Screenrect to see what we get.
>
> BR
>
>
>
> 

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-18 Thread Richard Gaskin via use-livecode

Ludovic THEBAULT wrote:

> I’ve a stack for phone and a substack for tablet (with iPad ratio,
> 1024*768). i use the fullscreenmode to « show all »
>
> On android tablet, the ratio height/width is sometimes very different
> from iPad.
> I tried to change the height of the substack before open it but with 
no luck :

>
> // in the openstack handler of the mainstack
> put item 3 of the screenrect into theight
> put item 4 of the screenrect into twidth
> put theight/twidth into tratio
> set the height of stack "substackTablet" to round(1024*tratio)
> mobileSetAllowedOrientations("portrait")
> open stack "substackTablet"
> set the fullscreenmode of stack  "substackTablet" to "showall"
> set the height of  grp "grpbackground"  of stack  "substackTablet" to 
round(1000*tratio)

>
>
> => as result, the top of the stack and the bottom of the stack aren’t
> the top and the bottom of the screen. If i want my background group
> cover all the screen i need to set this top to -200 for example.
>
> How get the « real » rect of the stack ?

Without fullScreenMode it's as simple as:

get the rect of this stack

FullScreenMode makes handling dynamic layout details complex.

It's well suited for certain types of games or multimedia presentations, 
such as Monument Valley.


In those types of layouts everything is stretched to fit, without 
needing dynamic placement of individual controls.


But consider the apps on your phone.  The ones I use the most are 
gMmail, Firefox, YouTube, Twitter, Instagram, LinkedIn, Skype, 
SimpleNote, Play Music, Nextcloud, Hangouts, Telegram, Maps, Calculator, 
Ingres, and a few others.


Every one of them uses dynamic positioning of the sort we've been doing 
in LiveCode for decades by responding to the resizeStack message.


I don't know what you're working on so I can't have an opinion of 
whether fullScreenMode is a good fit.


But in practice I so rarely see other apps use that sort of scaling that 
I don't think about fullScreenMode much at all.


Now that we've had several years since the LC team did a great job of 
delivering resolution independence, handling layouts in mobile is a 
breeze compared to the complex workarounds needed before.


With LC's logical pixels, have total control over our layouts to make 
optimal use of every precious pixel on small screens, all with no more 
work than we've already become accustomed to after years of scripting 
for resizable windows.


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-18 Thread Brian Milby via use-livecode
For your browser example, you probably want to use noScale. You just need to be 
sure you capture the rect at the right time. You don’t know the new rect until 
after the orientation changed handler ends. I’ll see if I can locate that stack 
example again that you put up. Unfortunately I can only test on iOS right now.

One good thing I discovered is that the content inside the browser widget is 
always native resolution (at least I thought so). So the only part of the 
screen that would have distortion would be the elements outside the widget if 
you used exactFit. It sounds like that was not the case for you though.

I agree... the fullScreenModes are most useful when you want the elements of 
the application to scale with the device size.

Thanks,
Brian
On Aug 18, 2018, 11:37 AM -0500, Sannyasin Brahmanathaswami via use-livecode 
, wrote:
> I have a similar issue with a stack that
>
> a) contains a browser that wants to fill the entire screen (of any device)
> b) a tool bar on the bottom, the background ( 50 px wide) which to set to 
> 2000 wide
> c) a 4 widget that appear on bottom on top to background.
>
> It should work on portrait and landscape
>
> That's it, not a complicated screen to layout, responsive... or so we 
> thought
>
> Going around and around with this on support, I was using "show all"
> set at 414x736 (iPhone); and with Jacque's help to optimize my code
>
> This left pillar boxes left and right (show the stack/card color) on my 
> Android.
>
> Using all the "new methods"
>
> mobileSetFullScreenRectForOrientations "portrait,portrait upside 
> down","0,0,414,736"
>
> etc
>
> We were unable to gain programmatic control to use screenrect to fit the 
> device.
>
> My Guess/I am wrong, HQ could let us know:
>
> seems the fullscreenmode[what-Ever-It-Is] will, at an engine level will 
> override any attempt to do the simple "responsive" handlers of
>
> 
>
> # snip the orientation changed handlers,
>
> # but it all comes down to this:
>
> put the screenrect into tRect
>
> set rect to widget "browser" to \
>
> (item 1 of the tRect, item 2 of the tRect, item 3 of tRect, item 4 of 
> tRect-50)
>
> 
>
> Support said
>
> use fullscreenmode "exactFit"
>
> Jacque predicted it would fail, all kinds of distortion. I used tried it, 
> worked on the Pixel. (ratio of the widget at bottom barely noticeable) I 
> happily deployed to my "nightly" branch
>
> When I finally dug out an iPad to test--oh horror, Jacque was right -- the 
> widget and the bottom were all stretched out!
>
> So, I was stuck, went on another project, but I too would like to
>
> Ludovic THEBAULT wrote:
>
> How get the « real » rect of the stack ?
>
> is seems, if you want to do "responsive" design, that it will need to be done 
> *without* using fullscreenmode, and do it by handling the screenrect 
> yourself. Which defeats the purpose of fullScreenMode "help" for the 
> developer.
>
> @Andy I will try the effective Screenrect to see what we get.
>
> BR
>
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-18 Thread Sannyasin Brahmanathaswami via use-livecode
I have a similar issue with a stack that

a) contains a browser that wants to fill the entire screen (of any device)
b) a tool bar on the bottom, the background ( 50 px wide) which to set to 2000 
wide
c) a 4 widget that appear on bottom on top to background.

It should work on portrait and landscape

That's it, not a complicated screen to layout, responsive... or so we 
thought

Going around and around with this on support, I was using "show all"
set at 414x736 (iPhone); and with Jacque's help to optimize my code

This left pillar boxes left and right (show the stack/card color) on my Android.

Using all the "new methods"

mobileSetFullScreenRectForOrientations "portrait,portrait upside 
down","0,0,414,736"

etc

We were unable to gain programmatic control to use screenrect to fit the device.

My Guess/I am wrong, HQ could let us know:

seems the  fullscreenmode[what-Ever-It-Is] will, at an engine level will 
override any attempt to do the simple "responsive" handlers of



# snip the orientation changed handlers,

# but it all comes down to this:

put the screenrect into tRect

set rect to widget "browser" to \

(item 1 of the tRect, item 2 of the tRect, item 3 of tRect, 
item 4 of tRect-50)



Support said

use fullscreenmode "exactFit"

Jacque predicted it would fail, all kinds of distortion. I used tried it, 
worked on the Pixel. (ratio of the widget at bottom barely noticeable) I 
happily deployed to my "nightly" branch

When I finally dug out an iPad to test--oh horror, Jacque was right -- the 
widget and the bottom were all stretched out!

So, I was stuck, went on another project, but I too would like to

 Ludovic THEBAULT  wrote:

How get the « real » rect of the stack ?

is seems, if you want to do "responsive" design, that it will need to be done 
*without* using fullscreenmode, and do it by handling the screenrect yourself.  
Which defeats the purpose of fullScreenMode  "help" for the developer.

 @Andy  I will try the effective Screenrect to see what we get.

BR



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: fullscreenmode and rect of a substack on mobile device ?

2018-08-18 Thread AndyP via use-livecode
you could try using either the working or effective adjectives before the
screenRect

working ScreenRect

effective screenRect

to see if you get better results?

from the dictionary

/Adding the working adjective to either form returns the virtual
co-ordinates of each screen's working-area. The working-area of a screen is
defined to be the area not covered by OS furniture (such as the task bar on
Windows, and the Dock and Menubar on Mac OS X).

Adding the effective adjective to either form returns the area of the screen
the application has to itself. In particular, if the keyboard is activated,
it take into account if the keyboard is taking up space on the screen.
(Android and iOS only)

Note: The co-ordinates returned by the screenRect family of functions can be
anywhere in the virtual desktop /





-
Andy Piddock 


My software never has bugs. It just develops random features. 

TinyIDE  a Free alternative minimalist IDE Plugin for LiveCode 


Script editor Themer for LC http://2108.co.uk  

PointandSee is a FREE simple but full featured under cursor colour picker / 
finder.
http://www.pointandsee.co.uk  - made with LiveCode
--
Sent from: 
http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode