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

  1. Path: sparky!uunet!zephyr.ens.tek.com!vice!bobb
  2. From: bobb@vice.ICO.TEK.COM (Robert Beauchaine)
  3. Newsgroups: comp.lang.pascal
  4. Subject: TV Focus in Dialog views
  5. Message-ID: <10202@vice.ICO.TEK.COM>
  6. Date: 20 Aug 92 16:54:57 GMT
  7. Organization: Tektronix Inc., Beaverton, Or.
  8. Lines: 30
  9.  
  10.  
  11.   Here's the problem:
  12.  
  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.  
  18.   I can trap a view's loss of focus by overriding the SetState()
  19.   method and looking for an sfFocused bit combined with a false
  20.   Enable.  The problem with this scheme is that SetState() is
  21.   ignorant of what event is causing the change in focus.  If I close
  22.   the dialog box with a cmCancel, SetState() is still called, and 
  23.   the input line attempts to validate itself even though the user
  24.   does not care about the value.  
  25.  
  26.   Keyboard events are not a problem, since they are automatically
  27.   routed to the focused event and can be handled by HandleEvent().
  28.   The positional events are where I'm getting hung.  
  29.  
  30.   Suggestions?
  31.  
  32. /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ 
  33.  
  34. Bob Beauchaine bobb@vice.ICO.TEK.COM 
  35.  
  36. C: The language that combines the power of assembly language with the 
  37.    flexibility of assembly language.
  38.  
  39. Real friends don't let friends use UNIX.
  40.