How to find the column and row of a basic tableField
Richmond
richmondmathewson at gmail.com
Thu Apr 2 05:37:53 EDT 2020
Specialising in missing the point as I do, I've posted something here:
http://forums.livecode.com/viewtopic.php?f=7&t=33859
Richmond.
On 2.04.20 1:52, Pi Digital via use-livecode wrote:
> Thanks Bernd.
>
> This only works if there is already data in the field. If you put empty into the field it produces no results. In those instances you are forced to get an x,y clickLoc and use the tabstops and textHeight to hard code the result.
>
> The revTableLibrary was last modified in 2015 from your recommendations and pulls. Notable is the ones in revCalculateCellLoc and revCalculateCellRect. Interestingly in revCalculateCellLoc there is a couple of lines that set cREVTable[“currentxcell”] and [“currentycell”] of the object.
>
> Using:
> Put cRevTable[“currentxcell”],cRevTable[“currentycell”] into tCellIndex
> Works a charm.
>
> To make this work you do need to have cellEdit enabled but to avoid having it actually enable editing the text, in the mouseup just have a ‘select nothing’ to immediately exit the field. That way you only return the xy index and can use other means to add in or collect cell data.
>
> This is far less convoluted and exactly what I was looking for. None of this faffing around with huge lines of code. LiveCode is supposed to be EASY and almost instinctive. This is pretty close.
>
> It’s a real shame that these are not visible in the property inspector as standard properties and not even in the customProperties cRevTable until you have clicked into one of the cells in runtime when it populate the custom set.
>
> It’s even more of a shame that this is not documented anywhere, in the dictionary, guide, lessons, tutorials. It’s practically lost to obscurity in the forums too only being found if I search for currentxcell specifically. I only found it by hacking through all of the object library code of the IDE stacks.
>
> This definitely make the table field object far more useful, though.
>
> Sean Cole
> Pi Digital Productions Ltd
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list