const wxObjectEventFunctor &other =
static_cast< const wxObjectEventFunctor & >( functor );
- // FIXME-VC6: amazing but true: replacing "method == NULL" here
- // with "!method" makes VC6 crash with an ICE in DLL build (only!)
+ // FIXME-VC6: amazing but true: replacing "m_method == 0" here
+ // with "!m_method" makes VC6 crash with an ICE in DLL build (only!)
+ // Also notice that using "NULL" instead of "0" results in warnings
+ // about "using NULL in arithmetics" from arm-linux-androideabi-g++
+ // 4.4.3 used for wxAndroid build.
- return ( m_method == other.m_method || other.m_method == NULL ) &&
+ return ( m_method == other.m_method || other.m_method == 0 ) &&
( m_handler == other.m_handler || other.m_handler == NULL );
}
else
{
// make sure our string member (which uses COW, aka refcounting) is not
// shared by other wxString instances:
- SetString(GetString().c_str());
+ SetString(GetString().Clone());
}
virtual wxEvent *Clone() const
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,
*/
+enum wxMouseWheelAxis
+{
+ wxMOUSE_WHEEL_VERTICAL,
+ wxMOUSE_WHEEL_HORIZONTAL
+};
+
class WXDLLIMPEXP_CORE wxMouseEvent : public wxEvent,
public wxMouseState
{
// should occur for each delta.
int GetWheelDelta() const { return m_wheelDelta; }
- // Gets the axis the wheel operation concerns, 0 being the y axis as on
- // most mouse wheels, 1 is the x axis for things like MightyMouse scrolls
- // or horizontal trackpad scrolling
- int GetWheelAxis() const { return m_wheelAxis; }
+ // Gets the axis the wheel operation concerns; wxMOUSE_WHEEL_VERTICAL
+ // (most common case) or wxMOUSE_WHEEL_HORIZONTAL (for horizontal scrolling
+ // using e.g. a trackpad).
+ wxMouseWheelAxis GetWheelAxis() const { return m_wheelAxis; }
// Returns the configured number of lines (or whatever) to be scrolled per
// wheel action. Defaults to one.
public:
int m_clickCount;
- int m_wheelAxis;
+ wxMouseWheelAxis m_wheelAxis;
int m_wheelRotation;
int m_wheelDelta;
int m_linesPerAction;
{ return wxPoint(m_x, m_y); }
// Get X position
- wxCoord GetX() const { return m_x; }
+ wxCoord GetX() const;
// Get Y position
- wxCoord GetY() const { return m_y; }
+ wxCoord GetY() const;
// 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
{
m_x = evt.m_x;
m_y = evt.m_y;
+ m_hasPosition = evt.m_hasPosition;
m_keyCode = evt.m_keyCode;
#endif
}
+ // Initialize m_x and m_y using the current mouse cursor position if
+ // necessary.
+ void InitPositionIfNecessary() const;
+
// 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;
+ // If true, m_x and m_y were already initialized. If false, try to get them
+ // when they're requested.
+ bool m_hasPosition;
+
DECLARE_DYNAMIC_CLASS(wxKeyEvent)
};
/*
wxEVT_PAINT
wxEVT_NC_PAINT
- wxEVT_PAINT_ICON
*/
#if wxDEBUG_LEVEL && (defined(__WXMSW__) || defined(__WXPM__))
protected:
// Init the hash table with the entries of the static event table.
void InitHashTable();
- // Helper funtion of InitHashTable() to insert 1 entry into the hash table.
+ // Helper function of InitHashTable() to insert 1 entry into the hash table.
void AddEntry(const wxEventTableEntry &entry);
// Allocate and init with null pointers the base hash table.
void AllocEventTypeTable(size_t size);
// 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; )