Detecting which column was clicked in a Table field

-= JB =- sundown at pacifier.com
Wed May 26 19:46:13 EDT 2010


I haven't really been following this thread and read it quick before
sending a reply.  After reading it seems you want to be able to
click on white space and get the column.

To click on white space and get the column number you can use
Dynamic Table Field and then COMAND CLICK.  This will show
a dialog that provides row and item numbers.  The item number
will be the column.  It you click on text without holding down the
command key it will provide you with the row and item numbers.

All of the code is in the field.

-=>JB<=-



On May 26, 2010, at 3:56 PM, -= JB =- wrote:

> Dynamic Table Field will tell you where you clicked.  It is posted
> in the old section of On-Rev under the user sundown.
>
> -=>JB<=-
>
>
>
> On May 26, 2010, at 3:43 PM, Mark Stuart wrote:
>
>> on 5/26/2010, Jacqueline wrote:
>>>>
>> Something like this:
>>   put word 4 of the clickchunk into tCharNum
>>   subtract (the number of chars in line 1 to \
>>      (word 2 of the clickline)-1 of me) +1 from tCharNum
>>   set the itemdel to tab
>>   put the number of items in char 1 to tCharNum of the value of the
>> clickLine
>> <<
>>
>> Hi,
>> I tried your script and it worked as is, but not as planned.
>> When clicking in the white space of a column, it returns the  
>> number 4.
>> When clicking on the text of a column, a number is returned.
>> But when clicking in the far left column, it returns 0 (zero).
>>
>> So I changed the clickChunk to mouseCharChunk and that worked  
>> better. It
>> returned a value when clicking in the white space 'inside' the  
>> values in
>> the row. Clicking to the far left or far right of the row value text
>> returns nothing.
>>
>> I did notice that So Smart Software has a tutorial on Table fields,
>> which shows how to get the row number and column number from the  
>> field
>> custom props. But the table field's lockText property has to be  
>> false,
>> allowing editing. Having it set to true does not return a value :(
>>
>> So far I haven't found a bullet proof solution, but will continue to
>> work on it and let you know.
>>
>> Anybody else got ideas on this?
>>
>> Regards,
>> Mark Stuart
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your  
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list