Table Field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Table Field
Hello All
Im trying to find some info on how to edit the size of a table field (for example an 8X8)
and then also be able to do this problematically
Ive looked around on google and within the search bar on the forums/live code website
so if anyone could point me to the documentation it would be appreciated
note has to be a table field and not data grid...
Im trying to find some info on how to edit the size of a table field (for example an 8X8)
and then also be able to do this problematically
Ive looked around on google and within the search bar on the forums/live code website
so if anyone could point me to the documentation it would be appreciated
note has to be a table field and not data grid...
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Table Field
"8x8" what? Probably not pixels. Do you mean "cells"?
The size and location of any object in LiveCode is determined by its rectangle property.
Column widths are determined the field's tabWidth property.
The height of a line of text in a field is determined by the field's textHeight property.
Does that help?
The size and location of any object in LiveCode is determined by its rectangle property.
Column widths are determined the field's tabWidth property.
The height of a line of text in a field is determined by the field's textHeight property.
Does that help?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Table Field
it does help, thank you
i was able to do this with the property inspector(editing the tab stops and font size) but i was wondering how would you do this programmatically
i was able to do this with the property inspector(editing the tab stops and font size) but i was wondering how would you do this programmatically
Re: Table Field
also @fourthworld
i noticed in your signature you offer training services?
i noticed in your signature you offer training services?
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Table Field
Property syntax in LC is fairly consistent across properties and objects, e.g.:
Code: Select all
set the rect of fld 1 to 20,20,600,600
set the tabStops of fld 1 to 200
The exact values you'd use will of course depend on the specifics of your layout. For an understanding of those properties, see the Dictionary entries for each.
I do, and have been since before LiveCode 1.0. Feel free to drop me an email to discuss what you'd like help with: ambassador AT fourthworld DOT comi noticed in your signature you offer training services?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Table Field
related to this same table
how would one change the contents of a Label without using the Property Inspector only Progamatically
how would one change the contents of a Label without using the Property Inspector only Progamatically
Re: Table Field
Code: Select all
set the label of btn "xyz" to "I'm a label!"
I can recommend these stacks to learn the very basics of LC:
http://www.hyperactivesw.com/revscriptc ... ences.html
Re: Table Field
what if i just want change the contents of a label itself
Re: Table Field
Is this a TABLE field in the screenshot?
A TABLE FIELD is basically just a scrolling text field and the content is TAB and CR delimited text.
So to change the text in the first line, which is NOT a LABEL, just the string LABEL ***, do like this:
*** Please get used to use the correct terms to avoid misunderstandings in the future.
A TABLE FIELD is basically just a scrolling text field and the content is TAB and CR delimited text.
So to change the text in the first line, which is NOT a LABEL, just the string LABEL ***, do like this:
Code: Select all
...
set itemdel to TAB
put "a label" into item 1 of line 1 of fld "your table field here"
## Change line 3, too:
put "No label" into item 1 of line 3 of fld "your table field here"
## etc. you get the picture...
...
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Table Field
Those aren't labels; they are just the first item in each row of a table field.
- -
- -
Code: Select all
on mouseUp
put 1 into KOUNT
repeat until KOUNT > 12
put ("Line" && KOUNT) into item 1 of line KOUNT of fld "tf"
add 1 to KOUNT
end repeat
end mouseUp
- Attachments
-
- Tabler.livecode.zip
- Here's the stack.
- (1.07 KiB) Downloaded 168 times
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Table Field
Just too hard to resist:
- -
- -
- Attachments
-
- Tabler.livecode.zip
- Here's the stack.
- (1.26 KiB) Downloaded 180 times
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Table Field
This doesn't work:
as it sets the backGroundColor of the whole tableField to red.
I wonder if there is a way to set individual "cells" to a colour?
Code: Select all
set the backGroundColor of item 1 of line 1 of fld "tf" to red
I wonder if there is a way to set individual "cells" to a colour?
Re: Table Field
Did you try changing the itemDelimter to tab?
You can do all kinds of neat stuff in just 15 minutes (or less)
Code: Select all
# in the button script...
on mouseUp
put "" into field 1
set the itemDelimiter to tab
repeat with x=1 to 20
put any line of the colorNames into item random(20) of line random(20) of field 1
end repeat
repeat with x=1 to the number of words in field 1
put word x of field 1 into tmpVar
set the backGroundColor of word x of field 1 to tmpVar
end repeat
end mouseUp
-
- Livecode Opensource Backer
- Posts: 9359
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Table Field
Yes.Did you try changing the itemDelimter to tab?
Code: Select all
on mouseUp
put empty into fld "tf"
set the itemDelimiter to TAB
------
set the backGroundColor of item 1 of line 1 of fld "tf" to red
put "be" into item 2 of line 2 of fld "tf"
put "completely" into item 3 of line 3 of fld "tf"
put "bonkers" into item 4 of line 4 of fld "tf"
put "!!!!!!!!!!" into item 5 of line 5 of fld "tf"
end mouseUp