avoid button deformation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
avoid button deformation
Hi,
The app i am doing, it is running in my iPad where the orientation is landscape, as i really imagined it...
But when it turns to portrait, the buttons are deformed...
I imagine that yes, but i am not able to imagine how should i do this.
In my openStack i have this line:
CODE: SELECT ALL
set the fullScreenMode of this stack to "exactFit"
but even when i changed with the other options of the fullScreenMode i have the same problem.
So, how to have the same pretty look of my button in both orientations??? In my case i have one button of 50 x 50 and one image of 50x50 for this button too...
So what should i do to preserve 'round' of this button and image when i change the orientation to portrait?
thanks for your advices / councils or ideas!
Regards.
fko
The app i am doing, it is running in my iPad where the orientation is landscape, as i really imagined it...
But when it turns to portrait, the buttons are deformed...
I imagine that yes, but i am not able to imagine how should i do this.
In my openStack i have this line:
CODE: SELECT ALL
set the fullScreenMode of this stack to "exactFit"
but even when i changed with the other options of the fullScreenMode i have the same problem.
So, how to have the same pretty look of my button in both orientations??? In my case i have one button of 50 x 50 and one image of 50x50 for this button too...
So what should i do to preserve 'round' of this button and image when i change the orientation to portrait?
thanks for your advices / councils or ideas!
Regards.
fko
Re: avoid button deformation
Hi fko,
"fullscreenmode" applies to the complete STACK and not only
to any selected control, if that is what you mean.
"fullscreenmode = exactfit" will of course ALWAYS result in a possible unproportionally scaling of controls!
So you need to use another fullscreenmode or resize all cour controls manuall/by script after user changed the orientation.
And there is no other option, except living with that inconvenience
Best
Klaus
"SELECT ALL"? Do you really have this in your script?CODE: SELECT ALL
set the fullScreenMode of this stack to "exactFit"
"fullscreenmode" applies to the complete STACK and not only
to any selected control, if that is what you mean.
"fullscreenmode = exactfit" will of course ALWAYS result in a possible unproportionally scaling of controls!
So you need to use another fullscreenmode or resize all cour controls manuall/by script after user changed the orientation.
And there is no other option, except living with that inconvenience

Best
Klaus
Re: avoid button deformation
Hi Klaus,
So, for your question the answer is not!!!
I have not the SELECT ALL in my code!!! Hahaha
I don't know why this appeared here in the topic...As i have only one line!
Any of the fullScreenMode worked well for what i need...
So the option to resize the buttons sounds well for me! Even if in the theory, because when i tried to test it i found 'one problem'
I put in orientationChanged the next code
And always is giving me 50x50...Even if the button is deformed in the portrait orientation...
And for this i wondered about what and how i have to do...As what i could see is that the button was deformed but for the system the width and height are 50x50 ( so, the is nothing deformed apparently ).
Regards.
fko
So, for your question the answer is not!!!

I have not the SELECT ALL in my code!!! Hahaha
I don't know why this appeared here in the topic...As i have only one line!

Any of the fullScreenMode worked well for what i need...
So the option to resize the buttons sounds well for me! Even if in the theory, because when i tried to test it i found 'one problem'
I put in orientationChanged the next code
Code: Select all
answer the width of btn "btnFrd1" & " " & the height of btn "btnFrd1"
And for this i wondered about what and how i have to do...As what i could see is that the button was deformed but for the system the width and height are 50x50 ( so, the is nothing deformed apparently ).
Regards.
fko
Re: avoid button deformation
Well, that's one of the reasons why I still try to avoid developing for mobile 

Re: avoid button deformation
It means that there is no solution???
Regards.
fko
Regards.
fko
Re: avoid button deformation
That means that I have no idea! 

Re: avoid button deformation
Ok, so at least i can keep the hope!!! 
Any help about my problem???
Regards.
fko

Any help about my problem???
Regards.
fko
Re: avoid button deformation
OrientationChanged is sent before the screen is redrawn. To get the measurements after the redraw, put your command into a resizestack handler.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: avoid button deformation
Hi Jacque,
I put this
And also like this as what i saw in the dictionary:
But nothing is happening when i change the orientation of my iPad...So, it is evident that i am not doing it well as i have no 'answer'!
I think i didn't understand well what in the dictionary was explained about this...
So this handler it is me who has to invoke it? It is not like the OrientationChanged that is invoked 'alone' in each change?
from where should i have to invoke it to make it work???
Sorry if my questions seemed basics, but i didn't manage to do it alone, and even i didn't understand well what was explained in the dictionary...
Regards.
fko
I put this
Code: Select all
on resizeStack
answer the width of btn "btnFrd1" & " " & the height of btn "btnFrd1"
end resizeStack
Code: Select all
on resizeStack newWidth,newHeight
answer the width of btn "btnFrd1" & " " & the height of btn "btnFrd1"
end resizeStack
I think i didn't understand well what in the dictionary was explained about this...
So this handler it is me who has to invoke it? It is not like the OrientationChanged that is invoked 'alone' in each change?
from where should i have to invoke it to make it work???
Sorry if my questions seemed basics, but i didn't manage to do it alone, and even i didn't understand well what was explained in the dictionary...

Regards.
fko
Re: avoid button deformation
Mmm... Well, there is another way to go about this and that is to 'place' each object in a particular location depending on the orientation of the stack. This is my preferred method as I don't mess with android... So, I have attached a stack that will rotate and place two buttons correctly depending on the orientation of the ipad... run it in the simulator or on a device...
Hope it helps...
Hope it helps...

- Attachments
-
- padorient.livecode.zip
- (2.26 KiB) Downloaded 226 times
Re: avoid button deformation
Hi Dixie,
first of all, your code is working fine in my simulator!!!
Thanks for the example...
But for what i wanted or tried to do is not working...
I will explain you what i have, to see if you can tell me what should i do, or what i am doing wrong!
So i have one group in my card "cardL" with some elements (some of them are buttons). These buttons they have one size 40x40 and they have one icon that is round (also 40x40).
For example the first button of the seven i have is in the rect "56,273,96,213" and its location is "76,293". Adding 50 to the "Y loc" from this first button, you can find the second one, and 50 more the third one...Like this till the seventh button!
With this group i can make also vertical scrolling ( i don't know if this detail is important or not ).
In your code you have:
for me, for the landscape i would like that the button 1 will be in the position "76,293" and the button 2 will be in the position "76,343", etc...
What i don't know is what should i do for the portrait and how to find the correct location for this orientation and how finally the button in the portrait orientation won't be deformed...
And one last thing. There is one difference between Android and iOS for this? I am wondering as you said something about android in your last post...
Regards.
fko
first of all, your code is working fine in my simulator!!!

Thanks for the example...

But for what i wanted or tried to do is not working...

I will explain you what i have, to see if you can tell me what should i do, or what i am doing wrong!
So i have one group in my card "cardL" with some elements (some of them are buttons). These buttons they have one size 40x40 and they have one icon that is round (also 40x40).
For example the first button of the seven i have is in the rect "56,273,96,213" and its location is "76,293". Adding 50 to the "Y loc" from this first button, you can find the second one, and 50 more the third one...Like this till the seventh button!
With this group i can make also vertical scrolling ( i don't know if this detail is important or not ).
In your code you have:
Code: Select all
set the topLeft of group 1 to 11,10
set the right of group 2 to the width of this card -10
set the bottom of group 2 to the height of this card -10
Code: Select all
set the topLeft of btn 1 to 56,273
set the right of btn 1 to 96
set the bottom of btn 1 to 313
set the topLeft of btn 2 to 56,323
set the right of btn 2 to 96
set the bottom of btn 2 to 363
And one last thing. There is one difference between Android and iOS for this? I am wondering as you said something about android in your last post...
Regards.
fko
Re: avoid button deformation
Can you post a screen shot of your stack ?
Re: avoid button deformation
Hi Dixie,
I attach the two screenshots...
In the portrait the one, the buttons are deformed!
I hope with the screenshots and with what i wrote in the other post, now it is more understandable what i am trying to explain...
Regards.
fko
I attach the two screenshots...
In the portrait the one, the buttons are deformed!

I hope with the screenshots and with what i wrote in the other post, now it is more understandable what i am trying to explain...

Regards.
fko
Re: avoid button deformation
Are you using fullscreenMode? It looks like you are, and that you've chosen a mode that squeezes the content to fit the screen. If that's true, choose a mode that preserves the aspect ratio and does not rescale the content. For example, "exactFit" will change the proportions of objects so don't use that. Letterbox, noBorder, and showAll will work.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: avoid button deformation
Hi Jacque,
So yes, i am using "exactfit"...But i didn't notice any difference in my iPad when i tried also with "letterBox", "showAll", etc.
I created all the cards thinking in one card 1024x768 ( iPad ), even if i also want that it will work in one iPhone.
And for this my idea was to use "exactfit". But when i saw that the buttons were deformed ( from landscape to portrait ) is when i began to think in that i should control in each change of orientation ( i will see what Dixie will tell me about how to control this, to can cam make appear the button in the same place in the proportional screen... ) to keep the appearance it has in the iPad landscape format.
And the intention is that it will have this appearance for iPad and iPhone and in landscape and portrait...So, for this target, the solution is the "exactfit" as i was doing or i was wrong in my thinkings? For what i saw in the dictionary i thought that this was corresponding to my needs, but maybe it is not like this...
Regards,
fko
So yes, i am using "exactfit"...But i didn't notice any difference in my iPad when i tried also with "letterBox", "showAll", etc.

I created all the cards thinking in one card 1024x768 ( iPad ), even if i also want that it will work in one iPhone.
And for this my idea was to use "exactfit". But when i saw that the buttons were deformed ( from landscape to portrait ) is when i began to think in that i should control in each change of orientation ( i will see what Dixie will tell me about how to control this, to can cam make appear the button in the same place in the proportional screen... ) to keep the appearance it has in the iPad landscape format.
And the intention is that it will have this appearance for iPad and iPhone and in landscape and portrait...So, for this target, the solution is the "exactfit" as i was doing or i was wrong in my thinkings? For what i saw in the dictionary i thought that this was corresponding to my needs, but maybe it is not like this...

Regards,
fko