What are all the properties of a field's line?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
What are all the properties of a field's line?
I have found some properties exists such as: the backgroundColor of line i of field "myField", the padding of line i of field "myfield", etc. Where can I see a more exhaustive list of all line properties available? Can't find also in the dictionary a list. The property 'the properties of object' does this but only works with objects, not lines. Something similar maybe? Thanks!
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
Re: What are all the properties of a field's line?
Hi Monox,
there is no explicit list of properties of a line in a text field.
Check -> field Glossaray in the dictionary.
The properties of a line are a very small subset of these properties.
Best
Klaus
there is no explicit list of properties of a line in a text field.
Check -> field Glossaray in the dictionary.
The properties of a line are a very small subset of these properties.
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: What are all the properties of a field's line?
What Klaus said.
Fields are objects and have intrinsic properties like "width" or "textSize". A "line" is a chunk expression, like "word" or "character". Chunks can be said to have "properties" if you call them that, like:
But you can see that these are not really properties, and are actually the result of a function, "the length", applied to a chunk expression.
So one can think that
is a property of that line, but it is not. It is a property of a chunk of a field.
Craig
Fields are objects and have intrinsic properties like "width" or "textSize". A "line" is a chunk expression, like "word" or "character". Chunks can be said to have "properties" if you call them that, like:
Code: Select all
the length of line 3 of fld 1
So one can think that
Code: Select all
the foreColor of line 3 of fld 1
Craig
Re: What are all the properties of a field's line?
Thanks guys. Found some interesting properties reading the field entry in the dictionary. Also the properties apply to any chunk rather than just lines, great!!
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: What are all the properties of a field's line?
Exactly. You can:Also the properties apply to any chunk rather than just lines, great!!
Code: Select all
set the foreColor of char 3 of word 2 of line 5 of paragraph 4 of fld 7 to "yellow"
Anyway. it is fabulous that LC does that sort of thing.
Craig
Re: What are all the properties of a field's line?
Hi Monox18,
If you want to have a glance at an objects properties to see what's available (sometimes the dictionary glosses over base properties, for example in Data Grid), you can also just list them with the help of a script.
In the example below, you can run this from the multiline message box to list available properties in the message box along with any values that are set for the selected object:
Empty values often inherit from the card or other parent - so they're not really empty (for example backgroundColor).
I do this from time to time as sometimes props are not mentioned in documentation or if i want to see as specific value.
Also note that this will not show the dgProp[ ] of a data grid (but then documentation lists these fairly well...
Stam
If you want to have a glance at an objects properties to see what's available (sometimes the dictionary glosses over base properties, for example in Data Grid), you can also just list them with the help of a script.
In the example below, you can run this from the multiline message box to list available properties in the message box along with any values that are set for the selected object:
Code: Select all
put the properties of the selectedObject into myArray
combine myArray using return and ": "
put myArray
I do this from time to time as sometimes props are not mentioned in documentation or if i want to see as specific value.
Also note that this will not show the dgProp[ ] of a data grid (but then documentation lists these fairly well...
Stam
Re: What are all the properties of a field's line?
Hi Stam
I did try using 'the properties'. It works for the field. But doesn't work for a chunk. The responses from the others pointed me in the right direction. Opening the field entry for type: object, and screening for [of chunk] allows me to see which properties can be applied to chunks. Tnx!
I did try using 'the properties'. It works for the field. But doesn't work for a chunk. The responses from the others pointed me in the right direction. Opening the field entry for type: object, and screening for [of chunk] allows me to see which properties can be applied to chunks. Tnx!
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
Re: What are all the properties of a field's line?
Ah sorry - didn't get you were looking at chunk properties!
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: What are all the properties of a field's line?
Stam.
What came out of this thread is that chunks, possibly a new idea for Monox18, do not have properties. They "seem" to, because if one changes the foreColor of a char in a field to yellow, that char sure as hell looks yellow.
The point being that something real (a character) that looks yellow may not have such a property; that only fields have properties, and one can drill down into those properties to the char level.
I know *you* know this (Is that the right way to emphasize a word without shouting it?).
Craig
What came out of this thread is that chunks, possibly a new idea for Monox18, do not have properties. They "seem" to, because if one changes the foreColor of a char in a field to yellow, that char sure as hell looks yellow.
The point being that something real (a character) that looks yellow may not have such a property; that only fields have properties, and one can drill down into those properties to the char level.
I know *you* know this (Is that the right way to emphasize a word without shouting it?).
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: What are all the properties of a field's line?
@Monox18.
If you even need more clarification, the dictionary states that a "chunk" is "a part of the text in a container". I think that is poorly written, but my point here is that a container, a gadget that dates back to Hypercard in 1987, is anything that can hold data, a field, variable, button, URL or image. So if you have nothing better to do, like me and Richmond, think about this.
A new button on a new card:
You get "B" in the dialog. OK, makes sense. A button is a container and can store text. But now:
LC barks. the "foreColor" property is unique to fields, not to just every container. You would get the same error if you had "ABC" in a variable and tried to set its foreColor. This is instructive in that one can see that it makes no sense to try any of those last.
A field is different; it *displays* data, and has been gifted with the ability to do things like show us a yellow character. In a sense, there should be nothing intrinsically wrong with trying to set the foreColor of a chunk in a variable, but one cannot. It is the way LC is built, and you just have to know.
Craig
If you even need more clarification, the dictionary states that a "chunk" is "a part of the text in a container". I think that is poorly written, but my point here is that a container, a gadget that dates back to Hypercard in 1987, is anything that can hold data, a field, variable, button, URL or image. So if you have nothing better to do, like me and Richmond, think about this.
A new button on a new card:
Code: Select all
put "ABC" into button 1
answer char 2 of bin 1
Code: Select all
set the foreColor of char 2 of btn 1 to "yellow"
A field is different; it *displays* data, and has been gifted with the ability to do things like show us a yellow character. In a sense, there should be nothing intrinsically wrong with trying to set the foreColor of a chunk in a variable, but one cannot. It is the way LC is built, and you just have to know.
Craig
Re: What are all the properties of a field's line?
In a sense yes. I have always used chunks. In loops, accessing the last char, the first char, deleting line x of, etc. I thought chunks were mere LC syntax for specific functions/commands/properties. What it's new to me is that many field's functions can be applied to either the entire field or the individual chunk. Not all but many of them. Reason of this post to find them out.
Most functions for other controls or containers only target the control as a whole and not the individual chunk. I'm now seeing the field as a much more complex object. I'd like to think a field is a collection of chunks and each chunk can be thought of an object with functions (which I call chunk properties).
foreColor/foregroundColor are available to all objects. I suppose you meant only in fields this function can be also applied to chunks.
So I'm starting to think one can implement a more complex field behavior such as the Material Text Field Interactive Demo. With individual line heights as well as horizontal tabs, fields do have a customizable grid. With functions such as mouseChunk one can interact with each cell individually. Also fields allow to put icons/images in a chunk position. Hover/Pressed effects are also possible. The only things I'm uncertain and I think are not possible are the movement effects like moving a text across the cell positions. And the rounded borders: I can paint individual cells, but no idea how to create the rounded outline effect.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: What are all the properties of a field's line?
Well, in the sense that, say, setting the foreColor of a button does not throw an error. But it also, I believe, does not change the look of that button in any way. Possibly the only value such a property setting might have is simply to store that value. But if you need to do that, use a custom property, which seems to me much more accessible.foreColor/foregroundColor are available to all objects.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: What are all the properties of a field's line?
Not to put too fine a point on this, but I would not think of these chunk concepts as "functions". I know what you mean, but don't. Functions are very well defined gadgets in LC, and neither fields, nor any controls, "have" them. I would think of a field's "properties" instead, and chunks, as, er, just chunks.What it's new to me is that many field's functions...
Craig
Re: What are all the properties of a field's line?
Alright, field's properties it is! I'm terrible at defining basic concepts even though I use them all the time . and the foregroundColor of a button is the text color of its entire label.
Monox
Developing a Cyber Physical System.
https://www.monoxware.com/
Developing a Cyber Physical System.
https://www.monoxware.com/
-
- VIP Livecode Opensource Backer
- Posts: 9648
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: What are all the properties of a field's line?
Aha.I see that the foreColor does indeed change the text of the label.
It is easy to be pretty good, but not easy to be perfect.
I had tested with a default button, which is drawn to the standards of the OS, and where that property has no effect. I see that the foreColor does indeed change the text of the label of an "ordinary" button.
I knew that.
Craig