home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / smalltk / src / stdevent.h < prev    next >
C/C++ Source or Header  |  1991-10-12  |  2KB  |  76 lines

  1. /* STDWIN -- EVENT STRUCT DEFINITION. */
  2.  
  3. struct event {
  4.     int type;
  5.     WINDOW *window;
  6.     union {
  7.     /* case WE_CHAR: */
  8.         int character;
  9.     /* case WE_COMMAND: */
  10.         int command;
  11.     /* case WE_MENU: */
  12.         struct { int id; int item; } m;
  13.     /* case WE_DRAW: */
  14.         struct { int left, top, right, bottom; } area;
  15.     /* case WE_MOUSE_DOWN, WE_MOUSE_MOVE, WE_MOUSE_UP: */
  16.         struct {
  17.             int v;
  18.             int h;
  19.             int clicks;
  20.             int button;
  21.             int mask;
  22.         } where;
  23.     } u;
  24. };
  25.  
  26. #define EVENT struct event
  27.  
  28. /* Event types (should be grouped differently). */
  29.  
  30. #define WE_NULL        0    /* (Used internally) */
  31. #define WE_ACTIVATE    1    /* Window became active */
  32. #define WE_CHAR        2    /* Character typed at keyboard */
  33. #define WE_COMMAND    3    /* Special command, function key etc. */
  34. #define WE_MOUSE_DOWN    4    /* Mouse button pressed */
  35. #define WE_MOUSE_MOVE    5    /* Mouse moved with button down */
  36. #define WE_MOUSE_UP    6    /* Mouse button released */
  37. #define WE_MENU        7    /* Menu item selected */
  38. #define WE_SIZE        8    /* Window size changed */
  39. #define WE_MOVE        9    /* (Reserved) */
  40. #define WE_DRAW        10    /* Request to redraw part of window */
  41. #define WE_TIMER    11    /* Window's timer went off */
  42. #define WE_DEACTIVATE    12    /* Window became inactive */
  43.  
  44. /* Command codes for WE_COMMAND.
  45.    Special ways of entering these are usually available,
  46.    such as clicking icons, standard menu items or special keys.
  47.    Some ASCII keys are also passed back as commands since they
  48.    more often than not need special processing. */
  49.  
  50. #define WC_CLOSE    1    /* Should become a separate event! */
  51. /* The following four are arrow keys */
  52. #define WC_LEFT        2
  53. #define WC_RIGHT    3
  54. #define WC_UP        4
  55. #define WC_DOWN        5
  56. /* ASCII keys */
  57. #define WC_CANCEL    6
  58. #define WC_BACKSPACE    7
  59. #define WC_TAB        8
  60. #define WC_RETURN    9
  61. /* IBM-PC keys -- not in all implementations */
  62. #define WC_HOME        10
  63. #define WC_END        11
  64. #define WC_CLEAR    12
  65. #define WC_INS        13
  66. #define WC_DEL        14
  67. #define WC_PAGE_UP    15
  68. #define WC_PAGE_DOWN    16
  69. #define WC_META_LEFT    17
  70. #define WC_META_RIGHT    18
  71. #define WC_META_HOME    19
  72. #define WC_META_END    20
  73. #define WC_META_PAGE_UP    21
  74. #define WC_META_PAGE_DOWN    22
  75. /* Should have entries for Alt-letter and F1-F10 etc. ? */
  76.