home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / pascal / library / dos / tp6goodi / toggle / read.me < prev    next >
Encoding:
Text File  |  1991-01-31  |  1.8 KB  |  39 lines

  1. This version of HELLO.PAS for Turbo Vision demonstrates two things:
  2. 1) how to add a TView object for the Num, Scroll and Caps toggle
  3. keys and 2) how to create a Shift, Ctrl and Alt sensitive status
  4. line.
  5.  
  6. The toggle keys are displayed the same way that the HeapView or
  7. Clock is displayed.  This means that the toggle object's
  8. (TToggleKeysView) UpDate method is called from TApplication's
  9. (THelloApp) Idle method.  TToggleKeysView.UpDate determines the
  10. status of the toggle keys and calls its TToggleKeysView.Draw method
  11. if needed.
  12.  
  13. The status line will change in response to the Shift, Ctrl or Alt
  14. keys being held down for about 2 seconds.  This is done by adding
  15. an additional status line for each key in the status line
  16. definition.  The key (no pun intended) here is that each of the
  17. three additional status line definitions respond to their own help
  18. context (hcConst).  The hard part is setting the current help
  19. context to the help context that corresponds to the key that is
  20. pressed and resetting it back to its original state.  This process
  21. uses basically 4 steps:
  22.  
  23.      1)   We determine the data structure of the currently active
  24.           view. i.e. No menu, menu active, dialog active or edit
  25.           window active.  Once this is done the type and current
  26.           help context is noted.  The type is noted so that we can
  27.           go back to where we were when we need to reset the help
  28.           context.
  29.  
  30.      2)   The help context of the view is changed to the help
  31.           context of the pressed key.
  32.  
  33.      3)   Turbo Vision does it's thing and the status line is
  34.           changed because the help context has changed.
  35.  
  36.      4)   When the key is released the correct type is looked up
  37.           and the view gets its original help context back.
  38.  
  39. To make more sense of this description please see the code.