hiding 1st column of table field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
hiding 1st column of table field
Hi, I am trying to hide the 1st column of a table field (I do have a workaround if this does not work).
I set the tab stops of the field to 0, 300, 525, 750, etc
However instead of hiding the first column I see a column of maybe 2-3 pixels wide at the left edge of the table. I checked the firstindent (it's 0) and LC says the table does not have a leftindent property. Anything else to try before I go to my plan B?
Thanks
Mark
I set the tab stops of the field to 0, 300, 525, 750, etc
However instead of hiding the first column I see a column of maybe 2-3 pixels wide at the left edge of the table. I checked the firstindent (it's 0) and LC says the table does not have a leftindent property. Anything else to try before I go to my plan B?
Thanks
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 9857
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: hiding 1st column of table field
The indents affect paragraphs. For object margins try the leftMargin.
Let me know if that doesn't do it. I've done zero-width columns before, so I know there's a recipe somewhere. Hopefully my memory of that is all you'll need.
Let me know if that doesn't do it. I've done zero-width columns before, so I know there's a recipe somewhere. Hopefully my memory of that is all you'll need.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 9752
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: hiding 1st column of table field
Hmmm.
I tried a bunch of things. The logical solution would be just as you described, setting the first tab to 0. Even tried "0,0..."
Setting to -1 was the worst of my experiments.
Is your plan B to overlay something over column 1?
Craig
I tried a bunch of things. The logical solution would be just as you described, setting the first tab to 0. Even tried "0,0..."
Setting to -1 was the worst of my experiments.
Is your plan B to overlay something over column 1?
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9752
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: hiding 1st column of table field
I believe, though others may actually know, that the table field itself has a lower limit to its tabStops.
@Richard. I tried setting the leftmargin to 0 but that only moved the text all the way to the left. It did not hide the first tab.
Craig
@Richard. I tried setting the leftmargin to 0 but that only moved the text all the way to the left. It did not hide the first tab.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9752
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: hiding 1st column of table field
AHA.
But if you set the tabStops to, say "0,50" (or ",50") AND the leftMargin is set to 0, the first tab is hidden.
Craig
But if you set the tabStops to, say "0,50" (or ",50") AND the leftMargin is set to 0, the first tab is hidden.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9752
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: hiding 1st column of table field
It turns out this is a technique, if such a one is ever needed. You can hide any number of the leading tabs. To hide, say, the first three tabs, set them to "0,0,0,50".
And we know that one can hide interior tabs in the usual way, for example "0,50,50,100" would hide tabs 1 and 3
Craig
And we know that one can hide interior tabs in the usual way, for example "0,50,50,100" would hide tabs 1 and 3
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9857
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: hiding 1st column of table field
Thank you for clarifying. Yes, I'd intended to suggest leftMargin as a replacement for leftIndent, but not also as a replacement for tabstops. That zero-width column specifier in tabstops is the magic, the rest is just alignment.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: hiding 1st column of table field
Thank you all. That was the formula (tabstop = 0 with leftMargin = <something small>). leftMargin = 0 did hide the first column (when tabstop was set to 0) but also cut off a few pixels of the first letter in the next column. I found a setting of leftMargin = 2 worked best (hiding the tab stop line, but allowing a pixel or two of breathing space for the first letter in the next column). Thanks so much for pointing me in the right direction. (it saved a lot of coding effort to implement plan B, which was not as simple as hiding a column).
Cheers,
PS for the curious, the first column showed row numbers (array indices) as a result of "combine array by return and tab". The row numbers were of little use to the end user but since the purpose of the app is re-ordering rows in an array, the row numbers were used in a "Reset" function if you wanted to throw away any changes (NOTED: there are other ways of doing this... exiting without saving is one option, for example). However with the row numbers sitting there it was easy to implement. The workaround was to combine array by return which loses the array indices / row numbers and then simply add a sequential row number column with values 1..N somewhere else less visible (column 8 for example). Hiding the first column meant no other adjustments to the code while the workaround had lots of steps. The upside of Plan B is it would have engaged me in trying to discover which of LC's many statements would fill a column with values 1..N the fastest. An exercise now left for a future date.
Cheers,
PS for the curious, the first column showed row numbers (array indices) as a result of "combine array by return and tab". The row numbers were of little use to the end user but since the purpose of the app is re-ordering rows in an array, the row numbers were used in a "Reset" function if you wanted to throw away any changes (NOTED: there are other ways of doing this... exiting without saving is one option, for example). However with the row numbers sitting there it was easy to implement. The workaround was to combine array by return which loses the array indices / row numbers and then simply add a sequential row number column with values 1..N somewhere else less visible (column 8 for example). Hiding the first column meant no other adjustments to the code while the workaround had lots of steps. The upside of Plan B is it would have engaged me in trying to discover which of LC's many statements would fill a column with values 1..N the fastest. An exercise now left for a future date.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 9857
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: hiding 1st column of table field
Well done, Mark. Thank you for the confirmation, and the use case background. That sort of thing is very helpful to newcomers.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- VIP Livecode Opensource Backer
- Posts: 931
- Joined: Thu Nov 13, 2008 6:48 am
- Location: London, UK
Re: hiding 1st column of table field
Thanks Richard, however...FourthWorld wrote: ↑Mon Nov 21, 2022 5:22 pmWell done, Mark. Thank you for the confirmation, and the use case background. That sort of thing is very helpful to newcomers.
I ended up going with Plan B and here's why (a tale told in 3 stacks)
Mark
- Attachments
-
- Test Hide Column 1.livecode.zip
- (1.45 KiB) Downloaded 64 times
-
- Test Hide Column 2.livecode.zip
- (1.42 KiB) Downloaded 68 times
-
- Hide Column 1 Plan B.livecode.zip
- (1.96 KiB) Downloaded 69 times
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS
Targets: Mac, iOS
-
- VIP Livecode Opensource Backer
- Posts: 9752
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: hiding 1st column of table field
Mark.
That is some kludge. I hate it, though I admire it.
So have we decided that no shenanigans we know of will hide column 1 yet still yield control of the text attributes of that field? I hoped that setting the textAlign property would help, but not nope.
Craig
That is some kludge. I hate it, though I admire it.
So have we decided that no shenanigans we know of will hide column 1 yet still yield control of the text attributes of that field? I hoped that setting the textAlign property would help, but not nope.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: hiding 1st column of table field
Mark,
The only way I can think of is to
You could play with the numbers.
But that also pads above and below the lines.
Kind regards
Bernd
The only way I can think of is to
Code: Select all
set the padding of line 1 to -1 of field "myTable" to 3
But that also pads above and below the lines.
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 9752
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: hiding 1st column of table field
Bernd.
That does indeed help a little. The issue with padding is it works on all four "sides" at once, so that any value above 2 or so starts to make the cells themselves grow out of proportion.
You would think that with all the many properties available, some combination would allow the first column to be hidden and the look of the remaining parts seem normal. There may yet be some bunch of settings that will allow the OP not to have to cheat the way he does.
Craig
That does indeed help a little. The issue with padding is it works on all four "sides" at once, so that any value above 2 or so starts to make the cells themselves grow out of proportion.
You would think that with all the many properties available, some combination would allow the first column to be hidden and the look of the remaining parts seem normal. There may yet be some bunch of settings that will allow the OP not to have to cheat the way he does.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 4027
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: hiding 1st column of table field
tabAlign can also be an option.
Kind regards
Bernd
Code: Select all
set the tabAlign of field 1 to "left,center,right"
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 9752
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: hiding 1st column of table field
Bernd.
Getting there.
Mark.
Can you live with centered text? With this handful of settings, you would not have to pluck out the data in column 1. I personally would prefer anything rather than having to manage that.
Craig
Getting there.
Mark.
Can you live with centered text? With this handful of settings, you would not have to pluck out the data in column 1. I personally would prefer anything rather than having to manage that.
Craig