Cell formatting in Table Field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Cell formatting in Table Field
Thanks very much Craig, this is very helpfull.
Unfortunately, i cannot use a vertical calendar cause i need all the width of screen, i have lots of informations to display there.
I've found a solution using unicode char like u20dd (a circle) on a table field overlaying the calendar, it's ok on the desktop PC, but on the phone, the circles are not displayed. So another solution is necessary.
For now, I'm just going to color the text of the days.
Your script is exactly what i need to get the day clicked, do you know how I can calculate the month by getting the cell clicked (using the tabstop) ?
Unfortunately, i cannot use a vertical calendar cause i need all the width of screen, i have lots of informations to display there.
I've found a solution using unicode char like u20dd (a circle) on a table field overlaying the calendar, it's ok on the desktop PC, but on the phone, the circles are not displayed. So another solution is necessary.
For now, I'm just going to color the text of the days.
Your script is exactly what i need to get the day clicked, do you know how I can calculate the month by getting the cell clicked (using the tabstop) ?
Re: Cell formatting in Table Field
Not sure how your calendar is constructed. Are there only a series of dates without any other information? In other words, at the end of the "January" portion of the horizontal calendar, does it just read:Your script is exactly what i need to get the day clicked, do you know how I can calculate the month by getting the cell clicked (using the tabstop) ?
"27 28 29 30 31 1 2 3"
Anyway, you can determine the item clicked on:
Code: Select all
on mouseDown
put the clickchunk into tChunk
set the itemDel to tab
answer the number of items of char 1 to (word 2 of tChunk) of fld 1
end mouseDown
Craig
Re: Cell formatting in Table Field
Nice, it's exactly what i need.
Thank you very much.
Thank you very much.
Re: Cell formatting in Table Field
Time passes...
and I come to the party late. But to colorise cell 3 of row 2 of a table field, you can simply do:
set the itemDel to tab
set the backcolor of item 3 of line 2 of fld "dataset2" to red
cheers
and I come to the party late. But to colorise cell 3 of row 2 of a table field, you can simply do:
set the itemDel to tab
set the backcolor of item 3 of line 2 of fld "dataset2" to red
cheers
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Cell formatting in Table Field
Time does indeed pass (often in a non-linear way), but that is really useful information: thank you.
Re: Cell formatting in Table Field
Strongbow.
No, that is normal field behavior, and as mentioned, a table field is just a field.
The OP wanted to colorize the entire "cell" of the field, not just the text. That is why there was so much discussion...
Craig
No, that is normal field behavior, and as mentioned, a table field is just a field.
The OP wanted to colorize the entire "cell" of the field, not just the text. That is why there was so much discussion...
Craig
Re: Cell formatting in Table Field
Strongbow.
Rereading that whole thread, I recall trying to work out a possible solution using certain field properties. Again, a table field is just a field, but with certain special properties. Two of those are its "hGrid" and "vGrid" properties. It occurred to me that these identified the bounds of the enclosed "cell", even though there is no such thing as a cell. LC knows about those bounds, or it could not draw the lines, but I saw no way to exploit them.
A datagrid is far easier to manipulate in this way, since its "cells" are actual separate fields.
Anyone know if the polyGrid might be a solution?
Craig
Rereading that whole thread, I recall trying to work out a possible solution using certain field properties. Again, a table field is just a field, but with certain special properties. Two of those are its "hGrid" and "vGrid" properties. It occurred to me that these identified the bounds of the enclosed "cell", even though there is no such thing as a cell. LC knows about those bounds, or it could not draw the lines, but I saw no way to exploit them.
A datagrid is far easier to manipulate in this way, since its "cells" are actual separate fields.
Anyone know if the polyGrid might be a solution?
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Cell formatting in Table Field
Up to a point.A datagrid is far easier to manipulate in this way, since its "cells" are actual separate fields.
A datagrid is a 'supergroup' of constituent cells; and while that is useful in some ways, if one considers it to be a multi-cellular beastie, and a table field as an amoeba; one should be aware that, in some ways at least, an amoeba is easier to deal with than a brontosaurus.
Re: Cell formatting in Table Field
Richmond.
Yes, a DG has its own learning curve, but my point was, regarding the needs of the OP, that since each "cell" in a DG is an actual field, it can be colored in its entirety, as opposed to merely the text alone.
Craig
Yes, a DG has its own learning curve, but my point was, regarding the needs of the OP, that since each "cell" in a DG is an actual field, it can be colored in its entirety, as opposed to merely the text alone.
Craig
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Cell formatting in Table Field
No: that does NOT work.and I come to the party late. But to colorise cell 3 of row 2 of a table field, you can simply do:
set the itemDel to tab
set the backcolor of item 3 of line 2 of fld "dataset2" to red
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
-
- Livecode Opensource Backer
- Posts: 10078
- Joined: Fri Feb 19, 2010 10:17 am
Re: Cell formatting in Table Field
Of course you could fill your 'cell of choice' with spaces, set the backColor of those spaces, and then bung your data BEFORE the spaces.
- -
Mind you, it still looks fairly repulsive.
- -
Mind you, it still looks fairly repulsive.
