Cell formatting in Table Field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

synto
Posts: 40
Joined: Thu Jul 18, 2019 9:31 am
Location: Paris, Fr

Re: Cell formatting in Table Field

Post by synto » Thu Aug 22, 2019 9:15 am

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) ?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9747
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Cell formatting in Table Field

Post by dunbarx » Thu Aug 22, 2019 12:37 pm

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) ?
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:

"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
which will tell you which day of the year, like 125, you have. 125 would be in April. Watch out for leap years.

Craig

synto
Posts: 40
Joined: Thu Jul 18, 2019 9:31 am
Location: Paris, Fr

Re: Cell formatting in Table Field

Post by synto » Thu Aug 22, 2019 12:52 pm

Nice, it's exactly what i need.
Thank you very much.

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”