2016-09-17 16:19:45 +00:00
|
|
|
=== modified file 'include/wx/event.h'
|
2015-05-21 21:29:26 +00:00
|
|
|
--- include/wx/event.h 2015-05-21 23:18:15.126136156 +0200
|
|
|
|
+++ include/wx/event.h 2015-05-21 23:20:35.112797127 +0200
|
|
|
|
@@ -11,6 +11,8 @@
|
|
|
|
#ifndef _WX_EVENT_H_
|
|
|
|
#define _WX_EVENT_H_
|
|
|
|
|
|
|
|
+#define USE_OSX_MAGNIFY_EVENT
|
|
|
|
+
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/cpp.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
@@ -716,6 +718,7 @@ wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_COR
|
2015-05-21 20:54:29 +00:00
|
|
|
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DOWN, wxMouseEvent);
|
|
|
|
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_UP, wxMouseEvent);
|
|
|
|
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DCLICK, wxMouseEvent);
|
|
|
|
+wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MAGNIFY, wxMouseEvent);
|
|
|
|
|
|
|
|
// Character input event type
|
|
|
|
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHAR, wxKeyEvent);
|
2015-05-21 21:29:26 +00:00
|
|
|
@@ -1751,6 +1754,8 @@ public:
|
2015-05-21 20:54:29 +00:00
|
|
|
bool Aux1DClick() const { return (m_eventType == wxEVT_AUX1_DCLICK); }
|
|
|
|
bool Aux2DClick() const { return (m_eventType == wxEVT_AUX2_DCLICK); }
|
|
|
|
|
|
|
|
+ bool Magnify() const { return (m_eventType == wxEVT_MAGNIFY); }
|
|
|
|
+
|
|
|
|
// True if a button is down and the mouse is moving
|
|
|
|
bool Dragging() const
|
|
|
|
{
|
2015-05-21 21:29:26 +00:00
|
|
|
@@ -1805,6 +1810,8 @@ public:
|
2015-05-21 20:54:29 +00:00
|
|
|
// Is the system set to do page scrolling?
|
|
|
|
bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); }
|
|
|
|
|
|
|
|
+ float GetMagnification() const { return m_magnification; }
|
|
|
|
+
|
|
|
|
virtual wxEvent *Clone() const { return new wxMouseEvent(*this); }
|
|
|
|
virtual wxEventCategory GetEventCategory() const { return wxEVT_CATEGORY_USER_INPUT; }
|
|
|
|
|
2015-05-21 21:29:26 +00:00
|
|
|
@@ -1824,6 +1831,8 @@ public:
|
2015-05-21 20:54:29 +00:00
|
|
|
int m_linesPerAction;
|
|
|
|
int m_columnsPerAction;
|
|
|
|
|
|
|
|
+ float m_magnification;
|
|
|
|
+
|
|
|
|
protected:
|
|
|
|
void Assign(const wxMouseEvent& evt);
|
|
|
|
|
2015-05-21 21:29:26 +00:00
|
|
|
@@ -4218,6 +4227,7 @@ typedef void (wxEvtHandler::*wxClipboard
|
2015-05-21 20:54:29 +00:00
|
|
|
#define EVT_MOUSE_AUX2_DOWN(func) wx__DECLARE_EVT0(wxEVT_AUX2_DOWN, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOUSE_AUX2_UP(func) wx__DECLARE_EVT0(wxEVT_AUX2_UP, wxMouseEventHandler(func))
|
|
|
|
#define EVT_MOUSE_AUX2_DCLICK(func) wx__DECLARE_EVT0(wxEVT_AUX2_DCLICK, wxMouseEventHandler(func))
|
|
|
|
+#define EVT_MAGNIFY(func) wx__DECLARE_EVT0(wxEVT_MAGNIFY, wxMouseEventHandler(func))
|
|
|
|
|
|
|
|
// All mouse events
|
|
|
|
#define EVT_MOUSE_EVENTS(func) \
|
2015-05-21 21:29:26 +00:00
|
|
|
@@ -4239,7 +4249,8 @@ typedef void (wxEvtHandler::*wxClipboard
|
2015-05-21 20:54:29 +00:00
|
|
|
EVT_MOTION(func) \
|
|
|
|
EVT_LEAVE_WINDOW(func) \
|
|
|
|
EVT_ENTER_WINDOW(func) \
|
|
|
|
- EVT_MOUSEWHEEL(func)
|
|
|
|
+ EVT_MOUSEWHEEL(func) \
|
|
|
|
+ EVT_MAGNIFY(func)
|
|
|
|
|
|
|
|
// Scrolling from wxWindow (sent to wxScrolledWindow)
|
|
|
|
#define EVT_SCROLLWIN_TOP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_TOP, wxScrollWinEventHandler(func))
|
2016-09-17 16:19:45 +00:00
|
|
|
=== modified file 'src/common/event.cpp'
|
2015-05-21 21:29:26 +00:00
|
|
|
--- src/common/event.cpp 2015-05-21 23:18:15.049469492 +0200
|
|
|
|
+++ src/common/event.cpp 2015-05-21 23:18:23.566135812 +0200
|
|
|
|
@@ -208,6 +208,7 @@ wxDEFINE_EVENT( wxEVT_AUX1_DCLICK, wxMou
|
2015-05-21 20:54:29 +00:00
|
|
|
wxDEFINE_EVENT( wxEVT_AUX2_DOWN, wxMouseEvent );
|
|
|
|
wxDEFINE_EVENT( wxEVT_AUX2_UP, wxMouseEvent );
|
|
|
|
wxDEFINE_EVENT( wxEVT_AUX2_DCLICK, wxMouseEvent );
|
|
|
|
+wxDEFINE_EVENT( wxEVT_MAGNIFY, wxMouseEvent );
|
|
|
|
|
|
|
|
// Character input event type
|
|
|
|
wxDEFINE_EVENT( wxEVT_CHAR, wxKeyEvent );
|
2015-05-21 21:29:26 +00:00
|
|
|
@@ -576,6 +577,8 @@ wxMouseEvent::wxMouseEvent(wxEventType c
|
2015-05-21 20:54:29 +00:00
|
|
|
m_wheelDelta = 0;
|
|
|
|
m_linesPerAction = 0;
|
|
|
|
m_columnsPerAction = 0;
|
|
|
|
+
|
|
|
|
+ m_magnification = 0.0f;
|
|
|
|
}
|
|
|
|
|
|
|
|
void wxMouseEvent::Assign(const wxMouseEvent& event)
|
2015-05-21 21:29:26 +00:00
|
|
|
@@ -600,6 +603,8 @@ void wxMouseEvent::Assign(const wxMouseE
|
2015-05-21 20:54:29 +00:00
|
|
|
m_linesPerAction = event.m_linesPerAction;
|
|
|
|
m_columnsPerAction = event.m_columnsPerAction;
|
|
|
|
m_wheelAxis = event.m_wheelAxis;
|
|
|
|
+
|
|
|
|
+ m_magnification = event.m_magnification;
|
|
|
|
}
|
|
|
|
|
|
|
|
// return true if was a button dclick event
|
2016-09-17 16:19:45 +00:00
|
|
|
=== modified file 'src/osx/cocoa/window.mm'
|
2015-05-21 21:29:26 +00:00
|
|
|
--- src/osx/cocoa/window.mm 2015-05-21 23:18:15.032802826 +0200
|
|
|
|
+++ src/osx/cocoa/window.mm 2015-05-21 23:18:23.566135812 +0200
|
|
|
|
@@ -741,6 +741,12 @@ void wxWidgetCocoaImpl::SetupMouseEvent(
|
2015-05-21 20:54:29 +00:00
|
|
|
case NSMouseMoved :
|
|
|
|
wxevent.SetEventType( wxEVT_MOTION ) ;
|
|
|
|
break;
|
|
|
|
+
|
|
|
|
+ case NSEventTypeMagnify:
|
|
|
|
+ wxevent.SetEventType( wxEVT_MAGNIFY );
|
|
|
|
+ wxevent.m_magnification = [nsEvent magnification];
|
|
|
|
+ break;
|
|
|
|
+
|
|
|
|
default :
|
|
|
|
break ;
|
|
|
|
}
|
2015-05-21 21:29:26 +00:00
|
|
|
@@ -1773,6 +1779,10 @@ void wxOSXCocoaClassAddWXMethods(Class c
|
2015-05-21 20:54:29 +00:00
|
|
|
wxOSX_CLASS_ADD_METHOD(c, @selector(mouseEntered:), (IMP) wxOSX_mouseEvent, "v@:@" )
|
|
|
|
wxOSX_CLASS_ADD_METHOD(c, @selector(mouseExited:), (IMP) wxOSX_mouseEvent, "v@:@" )
|
|
|
|
|
|
|
|
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
|
|
|
|
+ wxOSX_CLASS_ADD_METHOD(c, @selector(magnifyWithEvent:), (IMP)wxOSX_mouseEvent, "v@:@")
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
wxOSX_CLASS_ADD_METHOD(c, @selector(cursorUpdate:), (IMP) wxOSX_cursorUpdate, "v@:@" )
|
|
|
|
|
|
|
|
wxOSX_CLASS_ADD_METHOD(c, @selector(keyDown:), (IMP) wxOSX_keyEvent, "v@:@" )
|