Data Grid or Table Field and suggestions
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- Livecode Opensource Backer
- Posts: 46
- Joined: Fri Aug 02, 2013 12:14 am
Data Grid or Table Field and suggestions
I have a friend that needs me to build him a Baccarat Program that displays a gird with the hands dealt like at the casino table? I need to have red and blue circles placed under each other as in the picture? Do I use a Data Grid or Table Field. The results are being pulled from a text file so data handling is not the issue. I just have not done graphics like this and need to line them up based on the number of Banker or Player dealt.
Thank you in advance..
Thank you in advance..
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Data Grid or Table Field and suggestions
Hi.
i would definitely use a table field, with its "opaque" set to "false" along with such gadgets as borders, scrollbars and gridLines. Set the itemDel to tab, and place a single character in each "cell", with the imageSource of that character set to a colored circle. The table field will keep orderly columns, and you can manage the "stack" of circles in each column simply by managing the field text.
Craig Newman
i would definitely use a table field, with its "opaque" set to "false" along with such gadgets as borders, scrollbars and gridLines. Set the itemDel to tab, and place a single character in each "cell", with the imageSource of that character set to a colored circle. The table field will keep orderly columns, and you can manage the "stack" of circles in each column simply by managing the field text.
Craig Newman
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Data Grid or Table Field and suggestions
Hi again.
It just occurred to me that you should not set all those properties until you have built the table field itself. You do not want it disappearing on you before it is populated.
Craig
It just occurred to me that you should not set all those properties until you have built the table field itself. You do not want it disappearing on you before it is populated.
Craig
-
- Livecode Opensource Backer
- Posts: 46
- Joined: Fri Aug 02, 2013 12:14 am
Re: Data Grid or Table Field and suggestions
Craig
Thanks so much. Were on the same page as this is what I was thinking. To take the question a little further...
How to I tell it to place the Char or circle at Line 6 Tab 20? I have never used more than 3 "columns" in my programing so I was just using Tab in my code but did not need more than three?
In the past I would just use Put tab & tab & "char" into line X of Field TalbleField. How do I specify a specific location?
Thanks so much for the help. I an not new to this just not an expert either.
Thanks so much. Were on the same page as this is what I was thinking. To take the question a little further...
How to I tell it to place the Char or circle at Line 6 Tab 20? I have never used more than 3 "columns" in my programing so I was just using Tab in my code but did not need more than three?
In the past I would just use Put tab & tab & "char" into line X of Field TalbleField. How do I specify a specific location?
Thanks so much for the help. I an not new to this just not an expert either.
Re: Data Grid or Table Field and suggestions
Hi user with an unspeakable name,
you can simply:
Even if the field is empty, LC will add all neccessary empty lines and TABs.
Best
Klaus
you can simply:
Code: Select all
...
set itemdel to TAB
## short for itemdelimiter
put "11" into item 20 of line 6 of fld "your field here..."
...
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 46
- Joined: Fri Aug 02, 2013 12:14 am
Re: Data Grid or Table Field and suggestions
lol.. Sorry Klaus that I did not sign my post. Im Mike.
Thank you both for the help. Livecode people are the best and I appreciate all of you.
Thank you both for the help. Livecode people are the best and I appreciate all of you.
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Data Grid or Table Field and suggestions
What we both said.
A table field is specially constructed to be tab and return delimited. So you can think of it as an Excel-like spreadsheet. Setting the itemDel allows you to place data in specific "cells" under script control, something not available in Excel proper. There are not really any "cells", it is only that the field is formatted to act like there are. Otherwise, it is just a field with special properties, sort of like a pulldown is a button with special properties.
By hiding the field, and only showing its contents, you can simulate an array of those circles by simply managing the overall text of the field. So if you wanted to add a circle to the bottom of, say, column 2, you could:
I just used a "2" here as an example.
Craig
A table field is specially constructed to be tab and return delimited. So you can think of it as an Excel-like spreadsheet. Setting the itemDel allows you to place data in specific "cells" under script control, something not available in Excel proper. There are not really any "cells", it is only that the field is formatted to act like there are. Otherwise, it is just a field with special properties, sort of like a pulldown is a button with special properties.
By hiding the field, and only showing its contents, you can simulate an array of those circles by simply managing the overall text of the field. So if you wanted to add a circle to the bottom of, say, column 2, you could:
Code: Select all
on mouseUp
set the itemDel to tab
put the text of fld "yourTableField" into temp
put getColumn(temp,2) into nextLine
put "X" into item 2 of line nextLine of fld "yourTableField"
end mouseUp
function getColumn temp,tColumn
set the itemDel to tab
repeat with y = 1 to the number of lines of temp
if item tColumn of line y of temp = "" then return y
end repeat
end getColumn
Craig
Re: Data Grid or Table Field and suggestions
Not really a contribution on my part since it looks like Klaus and Craig pretty much went how I would anyway, Mike, but just curious if I had your unpronounceable name right in my mind when I read no1g8tor96 as "no one gator nine-six" ?Hi user with an unspeakable name,
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Data Grid or Table Field and suggestions
Has to be:
#1gator96
Craig
#1gator96
Craig
Re: Data Grid or Table Field and suggestions
I think your right Craig, yours is much better.
Re: Data Grid or Table Field and suggestions
Yes, maybe, but in the moment: your <> you are/you're
Sorry, don't get this?
Re: Data Grid or Table Field and suggestions
'Bok' is the original parent word that 'book' came from, as well as 'bark' (tree bark), if you went far enough down the language evolutionary ladder.
Re: Data Grid or Table Field and suggestions
Well, "bok" was the part that I actually "got".