00001 //--- < MOUSEEVENT.H > ----------| ViewGraph - A Flexible Graph view Framework | 00002 // 00003 // Defines mouse events. Mouse events happen on both 00004 // focussed and blurred cameras. 00005 // 00006 // Derive your event from MouseEvent to register a 00007 // custom mouse event. 00008 // 00009 // $Author: botik32 $ 00010 // $Revision: 1.1.1.1 $ 00011 // $Date: 2004/03/26 10:50:23 $ 00012 //-----------------------------------------------------------------------------/ 00013 00014 #ifndef MOUSEEVENT_H 00015 #define MOUSEEVENT_H 00016 00017 #include <cZUI/drivers/mouse.h> 00018 #include <cZUI/event.h> 00019 00020 /// MouseEvents wrap the system's mouse events 00021 /// into cZUI events. 00022 class MouseEvent : public Event{ 00023 protected: 00024 msbutton button; 00025 public: 00026 static const char *type; 00027 00028 MouseEvent( const char *, int x, int y, msbutton b ); 00029 MouseEvent( Camera *, const char *, int x, int y, msbutton b ); 00030 00031 /// shifts the event position based on camera 00032 /// position. 00033 void shiftview( int, int ); 00034 00035 msbutton get_button( void ); 00036 bool is_type( const char * ); 00037 }; 00038 00039 class MouseClickEvent : public MouseEvent{ 00040 public: 00041 static const char *type; 00042 MouseClickEvent( Camera *, int x, int y, msbutton b ); 00043 }; 00044 00045 class MouseDownEvent : public MouseEvent{ 00046 protected: 00047 msbutton button; 00048 public: 00049 static const char *type; 00050 MouseDownEvent( Camera *, int x, int y, msbutton b ); 00051 }; 00052 00053 class MouseUpEvent : public MouseEvent{ 00054 protected: 00055 msbutton button; 00056 public: 00057 static const char *type; 00058 MouseUpEvent( Camera *, int x, int y, msbutton b ); 00059 }; 00060 00061 class MouseMoveEvent : public MouseEvent{ 00062 public: 00063 static const char *type; 00064 MouseMoveEvent( Camera *, int x, int y ); 00065 MouseMoveEvent( Camera *, int x, int y, msbutton b ); 00066 }; 00067 00068 /// MouseDrag has not been used yet and may be removed 00069 /// in the future (perhaps a MouseDragMessage?) 00070 class MouseDragEvent : public MouseEvent{ 00071 public: 00072 static const char *type; 00073 MouseDragEvent( Camera *, int x, int y, msbutton b ); 00074 }; 00075 00076 #endif 00077 00078 /// $Log: mouseevent.h,v $ 00079 /// Revision 1.1.1.1 2004/03/26 10:50:23 botik32 00080 /// Initial release 00081 /// 00082 /// Revision 1.1.1.1 2004/03/26 08:53:33 botik 00083 /// initial import 00084 /// 00085 /// 00086 /// Revision 1.7 2003/12/12 11:32:33 botik 00087 /// Added drivers/mouse.h 00088 /// Moved msbutton definition to drivers/mouse.h 00089 /// Added get_mousestate to SurfaceDriver 00090 /// Added get_mousestate to ScrollableView 00091 /// Changed the zoom decorator to only receive events if 00092 /// the left mouse is pressed 00093 /// Moved scroll layer beneath the zoom decorator layer 00094 /// This hopefully fixes a segfault when zoomdecorator gets 00095 /// invalid position after scroll 00096 /// 00097 /// Revision 1.6 2003/11/29 09:41:03 botik 00098 /// Added scroll_to to scrollableview. (not used yet) 00099 /// Changed testeasynode to zoom in and out 00100 /// Fixed a bug in camera that repainted the wrong rect 00101 /// (changed repaint_rect to repaint_screenrect in 00102 /// cameramvevent handling) 00103 /// Fixed a bug in the test module hudcontrols.cpp that 00104 /// painted hud controls with thickness 1 regardless of 00105 /// zoom level. 00106 /// 00107 /// Revision 1.5 2003/11/20 20:26:21 botik 00108 /// Fixed mouse event button enum to match SDL 00109 /// Fixed a button state bug in edsdl.cpp 00110 /// 00111 /// Revision 1.4 2003/11/20 19:57:29 botik 00112 /// Got MouseMoveEvent to accept mouse button in constructor 00113 /// Got contrib/cursorpolicy to ignode drag events 00114 /// 00115 /// Revision 1.3 2003/11/04 14:59:40 botik 00116 /// Further refined the event handling. This is 00117 /// related to the SDL event driver addition 00118 /// 00119 /// Revision 1.2 2003/11/04 14:33:44 botik 00120 /// Added button status for mouse events 00121 /// 00122 /// Revision 1.1 2003/10/30 13:47:31 botik 00123 /// Broke up event files into 3 categories 00124 ///