[ANN] Table Lab

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

Post Reply
netdzynr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 62
Joined: Sat Apr 08, 2006 6:04 am
Contact:

[ANN] Table Lab

Post by netdzynr » Fri Aug 07, 2015 2:32 am

This stack demonstrates a way to customize a field control so that it includes alternating colored lines and behaves like a row-based table. While the field uses a behavior script, no other controls are used to achieve the result beyond the field itself. The key to the effect is the use of custom margin settings and a negative textShift value applied to the text.

This technique does have a few limitations, such as the need to populate the field with empty lines if the amount of content runs shorter than the height of the field. For myself, I like the simplicity of using this control in place of a data grid or other complex object, where possible.

The stack was built in LC7 and takes advantage of the tabAlign property, but has been saved in legacy format, so it should run in any version of LC from 5.5 onward (minus the tab alignment feature).

Free to use and adapt for anything.
Attachments
TableLab.livecode.zip
(5.51 KiB) Downloaded 455 times

tomBTG
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 73
Joined: Fri Nov 25, 2011 6:42 pm
Location: Kansas City

Re: [ANN] Table Lab

Post by tomBTG » Fri Aug 07, 2015 4:03 am

Thanks, Scott!
Tom Bodine

netdzynr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 62
Joined: Sat Apr 08, 2006 6:04 am
Contact:

Re: [ANN] Table Lab

Post by netdzynr » Fri Aug 07, 2015 4:16 am

No problem. Hope the stack is useful for you.

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am
Location: Bordeaux, France

Re: [ANN] Table Lab

Post by Dixie » Fri Aug 07, 2015 5:58 am

Scott Rossi...:-)

A nice piece of work...
Have you seen a similar offering that Bernd Niggeman made back in March ?... modTableField

golive
Posts: 98
Joined: Wed Jul 01, 2015 5:16 am

Re: [ANN] Table Lab

Post by golive » Fri Aug 07, 2015 6:05 am

Useful, thanks.
:idea:

netdzynr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 62
Joined: Sat Apr 08, 2006 6:04 am
Contact:

Re: [ANN] Table Lab

Post by netdzynr » Fri Aug 07, 2015 6:23 am

Dixie wrote:Scott Rossi...:-)

A nice piece of work...
Have you seen a similar offering that Bernd Niggeman made back in March ?... modTableField
Thanks for the kind words. I've been looking at Bernd's stacks for years, and am familiar with modTableField -- Bernd makes great things. (In fact, I sent an early copy of this to Bernd since I know he's been exploring solutions for alternating color rows.)

While not as feature-rich as modTableField, this table is a single object with no object dependencies, which makes it pretty easy to use. Clearly it has some limitations, but I've been using the technique in mobile lists for a while now and so far it has worked well.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”