Data Grid or Table Field and suggestions

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

no1g8tor96
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 46
Joined: Fri Aug 02, 2013 12:14 am

Re: Data Grid or Table Field and suggestions

Post by no1g8tor96 » Thu Aug 02, 2018 5:40 pm

Guys...your making me laugh.

I am a Florida Gator Grad in 96...yea im old. Not really a secret. Thnaks for the # suggestion.

Any ways. I am just having a time getting a stupid blue or red dot in a gird.

Could you guys help me with this...I tried making a bitmap red and blue circle and its not populating and then a circle graphic that looks good but can figure out how to populate with a grc? was there any lessons on this as well.

I dont want to populate the grid with a bunch of circles and just hide or make them visible. I would like to say put "banker" into item 1 of line 1 of table "BacTable" or something like this. I am sorry I have not worked with graphics in Livecode only text base stuff.

Thanks again

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Data Grid or Table Field and suggestions

Post by bogs » Thu Aug 02, 2018 5:50 pm

Klaus wrote:
Thu Aug 02, 2018 4:49 pm
Well, "bok" was the part that I actually "got". :D
bogs wrote:
Thu Aug 02, 2018 2:49 pm
Otherwise, I'd have to ask you to pass me the 'bok', which we wouldn't be able to do any light reading in.
Well, if you were trying to read a 'bok' (which was made of tree bark), I can't imagine the reading of it being 'light' (weight wise, anyway). Can you imagine a 30 page pamphlet made of birchwood? It would weigh a LOT :wink:
no1g8tor96 wrote:
Thu Aug 02, 2018 5:40 pm
Guys...your making me laugh.
....I am a Florida Gator Grad in 96...yea im old. Not really a secret.
Glad to give you the chuckle, but '96 makes you barely broken in, Klaus and I have wrinkles older than you :P
Image

no1g8tor96
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 46
Joined: Fri Aug 02, 2013 12:14 am

Re: Data Grid or Table Field and suggestions

Post by no1g8tor96 » Thu Aug 02, 2018 5:55 pm

lol.

I hope maybe your wisdom can help me out with this. This should be a simple little program to put dots in a grid and its making me insane.

Thank you


Mike

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

Re: Data Grid or Table Field and suggestions

Post by dunbarx » Thu Aug 02, 2018 8:26 pm

Mike.

We were not talking about creating a matrix of individual controls, butt rather using a single table field. That gadget has the XY stuff already in place, ready to go.

Do you understand what I meant by setting the "imageSource" property of each character in that field? Do you understand that when a single character is placed in each "cell", it will appear as either a red or blue dot?

Write back...

Craig

no1g8tor96
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 46
Joined: Fri Aug 02, 2013 12:14 am

Re: Data Grid or Table Field and suggestions

Post by no1g8tor96 » Thu Aug 02, 2018 9:46 pm

Craig

I see what I was doing wrong. I was not populating a character in the cell before setting the image. I will have to tell it to put a 1 or something in it first then set the image source. I need get a better circle without a background. Do I have to get make a PNG file or can I make a circle graphic and set the image to that with livecode? They look much cleaner with the circle tool?

Also can you set different padding and spacing within the cells to align the graphic better?

Thanks

no1g8tor96
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 46
Joined: Fri Aug 02, 2013 12:14 am

Re: Data Grid or Table Field and suggestions

Post by no1g8tor96 » Thu Aug 02, 2018 9:54 pm

Craig,

I am playing with it and see how resizing changes it but can get it centered in the cell?

Thanks

Mike

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

Re: Data Grid or Table Field and suggestions

Post by dunbarx » Thu Aug 02, 2018 10:51 pm

Hi.

Of course we are fitting a function into a space that is not exactly built for it.

I assume you have an image and will soon have a "characterImage".

So say you have a table field with several rows and columns filled with a single char in each "cell". And you set the imageSource of ONE of them to the image you are using. This will be the "characterImage". Now if you change the rect of the image in the property inspector, you will see the "characterImage" change at the same time, live.

Play with the textSize of the field, and maybe the margins. That is where the action is. The "characterImage" just substitutes for the char; it has no other llfe.

Know that there is no way to set the size of the "characterImage" directly via text properties. Changing, say, the textSize of a particular line will indeed change the text in that line, but the"characterImage" will not change. Try it.

But this should not matter. Once you have chosen a field of the right size, and a textSize and the tabStops to space the "characterImages" the way you want them in both X and Y, you simply have to move the entire field until it all looks right.

As for getting a decent colored circle, you need to make one in some other program and save it as a png or whatever. Then when you import it, you can adjust its rect.

Is this clear?

Craig

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

Re: Data Grid or Table Field and suggestions

Post by dunbarx » Thu Aug 02, 2018 10:57 pm

Also can you set different padding and spacing within the cells to align the graphic better?
I should have read more carefully.

A table field is adorable, but is limited in certain ways, derived from the limitation that it is just a field, after all.

What you want to play with are the "tabStops" and the textHeight. These two properties will allow you to modify the horizontal and vertical spacing of the "cells". Play with both right in the inspector. If you have this down, there is no longer any issue with justification, since moving the entire field will align the chars vertically to any index you choose.

Craig

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7230
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Data Grid or Table Field and suggestions

Post by jacque » Fri Aug 03, 2018 5:50 pm

There is a tabAlign property that will center your images inside each tab.

I'd start with a plain field. Import a png image for the circle. Set the tabstops of the field to as many columns as you need and set the tabAlign of each tabstop to center:

Code: Select all

set the tabAlign of field 1 to "center, center, center, center, center, center" - - six tabs


When you need to add a dot, put a character into the appropriate item of the correct line and set its imagesource to the ID of the png. Once you have a few of these you'll be able to adjust the tabs and the textheight of the field to make them fit visually.

You're right images aren't as clear as vector graphics but for now that's all we can use. If you make the png at a high resolution, or make it large and resize it in LC, it might look better.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Data Grid or Table Field and suggestions

Post by bogs » Fri Aug 03, 2018 8:19 pm

To give Jacque's example a bit more clarity (I don't think it needs it, but figure it can't hurt), you can look at this lesson about putting a table in an ordinary field to get you started visualizing.
Image

no1g8tor96
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 46
Joined: Fri Aug 02, 2013 12:14 am

Re: Data Grid or Table Field and suggestions

Post by no1g8tor96 » Sat Aug 04, 2018 3:35 am

Thanks guys for all the help. Im almost done.

Mike

Gerizineink
Posts: 2
Joined: Wed Apr 03, 2024 12:38 pm

Re: Data Grid or Table Field and suggestions

Post by Gerizineink » Tue Apr 23, 2024 8:28 am

Good job, helpful

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”