#ifndef __EVENTWINDOW_H #define __EVENTWINDOW_H #include #include #include // FlTk demo program for CS638 // Fall 2000, Mark Pingel // Comments added, Fall 2000, Michael Gleicher // this class implements a very simple widget that responds to // mouse and keyboard events // the idea is to show how to handle events in fltk class EventWindow: public Fl_Window { private: // Handle events generated by mouse actions // event is the integer event number, // button corresponds to the mouse button depressed, // x, y refer to the x and y location of the mouse // when the event occurred int handle_mouse(int event, int button, int x, int y); // Function to handle keyboard events // event is the integer event number // key is the integer corresponding to which key on the // keyboard that was depressed int handle_key(int event, int key); public: // Constructor for the EventWindow EventWindow(int width, int height); // Overloaded function to handle events for the window int handle(int e); }; #endif