]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/event.h
1. Pause()/Resume() implemented for wxMSW
[wxWidgets.git] / include / wx / event.h
index e9eb695cd2889ac2c15a6e1224aff1ee0dae9336..05bc7792367f3ca3465f8a03b7355ea756c543df 100644 (file)
@@ -164,6 +164,7 @@ const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING =      wxEVT_FIRST + 610;
 const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED =          wxEVT_FIRST + 611;
 const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING =         wxEVT_FIRST + 612;
 const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN =             wxEVT_FIRST + 613;
+const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED =       wxEVT_FIRST + 614;
 
  /* List control event types */
 const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG =           wxEVT_FIRST + 700;
@@ -179,6 +180,9 @@ const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED =      wxEVT_FIRST + 709;
 const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN =             wxEVT_FIRST + 710;
 const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM =          wxEVT_FIRST + 711;
 const wxEventType wxEVT_COMMAND_LIST_COL_CLICK =            wxEVT_FIRST + 712;
+const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK =     wxEVT_FIRST + 713;
+const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK =    wxEVT_FIRST + 714;
+const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED =       wxEVT_FIRST + 715;
 
  /* Tab and notebook control event types */
 const wxEventType wxEVT_COMMAND_TAB_SEL_CHANGED =           wxEVT_FIRST + 800;
@@ -345,6 +349,26 @@ class WXDLLEXPORT wxCommandEvent: public wxEvent
   wxClientData*     m_clientObject;  // Arbitrary client object
 };
 
+// this class adds a possibility to react (from the user) code to a control
+// notification: allow or veto the operation being reported.
+class WXDLLEXPORT wxNotifyEvent : public wxCommandEvent
+{
+public:
+    wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
+                : wxCommandEvent(commandType, id) { m_bAllow = TRUE; }
+
+    // veto the operation (by default it's allowed)
+    void Veto() { m_bAllow = FALSE; }
+
+    // for implementation code only: is the operation allowed?
+    bool IsAllowed() const { return m_bAllow; }
+
+private:
+    bool m_bAllow;
+
+    DECLARE_DYNAMIC_CLASS(wxNotifyEvent)
+};
+
 // Scroll event class
 /*
  wxEVT_SCROLL_TOP
@@ -456,7 +480,7 @@ class WXDLLEXPORT wxMouseEvent: public wxEvent
   inline bool RightIsDown(void) const { return m_rightDown; }
 
   // True if a button is down and the mouse is moving
-  inline bool Dragging(void) const { return ((m_eventType == wxEVENT_TYPE_MOTION) && (LeftIsDown() || MiddleIsDown() || RightIsDown())); }
+  inline bool Dragging(void) const { return ((m_eventType == wxEVT_MOTION) && (LeftIsDown() || MiddleIsDown() || RightIsDown())); }
 
   // True if the mouse is moving, and no button is down
   inline bool Moving(void) const { return (m_eventType == wxEVT_MOTION); }
@@ -1051,11 +1075,16 @@ class WXDLLEXPORT wxEvtHandler: public wxObject
 
   virtual bool ProcessEvent(wxEvent& event);
   virtual bool SearchEventTable(wxEventTable& table, wxEvent& event);
-  
-  void Connect( int id, int lastId,
-                int eventType,
+
+  // Dynamic association of a member function handler with the event handler, id and event type
+  void Connect( int id, int lastId, wxEventType eventType,
                wxObjectEventFunction func,
                wxObject *userData = (wxObject *) NULL );
+
+  // Convenience function: take just one id
+  inline void Connect( int id, wxEventType eventType,
+               wxObjectEventFunction func,
+               wxObject *userData = (wxObject *) NULL ) { Connect(id, -1, eventType, func, userData); }
                
   bool SearchDynamicEventTable( wxEvent& event );
 
@@ -1115,7 +1144,7 @@ const wxEventTable theClass::sm_eventTable =\
 const wxEventTableEntry theClass::sm_eventTableEntries[] = { \
 
 #define END_EVENT_TABLE() \
- { 0, 0, 0, 0 } };
+ { 0, 0, 0, 0, 0 } };
  
 /*
  * Event table macros