Path: utzoo!attcan!uunet!ginosko!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.hypercard Subject: Re: selecting contents of a locked field Message-ID: <8717@hoptoad.uucp> Date: 16 Oct 89 06:05:47 GMT References: <9490@june.cs.washington.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 46 In article <9490@june.cs.washington.edu> moore@cs.washington.edu (Charles Moore) writes: >I would like to have an index card in a stack that lists all the >other cards in the stack by the contents of some identifying field. I >would like to be able to go to any listed card directly from the index >and I would like to request the deletion of any listed card without >leaving the index. It seems to me that the natural way to do this >(for the user) would be to have a single click on a card name result >in the selection of that name whereupon the user might hit the Delete >key or click a "Delete Card" button. To go to a listed card the user >would double-click on the name. > This brings up my two problems. First, the only way to select >the contents of a field seems to be by tabbing into it either with the >Tab key or with the tabKey command. It's trivial. Install a mouseDown handler in the field that unlocks the field, and drags from the left edge of the field to the right edge of the field, then locks it again. You can get the right and left edge coordinates from "the rect of it". Use the click coordinate ("the clickLoc") for the vertical portion. Then your second mouseDown event can be picked up and checked for double-clickiness. I have a problem with the way you're phrasing this, though. It seems you expect to have a single field for each card from your tab comments. This puts an arbitrary limit on how many cards you can have; since you're allowing the user to delete cards, I assume you're also letting them be added. Wouldn't a scrolling field of card names make more sense? I've done this (single-click to go to card, no delete from index) and it's pretty easy. > Secondly, is there a way to catch the Delete key? Not without an XCMD. However, please be a little more user friendly than this. I'd be extremely pissed if I wound up deleting a card with a press of the delete key. Dangerous operations should always be advertised and safeguarded; if you do write some sort of key-trapping XCMD to do this, then at least put in a dialog asking the user to confirm the deletion. However, please consider carefully whether you even *want* a keyboard shortcut to do this. It's certainly not worth the work, and even if it were easy to do, you would also be making it easy for people to shoot themselves in the feet. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "I am of the opinion that my life belongs to the whole community, and as long as I live it is my privilege to do for it whatever I can." -- Shaw