Page 1 of 1

Resize & orientationChanged

Posted: Fri Dec 12, 2014 5:07 pm
by francof
hi all,
following this lesson, http://lessons.runrev.com/m/4069/l/2283 ... er-control
I'm trying to change the application orientations using the "orientationChanged" message.

when turn the device, the card takes the correct size. except the group "Browser" (the windows where the web pages are displayed) it remains to its original size (portrait).

this the code:

Code: Select all

on orientationChanged
   put mobileDeviceOrientation() into theOrientation
   updateInteface theOrientation -- update the interface to fit the new orientation
   
   resizeStack
end orientationChanged



on resizeStack
   if the environment is not "mobile" then
      exit resizeStack
   end if
   
   -- Adjust the size of the URL entry field
   set the rect of field "URL" to the left of field "URL", the top of field "URL", the width of this card - 4, the bottom of field "URL"
   
   -- Adjust the size of the browser view
   set the rect of group "Browser" to the left of group "Browser", the top of group "Browser", the width of this card - 4, the height of this card - 40
   
   -- Adjust the status field
   set the rect of field "Status" to 4, the bottom of group "Browser" + 4, the width of this card - 4, the height of this card - 4
   
   -- Now adjust the control itself
   mobileControlSet sBrowserId, "rect", the rect of group "Browser"
end resizeStack
if I understand correctly the below line of code:

Code: Select all

 set the rect of group "Browser" to the left of group "Browser", the top of group "Browser", the width of this card - 4, the height of this card - 40
it says:
set the size of the object "Browser" starting from the left and the top of the actual position of it, to all the width of the card (less a bit), the same for the height.
is that correct?

thanks for help
ciao
franco

Re: Resize & orientationChanged

Posted: Mon Apr 13, 2015 5:41 am
by jekyllandhyde
I'm having the same problem, the code was working until I changed my stack to: set the fullscreenmode of me to "exactFit"

No idea how to resolve the problem. I've had to temporarily disable any orientation other than portrait in my App.

Adam

Re: Resize & orientationChanged

Posted: Mon Apr 13, 2015 8:52 am
by francof
jekyllandhyde wrote: ...

No idea how to resolve the problem. I've had to temporarily disable any orientation other than portrait in my App.

Adam
me too, I don't use any more the group "Browser". instead I've used the external browser
franco

Re: Resize & orientationChanged

Posted: Tue Apr 14, 2015 10:45 pm
by MaxV
francof wrote: if I understand correctly the below line of code:

Code: Select all

 set the rect of group "Browser" to the left of group "Browser", the top of group "Browser", the width of this card - 4, the height of this card - 40
it says:
set the size of the object "Browser" starting from the left and the top of the actual position of it, to all the width of the card (less a bit), the same for the height.
is that correct?
franco
Try this:

Code: Select all

 set the rect of group "Browser" to (the left of group "Browser", the top of group "Browser", (the width of this card - 4), (the height of this card - 40))

Re: Resize & orientationChanged

Posted: Wed Apr 15, 2015 8:17 am
by francof
ciao Max,
I will try.

grazie
franco