Dynamically changing text field height

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
ewansmac
Posts: 15
Joined: Tue Oct 25, 2011 7:59 am

Dynamically changing text field height

Post by ewansmac » Wed Dec 21, 2011 11:37 am

I am trying to develop my first Livecode application and I need to vary the field height as I change the width of my stack. The text in the field changes from three to four lines and I want the overall height of the field to increase and decrease as the number of lines increases and decreases. Is there a way to find how many lines are in a field?

Regards,

ewansmac

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Dynamically changing text field height

Post by jmburnod » Wed Dec 21, 2011 12:14 pm

Hi EwansMac,

And welcome to this forum
Is there a way to find how many lines are in a field?
Effectives lines (with return char) or visibles lines ?
For effectives lines use the num of lines of ffld "myField"

For visibles lines you can get the height of the text of the field
check "formattedHeight" in LC dictionary. It explane better than me :oops:

Best regards

Jean-Marc
https://alternatic.ch

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Dynamically changing text field height

Post by Dixie » Wed Dec 21, 2011 4:49 pm

Ewansmac...

I've got the general idea of what you wish to do... I think :D
I have attached a stack for you to look at... have a look at the card script and the geometry settings of fld 1

hope it helps...

Dixie
Attachments
ChangeFldSize copy.livecode.zip
(1.68 KiB) Downloaded 319 times
Last edited by Dixie on Wed Dec 21, 2011 5:35 pm, edited 1 time in total.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10309
Joined: Wed May 06, 2009 2:28 pm

Re: Dynamically changing text field height

Post by dunbarx » Wed Dec 21, 2011 5:01 pm

You must play with the several points raised by your responders. The difference between hard delimited lines and wrapped lines is key here. Make sure you are comfortable with that subtle but important distinction.

So your field expands when the stack width does?

Post Reply