]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/event.h
Improve column auto-sizing code in generic wxListCtrl.
[wxWidgets.git] / include / wx / event.h
index b73289934f0104fcdc6273a400076ce667fed34e..f31e57b92eb2f5913ccf2d7cbfdc18d7adb30720 100644 (file)
@@ -1443,18 +1443,6 @@ private:
  wxEVT_LEFT_DCLICK
  wxEVT_MIDDLE_DCLICK
  wxEVT_RIGHT_DCLICK
- wxEVT_NC_LEFT_DOWN
- wxEVT_NC_LEFT_UP,
- wxEVT_NC_MIDDLE_DOWN,
- wxEVT_NC_MIDDLE_UP,
- wxEVT_NC_RIGHT_DOWN,
- wxEVT_NC_RIGHT_UP,
- wxEVT_NC_MOTION,
- wxEVT_NC_ENTER_WINDOW,
- wxEVT_NC_LEAVE_WINDOW,
- wxEVT_NC_LEFT_DCLICK,
- wxEVT_NC_MIDDLE_DCLICK,
- wxEVT_NC_RIGHT_DCLICK,
 */
 
 class WXDLLIMPEXP_CORE wxMouseEvent : public wxEvent,
@@ -1661,7 +1649,12 @@ class WXDLLIMPEXP_CORE wxKeyEvent : public wxEvent,
 {
 public:
     wxKeyEvent(wxEventType keyType = wxEVT_NULL);
+
+    // Normal copy ctor and a ctor creating a new event for the same key as the
+    // given one but a different event type (this is used in implementation
+    // code only, do not use outside of the library).
     wxKeyEvent(const wxKeyEvent& evt);
+    wxKeyEvent(wxEventType eventType, const wxKeyEvent& evt);
 
     // get the key code: an ASCII7 char or an element of wxKeyCode enum
     int GetKeyCode() const { return (int)m_keyCode; }
@@ -1702,6 +1695,15 @@ public:
     // Get Y position
     wxCoord GetY() const { return m_y; }
 
+    // Can be called from wxEVT_CHAR_HOOK handler to allow generation of normal
+    // key events even though the event had been handled (by default they would
+    // not be generated in this case).
+    void DoAllowNextEvent() { m_allowNext = true; }
+
+    // Return the value of the "allow next" flag, for internal use only.
+    bool IsNextEventAllowed() const { return m_allowNext; }
+
+
     virtual wxEvent *Clone() const { return new wxKeyEvent(*this); }
     virtual wxEventCategory GetEventCategory() const { return wxEVT_CATEGORY_USER_INPUT; }
 
@@ -1739,6 +1741,16 @@ public:
     wxUint32      m_rawFlags;
 
 private:
+    // Set the event to propagate if necessary, i.e. if it's of wxEVT_CHAR_HOOK
+    // type. This is used by all ctors.
+    void InitPropagation()
+    {
+        if ( m_eventType == wxEVT_CHAR_HOOK )
+            m_propagationLevel = wxEVENT_PROPAGATE_MAX;
+
+        m_allowNext = false;
+    }
+
     // Copy only the event data present in this class, this is used by
     // AssignKeyData() and copy ctor.
     void DoAssignMembers(const wxKeyEvent& evt)
@@ -1755,6 +1767,11 @@ private:
 #endif
     }
 
+    // If this flag is true, the normal key events should still be generated
+    // even if wxEVT_CHAR_HOOK had been handled. By default it is false as
+    // handling wxEVT_CHAR_HOOK suppresses all the subsequent events.
+    bool m_allowNext;
+
     DECLARE_DYNAMIC_CLASS(wxKeyEvent)
 };
 
@@ -1839,7 +1856,6 @@ private:
 /*
  wxEVT_PAINT
  wxEVT_NC_PAINT
- wxEVT_PAINT_ICON
  */
 
 #if wxDEBUG_LEVEL && (defined(__WXMSW__) || defined(__WXPM__))
@@ -3320,7 +3336,7 @@ protected:
     // base class implementation passes the event to wxTheApp
     virtual bool TryAfter(wxEvent& event);
 
-#ifdef WXWIN_COMPATIBILITY_2_8
+#if WXWIN_COMPATIBILITY_2_8
     // deprecated method: override TryBefore() instead of this one
     wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(
         virtual bool TryValidator(wxEvent& WXUNUSED(event)), return false; )