home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / hypercar / 4263 < prev    next >
Encoding:
Text File  |  1992-11-20  |  2.1 KB  |  54 lines

  1. Newsgroups: comp.sys.mac.hypercard
  2. Path: sparky!uunet!stanford.edu!CSD-NewsHost.Stanford.EDU!CS.Stanford.EDU!vadim
  3. From: vadim@CS.Stanford.EDU (Vadim Akselrod)
  4. Subject: Re: Protecting a Text field
  5. Message-ID: <1992Nov20.182425.14203@CSD-NewsHost.Stanford.EDU>
  6. Sender: news@CSD-NewsHost.Stanford.EDU
  7. Reply-To: vadim@cs.stanford.edu
  8. Organization: Computer Science Department, Stanford University.
  9. References:  <1992Nov20.000530.21486@tjhsst.vak12ed.edu>
  10. Date: Fri, 20 Nov 1992 18:24:25 GMT
  11. Lines: 41
  12.  
  13. >I have a stack with a main text field containing information
  14. >from card to card.  I would like to keep the field locked so
  15. >it's contents aren't accidentally - or on purpose - changed,
  16. >but I also want browsers to be able to select blocks of text
  17. >they want within a given field, copy it and then paste the
  18. >selection into a collection "notepad" field I have on a Note
  19. >Pad card in the stack.
  20. >
  21. >I have created this handler and it works:
  22. >
  23. >    on idle
  24. >     if the optionKey is down then
  25. >      set the lockText of bg fld id 9 to false
  26. >     else
  27. >      set the lockText of bg fld id 9 to true
  28. >     end if
  29. >    end idle
  30. >
  31. >I remember some discussion here some time ago that one should
  32. >avoid "on idle" handlers if possible.  I have tried "on
  33. >mouseStillDown" and some other variations but they don't work.
  34.  
  35. Well, you might want to protect just the contents of the field.
  36. The way I like to do that is:
  37.  
  38. 1. Save the contents of the field in a global on openField
  39. 2. Compare contents of the field to the global on closeField &
  40.       restore the contents to the global if required
  41.  
  42. If the users realize (by the stack context) that they should not
  43. change the field, they will not be confused if the field restores
  44. itself.  But they can select pieces, copy them, etc...
  45.  
  46. Cheers,    
  47.     -Vadim
  48.  
  49. +---------------------+---------------------+---------------+---------------+
  50. |Vadim "Josh" Akselrod|vadim@cs.stanford.edu|W:(415)725-6969|H:(408)732-4606|
  51. |MS Student, Comp. Sci+---------------------+---------------+---------------+
  52. | Stanford University |  If my opinions were worth anything, I'd sell them  |
  53. +---------------------+-----------------------------------------------------+
  54.