Cell formatting in Table Field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Cell formatting in Table Field
Hi,
I want to make a horizontal calendar with a table field with 365 cells that user can scroll from 01/01 to 31/12.
Each cell is a day, and the user can click on every cell to display a form, and entering some infos about the choosen day.
I want to color every day according to the information entered.
The table field has a CellFormatting option, but i don't find any information about it.
How can i use it to format every cell of my table ?
I want to make a horizontal calendar with a table field with 365 cells that user can scroll from 01/01 to 31/12.
Each cell is a day, and the user can click on every cell to display a form, and entering some infos about the choosen day.
I want to color every day according to the information entered.
The table field has a CellFormatting option, but i don't find any information about it.
How can i use it to format every cell of my table ?
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cell formatting in Table Field
Hi.
A table field is just a field with certain properties. You can set the backColor (or the textColor) of, say, line 20 of that field to, say, "red".
You may want to change the margin properties so that the backColor completely fills the "cell". Some other tweaks will likely be necessary as well...
So when you display your "form", just set the properties of the line of interest.
Craig
A table field is just a field with certain properties. You can set the backColor (or the textColor) of, say, line 20 of that field to, say, "red".
You may want to change the margin properties so that the backColor completely fills the "cell". Some other tweaks will likely be necessary as well...
So when you display your "form", just set the properties of the line of interest.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cell formatting in Table Field
I just saw that you wanted a horizontal calendar, so the natural parsing available with lines is not valid. All the data resides in line 1, no?
Have to play with this for a while, but at least you can do odd things like:
But I am not sure there is a way to set the backColor of a "cell". That is, after all, only a region of the field as determined by the tabStop of that "cell". You may have to overlay a blendLeveled control of the "width" of the "cell", located with a bit of math.
Anyone know how to set the backColor of item 3 of a table field, items set to tabs?
Craig
Have to play with this for a while, but at least you can do odd things like:
Code: Select all
on mouseDown
put the clickchunk into tChunk
set the itemDel to tab
do " set the backColor of tChunk to red"
end mouseDown
Anyone know how to set the backColor of item 3 of a table field, items set to tabs?
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cell formatting in Table Field
On another note, since you mention it, I have no idea what the cellFormat property is. It does not appear in the dictionary.
Sounds interesting, though.
Anyone?
Craig
Sounds interesting, though.
Anyone?
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cell formatting in Table Field
Boggsie.
No joke. i asked for the entire cell, not just the text within,
Craigsie.
No joke. i asked for the entire cell, not just the text within,
Craigsie.
Re: Cell formatting in Table Field
My bad, comprehension hasn't kicked in yet
Re: Cell formatting in Table Field
Too bad there is few to no documentation for the TABLE field.
The "revtablelibrary" scripts look really promising!
The "revtablelibrary" scripts look really promising!
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cell formatting in Table Field
So I guess that in order to colorize a full "cell", one would have to overlay, say, a button with a moderate blendLevel, size it and place it by keeping track of the hScroll and calculating the tabStops of the item of interest?
Craig
Craig
Re: Cell formatting in Table Field
Thanks to all for the help !
Actually, the calendar is contained in a table with only one very long line that the user can scroll.
The idea of using some clickable blendLeveled object in front of the table field is very smart, but i have to check if this will not create too much object on the card. And too much mouseUp script too...
However, perhaps something with the clickchunk keyword with the backcolor property of item X in line Y is a beginning of a solution. I didn't know how to get the day clicked. This is a beginning...
In fact, on this calendar, each day must visually indicate if, for this day, information has been totally entered, partially entered, no information entered (for example, icon, background, anything else... in green, orange, white).
Perhaps i can just display the border of cells in the appropriate color...
Perhaps i can overlay a table field with same structure and with some colorized graphical ASCII text like circle, square,...
Actually, the calendar is contained in a table with only one very long line that the user can scroll.
The idea of using some clickable blendLeveled object in front of the table field is very smart, but i have to check if this will not create too much object on the card. And too much mouseUp script too...
However, perhaps something with the clickchunk keyword with the backcolor property of item X in line Y is a beginning of a solution. I didn't know how to get the day clicked. This is a beginning...
In fact, on this calendar, each day must visually indicate if, for this day, information has been totally entered, partially entered, no information entered (for example, icon, background, anything else... in green, orange, white).
Perhaps i can just display the border of cells in the appropriate color...
Perhaps i can overlay a table field with same structure and with some colorized graphical ASCII text like circle, square,...
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cell formatting in Table Field
Hi.
It is certainly possible to do all you want. But because it requires more from a table field than is natively within that field, kluges will be required.
Just one more time (as I mistakenly thought at the top of this thread), much is simplified if the scroll can be vertical instead of horizontal. Is this a possibility at all?
If not, we start kluging.
Craig
It is certainly possible to do all you want. But because it requires more from a table field than is natively within that field, kluges will be required.
Just one more time (as I mistakenly thought at the top of this thread), much is simplified if the scroll can be vertical instead of horizontal. Is this a possibility at all?
If not, we start kluging.
Craig
Re: Cell formatting in Table Field
OOOoooo, this should be good!
(taking seat in back of class)
(taking seat in back of class)
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cell formatting in Table Field
Try this in the script of a table field where there is data in each "cell" of the first line of that field:
Click on one or more "cells". Is this enough of a marker? The choice of color can be selected based on your own criteria.
Craig
Code: Select all
on mouseDown
put the clickchunk into tChunk
do " set the backColor of tChunk to blue"
end mouseDown
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9655
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Cell formatting in Table Field
You don't even need to use the "do" construction:
You need to check the clickText; the problem with this sort of kluge is that the "cell" is not accessible as a whole the way we want it, and it matters when you are trying to pin it down with the clickChunk.
Anyway, is this just too much to ask of a table field? It would be asking more if we follow the path of overlaying tinted controls. This can be done, of course.
craig
Code: Select all
on mouseDown
if the clickText <> "" then set the backColor of the clickChunk to "red"
end mouseDown
Anyway, is this just too much to ask of a table field? It would be asking more if we follow the path of overlaying tinted controls. This can be done, of course.
craig