home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.mac.hypercard
- Path: sparky!uunet!stanford.edu!CSD-NewsHost.Stanford.EDU!CS.Stanford.EDU!vadim
- From: vadim@CS.Stanford.EDU (Vadim Akselrod)
- Subject: Re: Protecting a Text field
- Message-ID: <1992Nov20.182425.14203@CSD-NewsHost.Stanford.EDU>
- Sender: news@CSD-NewsHost.Stanford.EDU
- Reply-To: vadim@cs.stanford.edu
- Organization: Computer Science Department, Stanford University.
- References: <1992Nov20.000530.21486@tjhsst.vak12ed.edu>
- Date: Fri, 20 Nov 1992 18:24:25 GMT
- Lines: 41
-
- >I have a stack with a main text field containing information
- >from card to card. I would like to keep the field locked so
- >it's contents aren't accidentally - or on purpose - changed,
- >but I also want browsers to be able to select blocks of text
- >they want within a given field, copy it and then paste the
- >selection into a collection "notepad" field I have on a Note
- >Pad card in the stack.
- >
- >I have created this handler and it works:
- >
- > on idle
- > if the optionKey is down then
- > set the lockText of bg fld id 9 to false
- > else
- > set the lockText of bg fld id 9 to true
- > end if
- > end idle
- >
- >I remember some discussion here some time ago that one should
- >avoid "on idle" handlers if possible. I have tried "on
- >mouseStillDown" and some other variations but they don't work.
-
- Well, you might want to protect just the contents of the field.
- The way I like to do that is:
-
- 1. Save the contents of the field in a global on openField
- 2. Compare contents of the field to the global on closeField &
- restore the contents to the global if required
-
- If the users realize (by the stack context) that they should not
- change the field, they will not be confused if the field restores
- itself. But they can select pieces, copy them, etc...
-
- Cheers,
- -Vadim
-
- +---------------------+---------------------+---------------+---------------+
- |Vadim "Josh" Akselrod|vadim@cs.stanford.edu|W:(415)725-6969|H:(408)732-4606|
- |MS Student, Comp. Sci+---------------------+---------------+---------------+
- | Stanford University | If my opinions were worth anything, I'd sell them |
- +---------------------+-----------------------------------------------------+
-