]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/event.h
HTML Help Workshop support
[wxWidgets.git] / include / wx / event.h
index cb0c18d5a7d107d92f083c26ecb395edacf891cc..4179febd93e3969b5090ecec3a6ca2744f449155 100644 (file)
@@ -94,7 +94,7 @@ const wxEventType wxEVT_KEY_DOWN =                          wxEVT_FIRST + 215;
 const wxEventType wxEVT_KEY_UP =                            wxEVT_FIRST + 216;
 
  /*
-  * Scrollbar event identifiers
+  * wxScrollbar and wxSlider event identifiers
   */
 const wxEventType wxEVT_SCROLL_TOP =                        wxEVT_FIRST + 300;
 const wxEventType wxEVT_SCROLL_BOTTOM =                     wxEVT_FIRST + 301;
@@ -104,6 +104,20 @@ const wxEventType wxEVT_SCROLL_PAGEUP =                     wxEVT_FIRST + 304;
 const wxEventType wxEVT_SCROLL_PAGEDOWN =                   wxEVT_FIRST + 305;
 const wxEventType wxEVT_SCROLL_THUMBTRACK =                 wxEVT_FIRST + 306;
 
+ /*
+  * Scroll events from wxWindow
+  */
+const wxEventType wxEVT_SCROLLWIN_TOP =                     wxEVT_FIRST + 320;
+const wxEventType wxEVT_SCROLLWIN_BOTTOM =                  wxEVT_FIRST + 321;
+const wxEventType wxEVT_SCROLLWIN_LINEUP =                  wxEVT_FIRST + 322;
+const wxEventType wxEVT_SCROLLWIN_LINEDOWN =                wxEVT_FIRST + 323;
+const wxEventType wxEVT_SCROLLWIN_PAGEUP =                  wxEVT_FIRST + 324;
+const wxEventType wxEVT_SCROLLWIN_PAGEDOWN =                wxEVT_FIRST + 325;
+const wxEventType wxEVT_SCROLLWIN_THUMBTRACK =              wxEVT_FIRST + 326;
+
+ /*
+  * System events
+  */
 const wxEventType wxEVT_SIZE =                              wxEVT_FIRST + 400;
 const wxEventType wxEVT_MOVE =                              wxEVT_FIRST + 401;
 const wxEventType wxEVT_CLOSE_WINDOW =                      wxEVT_FIRST + 402;
@@ -290,6 +304,8 @@ public:
     // exists only for optimization purposes
     bool IsCommandEvent() const { return m_isCommandEvent; }
 
+    void CopyObject(wxObject& object_dest) const;
+
 public:
     bool              m_skipped;
     wxObject*         m_eventObject;
@@ -364,6 +380,8 @@ public:
     void SetInt(int i) { m_commandInt = i; }
     long GetInt() const { return m_commandInt ; }
 
+    void CopyObject(wxObject& obj) const;
+
 public:
     wxString          m_commandString; // String event argument
     int               m_commandInt;
@@ -392,7 +410,8 @@ private:
     DECLARE_DYNAMIC_CLASS(wxNotifyEvent)
 };
 
-// Scroll event class
+// Scroll event class, derived form wxCommandEvent. wxScrollEvents are
+// sent by wxSlider and wxScrollbar.
 /*
  wxEVT_SCROLL_TOP
  wxEVT_SCROLL_BOTTOM
@@ -423,6 +442,41 @@ public:
     void SetPosition(int pos) { m_commandInt = pos; }
 };
 
+// ScrollWin event class, derived fom wxEvent. wxScrollWinEvents
+// are sent by wxWindow.
+/*
+ wxEVT_SCROLLWIN_TOP
+ wxEVT_SCROLLWIN_BOTTOM
+ wxEVT_SCROLLWIN_LINEUP
+ wxEVT_SCROLLWIN_LINEDOWN
+ wxEVT_SCROLLWIN_PAGEUP
+ wxEVT_SCROLLWIN_PAGEDOWN
+ wxEVT_SCROLLWIN_THUMBTRACK
+*/
+
+class WXDLLEXPORT wxScrollWinEvent : public wxEvent
+{
+    DECLARE_DYNAMIC_CLASS(wxScrollWinEvent)
+
+public:
+    wxScrollWinEvent(wxEventType commandType = wxEVT_NULL,
+                     int pos = 0, int orient = 0);
+    ~wxScrollWinEvent() {}
+
+    /*
+     * Accessors
+     */
+
+    int GetOrientation() const { return (int) m_extraLong ; }
+    int GetPosition() const { return m_commandInt ; }
+    void SetOrientation(int orient) { m_extraLong = (long) orient; }
+    void SetPosition(int pos) { m_commandInt = pos; }
+
+public:
+    int               m_commandInt;    // Additional information
+    long              m_extraLong;     
+};
+
 // Mouse event class
 
 /*
@@ -543,6 +597,8 @@ public:
     // Get Y position
     long GetY() const { return m_y; }
 
+    void CopyObject(wxObject& obj) const;
+
 public:
     long          m_x;
     long          m_y;
@@ -592,6 +648,8 @@ public:
     // Get Y position
     long GetY() const { return m_y; }
 
+    void CopyObject(wxObject& obj) const;
+
 public:
     long          m_x;
     long          m_y;
@@ -620,6 +678,8 @@ public:
         { m_eventType = wxEVT_SIZE; m_id = id; }
 
     wxSize GetSize() const { return m_size; }
+
+    void CopyObject(wxObject& obj) const;
 };
 
 // Move event class
@@ -641,6 +701,8 @@ public:
         { m_eventType = wxEVT_MOVE; m_id = id; }
 
     wxPoint GetPosition() const { return m_pos; }
+
+    void CopyObject(wxObject& obj) const;
 };
 
 // Paint event class
@@ -674,6 +736,8 @@ public:
     wxEraseEvent(int Id = 0, wxDC *dc = (wxDC *) NULL)
         { m_eventType = wxEVT_ERASE_BACKGROUND; m_id = Id; m_dc = dc; }
     wxDC *GetDC() const { return m_dc; }
+
+    void CopyObject(wxObject& obj) const;
 };
 
 // Focus event class
@@ -706,6 +770,8 @@ public:
         { m_eventType = type; m_active = active; m_id = Id; }
     bool GetActive() const { return m_active; }
 
+    void CopyObject(wxObject& obj) const;
+
 private:
     bool m_active;
 };
@@ -738,13 +804,14 @@ class WXDLLEXPORT wxMenuEvent : public wxEvent
     DECLARE_DYNAMIC_CLASS(wxMenuEvent)
 
 public:
-  wxMenuEvent(wxEventType type = wxEVT_NULL, int id = 0)
-    { m_eventType = type; m_menuId = id; }
+    wxMenuEvent(wxEventType type = wxEVT_NULL, int id = 0)
+      { m_eventType = type; m_menuId = id; }
 
-  int GetMenuId() const { return m_menuId; }
+    int GetMenuId() const { return m_menuId; }
 
+    void CopyObject(wxObject& obj) const;
 private:
-  int m_menuId;
+    int m_menuId;
 };
 
 // Window close or session close event class
@@ -795,6 +862,8 @@ public:
     bool GetForce() const { return m_force; }
 #endif
 
+    void CopyObject(wxObject& obj) const;
+
 protected:
     bool m_loggingOff;
     bool m_veto, m_canVeto;
@@ -820,6 +889,8 @@ public:
     void SetShow(bool show) { m_show = show; }
     bool GetShow() const { return m_show; }
 
+    void CopyObject(wxObject& obj) const;
+
 protected:
     bool m_show;
 };
@@ -1194,6 +1265,10 @@ public:
 
     bool SearchDynamicEventTable( wxEvent& event );
 
+#if wxUSE_THREADS
+    void ClearEventLocker() { delete m_eventsLocker; m_eventsLocker = NULL; };
+#endif
+
 private:
     static const wxEventTableEntry         sm_eventTableEntries[];
 
@@ -1203,18 +1278,18 @@ protected:
     virtual const wxEventTable *GetEventTable() const;
 
 protected:
-    wxEvtHandler*      m_nextHandler;
-    wxEvtHandler*      m_previousHandler;
-    bool               m_enabled;           // Is event handler enabled?
-    wxList*            m_dynamicEvents;
-    wxList*           m_pendingEvents;
+    wxEvtHandler*       m_nextHandler;
+    wxEvtHandler*       m_previousHandler;
+    bool                m_enabled;           // Is event handler enabled?
+    wxList*             m_dynamicEvents;
+    wxList*                m_pendingEvents;
 #if wxUSE_THREADS
-    wxCriticalSection* m_eventsLocker;
+    wxCriticalSection*  m_eventsLocker;
 #endif
 
     // optimization: instead of using costly IsKindOf() to decide whether we're
     // a window (which is true in 99% of cases), use this flag
-    bool              m_isWindow;
+    bool                m_isWindow;
 };
 
 typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);