home *** CD-ROM | disk | FTP | other *** search
/ PC World 2000 August / PCWorld_2000-08_cd.bin / Software / TemaCD / xbasic / xbpro.exe / xb / xxx / code.xxx < prev    next >
Text File  |  1995-10-09  |  2KB  |  59 lines

  1. '
  2. '
  3. ' #####################
  4. ' #####  Code ()  #####
  5. ' #####################
  6. '
  7. ' You can stop GuiDesigner from putting the following comment
  8. ' lines in callback functions by removing the comment lines in
  9. ' the code.xxx file in your \xb\xxx directory.
  10. '
  11. ' This is a callback function that supports the grid function
  12. ' of the same name less the last 4 letters (Code).
  13. '
  14. ' When an important event occurs in the grid function created
  15. ' from your design window, is sends a callback message to this
  16. ' function, with the original message in r1.
  17. '
  18. ' Most callback functions process only Selection messages
  19. ' because usually that's enough to perform their function.
  20. '
  21. ' When keystrokes are entered into a TextLine or TextArea grid,
  22. ' this callback function receives a TextEvent callback message.
  23. ' This function can prevent Keystrokes from inserting characters
  24. ' in the TextLine or TextArea grid by returning a -1 in kid.
  25. '
  26. ' The first time GuiDesigner generates this function, it puts
  27. ' a "SUB Selection" subroutine at the bottom of the function.
  28. ' It contains a SELECT CASE block with kid constants named the
  29. ' same as the grids you put in the design window.  For grids
  30. ' you didn't give a name (with the AppearanceWindow), a not
  31. ' very useful default name is substituted, so be sure to enter
  32. ' good GridNames in the Appearance window for every grid in
  33. ' your design windows.  If you change the GridNames later, the
  34. ' names in the SELECT CASE block are NOT updated, and you'll
  35. ' get "Undefined Constant" errors on lines with obsolete constant
  36. ' names when you recompile the program.  Then you'll have to
  37. ' update the names in the SELECT CASE block by hand.
  38. '
  39. ' It's easy to find out what your code has to respond to...
  40. ' just run your program!  When you operate the grids in the
  41. ' window, the XuiReportMessage() call in this function prints
  42. ' the entry arguments in a ReportMessage window.  You can
  43. ' comment out this lines to disable this feature, but don't
  44. ' remove them entirely - it might come in handy later.
  45. '
  46. '
  47. FUNCTION  Code (grid, message, v0, v1, v2, v3, kid, r1)
  48. '
  49. '
  50.     XuiReportMessage (grid, message, v0, v1, v2, v3, kid, r1)
  51.     IF (message = #Callback) THEN message = r1
  52. '
  53.     SELECT CASE message
  54.         CASE #Selection        : GOSUB Selection   ' Common callback message
  55. '        CASE #TextEvent        : GOSUB TextEvent   ' KeyDown in TextArea or TextLine
  56.     END SELECT
  57.     RETURN
  58. END FUNCTION
  59.