home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / pascal / 4961 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.9 KB

  1. Path: sparky!uunet!mcsun!Germany.EU.net!ira.uka.de!chx400!urz.unibas.ch!gysin1
  2. From: gysin1@urz.unibas.ch
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: TV Focus in Dialog views
  5. Message-ID: <1992Aug21.190034.40057@urz.unibas.ch>
  6. Date: 21 Aug 92 19:00:34 MET
  7. References: <10202@vice.ICO.TEK.COM>
  8. Organization: University of Basel, Switzerland
  9. Lines: 42
  10.  
  11. In article <10202@vice.ICO.TEK.COM>, bobb@vice.ICO.TEK.COM (Robert Beauchaine) writes:
  12. >   Here's the problem:
  13. >   I'm attempting to trap loss of focus events in Turbo Vision among
  14. >   views within a dialog box.  I want to validate my numerical input
  15. >   lines whenever the user moves off the focused input, either via
  16. >   the keyboard or mouse.  
  17. >   I can trap a view's loss of focus by overriding the SetState()
  18. >   method and looking for an sfFocused bit combined with a false
  19. >   Enable.  The problem with this scheme is that SetState() is
  20. >   ignorant of what event is causing the change in focus.  If I close
  21. >   the dialog box with a cmCancel, SetState() is still called, and 
  22. >   the input line attempts to validate itself even though the user
  23. >   does not care about the value.  
  24. >   Keyboard events are not a problem, since they are automatically
  25. >   routed to the focused event and can be handled by HandleEvent().
  26. >   The positional events are where I'm getting hung.  
  27. >   Suggestions?
  28.  
  29.     Well, I think the only thing you can do is to override the
  30. HandleEvent-Method and redefine the function of kbTab and kbShiftTab (and -why
  31. not ? - kbEnter). The user is probably already typing in new values and has
  32. just to type the Tab-Key or Enter-Key to jump to the next InputLine. If he
  33. moves the focus with the mouse, he doesn't need to care for the value, any
  34. typing is ignored...
  35.  
  36.     For catching positional events, I suppose you should start at the
  37. Dialog's event handler that manages the subviews....
  38.  
  39. Philipp Gysin
  40.  
  41. Gysin1@urz.unibas.ch     Basel, Switzerland
  42.  
  43.  
  44.  
  45.  
  46.  
  47.