Resize & orientationChanged
Posted: Fri Dec 12, 2014 5:07 pm
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:
if I understand correctly the below line of code:
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
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
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
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