controlling horiz. alignment of text or objects in tables

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

Post Reply
billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

controlling horiz. alignment of text or objects in tables

Post by billworld » Thu Nov 06, 2008 1:44 am

How do you guys go about controlling the horizontal positioning of text in table columns?

I'm used to FileMaker portals with its elegant manner of treating each column as a unique field with its own horiz/vert. positioning.

This makes it a snap to set Col. 1 as left aligned, Col 2 centered, etc.

Is the only way to accomplish this in RR by inserting blank space before/after values?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Nov 06, 2008 6:52 am

Table fields are unfortunately one of the weaker areas of Revolution - there is no alignment per column, let alone per cell.

If you're looking for the equivalent of a Filemaker 'portal' then the closest match is a 'group' - you can make one template group and clone that as many times as you need, placing them one below the other inside another group that takes care of the scrolling.

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

Post by billworld » Thu Nov 06, 2008 4:33 pm

Thanks. I was aware of that possibility and gave it a go, but, I'm wrestling with understanding how to implement it. How do you constrain the display of the repeated elements to only display within the scrolling group? Do you somehow create a rectangle boundary area and cause the content to only appear within said rectangle?

Any examples of this technique available? I'm not finding anything in the docs.

Thanks

Bill
Janschenkel wrote:Table fields are unfortunately one of the weaker areas of Revolution - there is no alignment per column, let alone per cell.

If you're looking for the equivalent of a Filemaker 'portal' then the closest match is a 'group' - you can make one template group and clone that as many times as you need, placing them one below the other inside another group that takes care of the scrolling.

Jan Schenkel.

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Thu Nov 06, 2008 6:29 pm

You would have two types of groups:
- an 'outer' group that is the 'portal', and which has its 'lockLocation' property set to true, as well as its scrollbars.
- a set of 'inner' groups that form your individual detail blocks, and are nested in the 'outer' group.

While it doesn't exactly cover everything you'll need, you may want to look at this article from the July 22, 2006 newsletter: Creating a User Interface List with Blind Effect which uses a similar combination of an 'outer' group with a set of 'inner' groups.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

Post by billworld » Thu Nov 06, 2008 11:42 pm

I've been following the step-by-step in the newsletter you pointed me to. However, there are some code errors in it which are creating stumbling blocks.

First of all, the following line from the first code excerpt is incorrect. Searching the RR dictionary I don't see any keyword entries for "font" or "color". So, I just comment that out and put in a return before "end repeat" so that it compiles.

Code: Select all

font color="#980517"> end repeat
Fine, I got over that obstacle. Then, following the directions I get an error attempting to compile the List group code on the following line taken from the tutorial.

Code: Select all

end repeat vscroll of me to the vscroll of me
The stuff after "end repeat" looked suspicious, so I commented it out. Okay, it compiles now. However, testing the solution yields no blinding effect. Are the other errors in the tutorial code?

Is there a more accurate, more up-to-date tutorial which demonstrates either this technique or one which shows how to use RR to mimic the portal row functionality inherent in FileMaker Pro?
Janschenkel wrote:You would have two types of groups:
- an 'outer' group that is the 'portal', and which has its 'lockLocation' property set to true, as well as its scrollbars.
- a set of 'inner' groups that form your individual detail blocks, and are nested in the 'outer' group.

While it doesn't exactly cover everything you'll need, you may want to look at this article from the July 22, 2006 newsletter: Creating a User Interface List with Blind Effect which uses a similar combination of an 'outer' group with a set of 'inner' groups.

HTH,

Jan Schenkel.

billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

Post by billworld » Thu Nov 06, 2008 11:49 pm

I have to add that the faulty code in the tutorial caused my RR to lock up on two occasions. Two more RR force quits have been added to my growing list of RR force quits. Frustrating indeed!

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Fri Nov 07, 2008 12:17 am

Those errors you have on that newsletter page seem to be where the editor of the web page has made a few html mistakes. The font declaration is, I think, is meant to be part of the page code, not the Rev code. Similarly the end repeat vscroll... bit is an editing error when creating the newsletter page.
If you have version 3 of Rev with the Resource Center icon in the toolbar, you will find the same tutorial under the Graphical Interfaces section, which seem to be free of those particular errors.

billworld
Posts: 188
Joined: Sat Oct 25, 2008 12:32 am

Post by billworld » Fri Nov 07, 2008 12:37 am

Thanks. I'll give that a go. So many tutorials to go through! (But, learning...)
SparkOut wrote:Those errors you have on that newsletter page seem to be where the editor of the web page has made a few html mistakes. The font declaration is, I think, is meant to be part of the page code, not the Rev code. Similarly the end repeat vscroll... bit is an editing error when creating the newsletter page.
If you have version 3 of Rev with the Resource Center icon in the toolbar, you will find the same tutorial under the Graphical Interfaces section, which seem to be free of those particular errors.

Post Reply