Entering text on a card
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Posts: 7
- Joined: Thu Apr 11, 2013 11:03 pm
Entering text on a card
Hi everyone. I am new to the forum, although I have been using Livecode for around one year.
I cannot figure out how to draw text onto a card. I am doing some graphing and I wish to label the graph. This will include labeling the axes and some labels on the line graphs. Thanks in advance Victor
I cannot figure out how to draw text onto a card. I am doing some graphing and I wish to label the graph. This will include labeling the axes and some labels on the line graphs. Thanks in advance Victor
Re: Entering text on a card
Hi Victor,
I must not be understanding the question because you just drag a text entry field onto you card and enter text.
Or was there something more to your question? Dynamically do you mean?
Simon
I must not be understanding the question because you just drag a text entry field onto you card and enter text.
Or was there something more to your question? Dynamically do you mean?
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- Posts: 7
- Joined: Thu Apr 11, 2013 11:03 pm
Re: Entering text on a card
Simon, Yes I mean dynamically. The axes will have different placements and labeling depending on the range of values to graph. Therefore I would not be able to drag a text entry as I design the card. Also the graphed lines will have different shapes and positioning depending on the data values. Therefore, I need a way to put text labels( which will often be numbers) by code. Victor
Re: Entering text on a card
OK,
To start, all your text will be horizontal, there are ways to rotate them by taking a snapshot but thats for later. You have two empty fields (best use a label field) named fieldX and fieldY
You just need to:
put "this is my Y Label" into field "fieldY"
put "this is my X label" into field "fieldX"
Simon
To start, all your text will be horizontal, there are ways to rotate them by taking a snapshot but thats for later. You have two empty fields (best use a label field) named fieldX and fieldY
You just need to:
put "this is my Y Label" into field "fieldY"
put "this is my X label" into field "fieldX"
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Entering text on a card
Hi.
Simon is right about loading text.
Do you know how to create a field on the fly, set its loc, and also set its rect, perhaps according to the amount of text it holds? I think that is what you were asking as well, but please let us know.
Craig Newman
Simon is right about loading text.
Do you know how to create a field on the fly, set its loc, and also set its rect, perhaps according to the amount of text it holds? I think that is what you were asking as well, but please let us know.
Craig Newman
-
- Posts: 7
- Joined: Thu Apr 11, 2013 11:03 pm
Re: Entering text on a card
Craig, You are correct. That is what I was asking. Victor
Re: Entering text on a card
So you are creating (or showing) fields that need to be a certain size, at a certain loc, and containing certain text.
Code: Select all
on mouseUp
create fld "xAxis"
set the rect of the last field to "200,200,300,220" -- or whatever
put the short name of the last field into the last field
end mouseUp
Re: Entering text on a card
Forgot one thing.
Read up on the "formattedWidth" as it relates to fields. You cannot set this property, only read it, so you would have to find its value, and then set the width (or the original rect) of your new field as required.
Craig Newman
Read up on the "formattedWidth" as it relates to fields. You cannot set this property, only read it, so you would have to find its value, and then set the width (or the original rect) of your new field as required.
Craig Newman
-
- Posts: 7
- Joined: Thu Apr 11, 2013 11:03 pm
Re: Entering text on a card
Thanks, I will give it a try. I think that this will work with what I plan. Victor