home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / OMEGA2 / OMEVENT.HPP < prev    next >
C/C++ Source or Header  |  1992-04-25  |  2KB  |  88 lines

  1. //
  2. // *************************************************************************
  3. // *                                                                       *
  4. // *    OMEGA C++ Windowing Class Library                                  *
  5. // *    =================================                                  *
  6. // *                                                                       *
  7. // *    Copyright 1991,92 Tom Clancy                                       *
  8. // *    Submitted to the public domain, April 1992                         *
  9. // *                                                                       *
  10. // *************************************************************************
  11. // *                                                                       *
  12. // *    Event Handler Object                                               *
  13. // *                                                                       *
  14. // *************************************************************************
  15. //
  16.  
  17.  
  18. #ifndef _OMEVENT
  19. #define _OMEVENT
  20. #endif
  21.  
  22. #ifndef _OMMOUSE
  23. #include "ommouse.hpp"
  24. #endif
  25.  
  26. #ifndef _OMKEY
  27. #include "omkey.hpp"
  28. #endif
  29.  
  30. enum events {
  31.   evNoevent,
  32.   evMButton,
  33.   evKeyboard,
  34. };
  35.  
  36. enum commands {
  37.   cmdNocmd=0,
  38.   cmdClose,
  39.   cmdExpand,
  40.   cmdContract,
  41.   cmdDrag,
  42.   cmdResize,
  43.   cmdKBHIT,
  44.   cmdWithinwin,
  45.   cmdHelp,
  46.   cmdPushedButton,
  47.   cmdNextButton,
  48.   cmdPrevButton,
  49.   cmdSelectField,
  50.   cmdNextField,
  51.   cmdPrevField,
  52.   cmdDeleteField,
  53.   cmdRightArrow,
  54.   cmdLeftArrow,
  55.   cmdMenuPick,
  56. };
  57.  
  58.  
  59. class event_handler : public key, public mouse {
  60.  
  61. public:
  62.  
  63.   int  startx,starty,endx,endy;
  64.   int  WINSET;
  65.   int  WITHINWIN;
  66.  
  67.   int  event();
  68.   int  getlastevent();
  69.   void setlastevent(int e);
  70.   void setlastcmd(int c);
  71.   int  getlastcmd();
  72.  
  73.   int  buttonx();
  74.   int  buttony();
  75.   int  buttonb();
  76.   void setbuttonx(int x);
  77.   void setbuttony(int y);
  78.  
  79.   void disable_handler();
  80.   void enable_handler();
  81.   int  isdisabled();
  82.  
  83.   virtual int  handle_mouse_event() {return 0;}
  84.   virtual int  handle_key_event()   {return 0;}
  85.   void handle_events();
  86.   virtual void run();
  87. };
  88.