00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #if !defined(_XRB_GUI_EVENTS_HPP_)
00012 #define _XRB_GUI_EVENTS_HPP_
00013
00014 #include "xrb.hpp"
00015
00016 #include "xrb_event.hpp"
00017
00018 namespace Xrb
00019 {
00020
00021 class Widget;
00022
00028 class EventFocus : public Event
00029 {
00030 public:
00031
00036 EventFocus (
00037 ScreenCoordVector2 const &position,
00038 Float const time)
00039 :
00040 Event(time, FOCUS)
00041 {
00042 m_position = position;
00043 }
00046 virtual ~EventFocus () { }
00047
00050 ScreenCoordVector2 const &Position () const { return m_position; }
00051
00052 private:
00053
00054 ScreenCoordVector2 m_position;
00055 };
00056
00062 class EventMouseover : public Event
00063 {
00064 public:
00065
00070 EventMouseover (
00071 ScreenCoordVector2 const &position,
00072 Float const time)
00073 :
00074 Event(time, MOUSEOVER)
00075 {
00076 m_position = position;
00077 }
00080 virtual ~EventMouseover () { }
00081
00084 ScreenCoordVector2 const &Position () const { return m_position; }
00085
00086 private:
00087
00088 ScreenCoordVector2 m_position;
00089 };
00090
00097 class EventDeleteChildWidget : public Event
00098 {
00099 public:
00100
00104 EventDeleteChildWidget (
00105 Widget *const child_to_delete,
00106 Float const time)
00107 :
00108 Event(time, DELETE_CHILD_WIDGET)
00109 {
00110 ASSERT1(child_to_delete != NULL);
00111 m_child_to_delete = child_to_delete;
00112 }
00115 virtual ~EventDeleteChildWidget ()
00116 {
00117 m_child_to_delete = NULL;
00118 }
00119
00120 private:
00121
00124 inline Widget *ChildToDelete () const { return m_child_to_delete; }
00125
00128 void DeleteChildWidget () const;
00129
00130 mutable Widget *m_child_to_delete;
00131
00132 friend class ContainerWidget;
00133 };
00134
00135 }
00136
00137 #endif // !defined(_XRB_GUI_EVENTS_HPP_)
00138