Lock a table field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Lock a table field
Beginners again...
Anyone know how to to do this? A table field already has lockText set, and clearing "traversalOn" does nothing. Trapping every message that is passed with a mouseClick does nothing. The field stays editable.
I can always overlay a clear opaque graphic with blendLevel set to 100, but that is a kluge.
I love kluges, but isn't there a more grown-up way?
Craig Newman
Anyone know how to to do this? A table field already has lockText set, and clearing "traversalOn" does nothing. Trapping every message that is passed with a mouseClick does nothing. The field stays editable.
I can always overlay a clear opaque graphic with blendLevel set to 100, but that is a kluge.
I love kluges, but isn't there a more grown-up way?
Craig Newman
Re: Lock a table field
I am sure there is, but I personally bought the "kludge-o-matic" yesterday from a Ron Popiel commercial, and it is the BEST !
Oh, you wanted a real answer
Well, I'm not sure if this still works, but you could try setting the cantSelect on it.
Oh, you wanted a real answer
Well, I'm not sure if this still works, but you could try setting the cantSelect on it.
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Lock a table field
Bogs.
Nope. You cannot select the field, but you can still edit it. Odd...
Right now I have a transparent grc overlying it. (Doesn't) work just fine.
Craig
Very logical supposition.but you could try setting the cantSelect on it.
Nope. You cannot select the field, but you can still edit it. Odd...
Right now I have a transparent grc overlying it. (Doesn't) work just fine.
Craig
Re: Lock a table field
I know I've come across fields in dialogs in the old Mc ide where you can't select....ANYTHING, hahah. I was going to suggest the cantModify setting, but then you would not be able to select anything in that stack where it is set.
Perhaps making it part of a group (possibly of one) would work, and then set the groups property?? Other than that, rock on Ron Popiels kludge-o-matic
Perhaps making it part of a group (possibly of one) would work, and then set the groups property?? Other than that, rock on Ron Popiels kludge-o-matic
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: Lock a table field
I haven't looked at the table field in ages, but if it's still like the original it is creating a temporary field when you click in a cell that allows typing. When the data entry is done, the content of the temp field is placed in the cell and the overlay field is deleted.
That means no properties of the table field are relevant during text entry. The actual table field itself is just a field with tabstops and gridlines, which you could easily use instead.
That means no properties of the table field are relevant during text entry. The actual table field itself is just a field with tabstops and gridlines, which you could easily use instead.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Lock a table field
Jacque.
Yes, actually you and I worked on this years ago. I called the "extra" field a "ghost" field. Entirely different from a DG, where the various fields really do exist.
But there must be a message generated that creates that overlying control from the table field "target".l. I just cannot find it to trap it.
My workaround of overlaying a grc works just fine. I am just interested in how that thing gets its instructions to build itself.
Craig
Yes, actually you and I worked on this years ago. I called the "extra" field a "ghost" field. Entirely different from a DG, where the various fields really do exist.
But there must be a message generated that creates that overlying control from the table field "target".l. I just cannot find it to trap it.
My workaround of overlaying a grc works just fine. I am just interested in how that thing gets its instructions to build itself.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Lock a table field
Bogs.
Short answer is: "Nope"
My thinking was that I would place empty handlers in the field script that would trap whatever message generates the "ghost" field, as per the post with Jacque just above. I have tried everything, but that field pops up anyway, ready for text entry.
Either I am not understanding how a table field does that, or am missing the message. I would have thought that trapping all possible mouse actions, up, down, enter, whatever, would prevent the field from "knowing" that something was happening. Perhaps the generation of the field happens before user messages,
Nope.
Craig
Short answer is: "Nope"
My thinking was that I would place empty handlers in the field script that would trap whatever message generates the "ghost" field, as per the post with Jacque just above. I have tried everything, but that field pops up anyway, ready for text entry.
Either I am not understanding how a table field does that, or am missing the message. I would have thought that trapping all possible mouse actions, up, down, enter, whatever, would prevent the field from "knowing" that something was happening. Perhaps the generation of the field happens before user messages,
Nope.
Craig
Re: Lock a table field
Curious if you tried 'pass mouseDown/mouseUp' instead of empty. Just leaving it blank still lets the message through, right?
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Lock a table field
Bogs.
Do you mean this?
One may as well leave the script empty, no?
Craig
Do you mean this?
Code: Select all
on mouseDown
pass mouseDown
end mouseDown
Craig
-
- VIP Livecode Opensource Backer
- Posts: 3991
- Joined: Sun Jan 07, 2007 9:12 pm
- Location: Bochum, Germany
Re: Lock a table field
Hi Craig,
you could try on a tableField which happens to be field 3 in my case
or
The handler is in revIDELibrary
Then you can fiddle with traversalOn etc
Kind regards
Bernd
you could try on a tableField which happens to be field 3 in my case
Code: Select all
-- revIDESetTableProperty pObject, pProperty, pValue
-- in revIDELibrary
put the long ID of field 3 into tObject
put "cellEdit" into tProperty
put "false" into tValue
revIDESetTableProperty tObject, tProperty, tValue
Code: Select all
-- revIDESetTableProperty pObject, pProperty, pValue
-- in revIDELibrary
put the long ID of field 3 into tObject
put "cellEdit" into tProperty
put "true" into tValue
revIDESetTableProperty tObject, tProperty, tValue
Then you can fiddle with traversalOn etc
Kind regards
Bernd
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Lock a table field
Bernd.
Thanks, but I do not see the handler "revIDESetTableProperty" if I:
Possibly because I am in v.6.7?
Anyway, it sounds like a good candidate. But more to my current interest, there must be action going on in a table field before user messages are sent, right? And it is these actions that create and locate the "ghost' field.
Craig
Thanks, but I do not see the handler "revIDESetTableProperty" if I:
Code: Select all
edit the script of stack "revIDELibrary"
Anyway, it sounds like a good candidate. But more to my current interest, there must be action going on in a table field before user messages are sent, right? And it is these actions that create and locate the "ghost' field.
Craig
Re: Lock a table field
Short answer: go with a manually created table from a field object.
Much longer answer -
Well, I *think* I have an answer for you, I just don't think it is an answer your going to like too much. I re-read the thread from the top, what I am getting is that you want a table with fields(cells) that aren't clickable. When I got to Jacque's post, this kinda jumped out at me, probably because I was poking around in Mc3 which doesn't have datagrids or even basic table fields pre-made -
Much longer answer -
Well, I *think* I have an answer for you, I just don't think it is an answer your going to like too much. I re-read the thread from the top, what I am getting is that you want a table with fields(cells) that aren't clickable. When I got to Jacque's post, this kinda jumped out at me, probably because I was poking around in Mc3 which doesn't have datagrids or even basic table fields pre-made -
Huh, why not says I ? and so I did. I took a regular field, and made it a table field manually. Below that, I placed a pre-made table field. I unchecked the focusable (transversal) on both. The top manually made table will not accept the mouse click, it does still pass through on the bottom pre-made table.
-
- VIP Livecode Opensource Backer
- Posts: 9582
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Lock a table field
Bogs.
All nice kludges.
Mine was simpler, and more kludgy; I mentioned that I just placed an opaque grc rectangle, blended 100%, over the table field. This blocks everything, the old-fashioned way
The fact that the blocking grc is transparent is both useful and peculiar. There was a thread years ago about adding a property to controls that would allow mouse actions to penetrate them. So that if one had two buttons with the same rect, the lower one could receive messages if the upper one had its "permeable" set to "true". Never happened. though.
My table field is only used for display, and must not be accessible by the user.
Craig
All nice kludges.
Mine was simpler, and more kludgy; I mentioned that I just placed an opaque grc rectangle, blended 100%, over the table field. This blocks everything, the old-fashioned way
The fact that the blocking grc is transparent is both useful and peculiar. There was a thread years ago about adding a property to controls that would allow mouse actions to penetrate them. So that if one had two buttons with the same rect, the lower one could receive messages if the upper one had its "permeable" set to "true". Never happened. though.
My table field is only used for display, and must not be accessible by the user.
Craig
Re: Lock a table field
I *did* say I love the kludge-o-matic right?dunbarx wrote: ↑Tue Oct 17, 2017 1:33 amBogs.
All nice kludges.
Mine was simpler, and more kludgy; I mentioned that I just placed an opaque grc rectangle, blended 100%, over the table field. This blocks everything, the old-fashioned way
...
My table field is only used for display, and must not be accessible by the user.
Craig
On my last one, I don't think that it is actually a kludge per se, and it fills your requirements, for 2 reasons.
- Not a kludge since it is a table, and as Jacque pointed out, tables are made from fields to begin with. I changed only the parts of the field required to make it adding grid lines and tab stops.
- It isn't accessible from the users perspective, without the addition of other objects.
Something changed in the basic table field object that makes it not just a field turned into a table, when running the message watcher I see all kinds of events not turning up in the manually created one.