I have a bit of code that I've used on multiple cards that resizes the text of all buttons on a card as the user resizes the stack. It works perfectly fine during development, and it continues to work for all but one card once I create the standalone app.
Basically, once the stack is resized, it calls a resize text handler, which fits the text of each button to the button's new size. Then, it looks for the smallest text size in the buttons and sets the rest of them to that size (so they all stay the same size each time). Somehow, once this is a standalone app, it doesn't work for the first card, but it still works just fine for the rest of them.
Code: Select all
#RESIZE BUTTON TEXT
repeat with x=1 to the number of buttons of current card
--store the starting size of the text of the field
put the textsize of button x of current card into tTextsize
--check to see if the size of the text is too big
if the formattedHeight of button x of current card > the height of button x of current card then
--make the text size smaller
repeat until formattedHeight of button x of current card <= the height of button x of current card
subtract 1 from tTextsize
--if the text size is not less than the minimum size of the text box
if tTextsize >= the cMinimumTextSize of button x of current card then
set the textsize of button x of current card to tTextsize
else
exit repeat
end if
end repeat
--if the text size is too small
else if the formattedHeight of button x of current card < the height of button x of current card then
repeat until the formattedheight of button x of current card >=the height of button x of current card
add 1 to tTextSize
--if the text size is not less than the minimum
if tTextsize<=the cMaximumTextSize of button x of current card then
set the textsize of button x of current card to tTextsize
else
exit repeat
end if
end repeat
end if
--check to see if the width of the text is too big
if the formattedWidth of button x of current card > the width of button x of current card then
--make the text size smaller
repeat until formattedwidth of button x of current card <= the width of button x of current card
subtract 1 from tTextsize
--if the text size is not less than the minimum size of the text box
if tTextsize >= the cMinimumTextSize of button x of current card then
set the textsize of button x of current card to tTextsize
else
exit repeat
end if
end repeat
end if
end repeat
global gSizes
repeat with x=1 to the number of buttons of current card
put the textsize of button x of current card &cr after gSizes
end repeat
sort gSizes
repeat with x=1 to the number of buttons of current card
set the textsize of button x of current card to line 1 of gSizes
end repeat
Thanks!