How to select a cell instead of a line in a table

Ken Ray kray at sonsothunder.com
Sat Jun 14 15:23:34 EDT 2008


> Hi
> I have a function in a standalone, where user can select an item in a scolling
> field,
> ( with locked text and list behavior),and do things with the thus selected
> "target".
> Now I want to improve the users interface, and replace the inconvenient long
> scrolling
>  to see the bottom of the list.
> I will instead present all the selectable  items in a wide rectangular field,
>  so all can be seen at once.
> I found an approach, by placing the items in a 7 collumn table, but found,
> that the select 
> would select a whole line of items
> (logicaly enough , as list behaviour had to be set, in order to produce a
> "selected item").
> Is there a way, where the handler can limit its choice to the precise cell
> clicked in the table ?.
> Kresten Bjerg (www.phenomenalog.dk)

Well, you can compare the mouse location to the location in your field,
using the "left" of the field and adding in the tab stop values to get a
feel for which column the user clicked in. However you can't cause Rev to
just highlight the "cell" in the table field - to do this, you'd have to
create your own "highlight" and move it to the proper place when you get the
mouseDown in the field. However you'd also have to turn *off* the
traversalOn of the field because otherwise you'll get the hilite of the
whole row *first* as Rev gets the mouseDown, and then when *you* get it, you
would "shunt" it so it only showed a single cell with your custom highlight
(which looks odd to the user).

Hope this points you in the right direction,

Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list