Resize & orientationChanged

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Resize & orientationChanged

Post 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
jekyllandhyde
Posts: 92
Joined: Thu Feb 14, 2013 7:17 pm

Re: Resize & orientationChanged

Post 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
francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: Resize & orientationChanged

Post 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
MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Resize & orientationChanged

Post 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))
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
francof
Posts: 237
Joined: Fri Apr 11, 2014 10:51 am

Re: Resize & orientationChanged

Post by francof »

ciao Max,
I will try.

grazie
franco
Post Reply