mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-06 07:09:39 +02:00
Enh1444 and Bug1435 fixed by CHANGED MAC BUILD PROCEURE...
Enh1444 is to make pinch and spread gestures work. Bug1435 is to bring focus rings back for types of controls that lost them in version 2.1.2. This importantly includes pushbuttons and choice controls (drop-down menus). Less importantly, date picker (as in the Timer Record dialog) and Listbox (as in the dialog to choose label font). There is one more type of control that lost focus rings, and is not fixed: List controls (distinct from list boxes), such as in the Manage Curves dialog that opens from Equalization.
This commit is contained in:
parent
d91f825424
commit
b6b9840d06
@ -37,6 +37,8 @@ http://forum.audacityteam.org/viewtopic.php?p=303835#p303835 .
|
||||
cd wxWidgets-3.0.2
|
||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/wxMac-3.0.2-fixes.patch .
|
||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/eventloops.patch .
|
||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/pinch-spread.patch .
|
||||
patch -p0 -i <path to Audacity source>/mac/wxMac_additions/focusrings.patch .
|
||||
|
||||
10) And finally build/install wxWidgets:
|
||||
|
||||
|
123
mac/wxMac_additions/focusrings.patch
Normal file
123
mac/wxMac_additions/focusrings.patch
Normal file
@ -0,0 +1,123 @@
|
||||
From 148b0ed936b023b9b87d7703ecb86c4279f1182a Mon Sep 17 00:00:00 2001
|
||||
From: Paul Licameli <paul.licameli@audacityteam.org>
|
||||
Date: Wed, 6 Jul 2016 14:18:17 -0400
|
||||
Subject: [PATCH 2/2] Focus rings are back for buttons, choice, listbox,
|
||||
dateTimePicker controls
|
||||
|
||||
---
|
||||
include/wx/button.h | 2 ++
|
||||
include/wx/choice.h | 2 ++
|
||||
include/wx/datetimectrl.h | 2 ++
|
||||
include/wx/listbox.h | 2 ++
|
||||
include/wx/window.h | 2 ++
|
||||
src/osx/cocoa/window.mm | 22 +++++++++++++++++++++-
|
||||
6 files changed, 31 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/wx/button.h b/include/wx/button.h
|
||||
index 71dbee4..6aa75d3 100644
|
||||
--- include/wx/button.h
|
||||
+++ include/wx/button.h
|
||||
@@ -42,6 +42,8 @@ public:
|
||||
// returns the default button size for this platform
|
||||
static wxSize GetDefaultSize();
|
||||
|
||||
+ virtual bool NeedsFocusRing() const { return true; }
|
||||
+
|
||||
protected:
|
||||
wxDECLARE_NO_COPY_CLASS(wxButtonBase);
|
||||
};
|
||||
diff --git a/include/wx/choice.h b/include/wx/choice.h
|
||||
index 3a848f9..421a9a7 100644
|
||||
--- include/wx/choice.h
|
||||
+++ include/wx/choice.h
|
||||
@@ -57,6 +57,8 @@ public:
|
||||
// override wxItemContainer::IsSorted
|
||||
virtual bool IsSorted() const { return HasFlag(wxCB_SORT); }
|
||||
|
||||
+ virtual bool NeedsFocusRing() const { return true; }
|
||||
+
|
||||
protected:
|
||||
// The generic implementation doesn't determine the height correctly and
|
||||
// doesn't account for the width of the arrow but does take into account
|
||||
diff --git a/include/wx/datetimectrl.h b/include/wx/datetimectrl.h
|
||||
index 30f23df..d51c6c1 100644
|
||||
--- include/wx/datetimectrl.h
|
||||
+++ include/wx/datetimectrl.h
|
||||
@@ -32,6 +32,8 @@ public:
|
||||
// Set/get the date or time (in the latter case, time part is ignored).
|
||||
virtual void SetValue(const wxDateTime& dt) = 0;
|
||||
virtual wxDateTime GetValue() const = 0;
|
||||
+
|
||||
+ virtual bool NeedsFocusRing() const { return true; }
|
||||
};
|
||||
|
||||
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
|
||||
diff --git a/include/wx/listbox.h b/include/wx/listbox.h
|
||||
index afb0220..b9d47f0 100644
|
||||
--- include/wx/listbox.h
|
||||
+++ include/wx/listbox.h
|
||||
@@ -94,6 +94,8 @@ public:
|
||||
int HitTest(const wxPoint& point) const { return DoListHitTest(point); }
|
||||
int HitTest(int x, int y) const { return DoListHitTest(wxPoint(x, y)); }
|
||||
|
||||
+ virtual bool NeedsFocusRing() const { return true; }
|
||||
+
|
||||
|
||||
protected:
|
||||
virtual void DoSetFirstItem(int n) = 0;
|
||||
diff --git a/include/wx/window.h b/include/wx/window.h
|
||||
index 7dffad4..bbe727d 100644
|
||||
--- include/wx/window.h
|
||||
+++ include/wx/window.h
|
||||
@@ -260,6 +260,8 @@ public:
|
||||
// moving/resizing
|
||||
// ---------------
|
||||
|
||||
+ virtual bool NeedsFocusRing() const { return false; }
|
||||
+
|
||||
// set the window size and/or position
|
||||
void SetSize( int x, int y, int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO )
|
||||
diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm
|
||||
index d9fa4ae..881d0e9 100644
|
||||
--- src/osx/cocoa/window.mm
|
||||
+++ src/osx/cocoa/window.mm
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/combobox.h"
|
||||
#include "wx/radiobut.h"
|
||||
+ #include "wx/button.h"
|
||||
#endif
|
||||
|
||||
#ifdef __WXMAC__
|
||||
@@ -1660,7 +1661,26 @@ void wxWidgetCocoaImpl::drawRect(void* rect, WXWidget slf, void *WXUNUSED(_cmd))
|
||||
// call super
|
||||
SEL _cmd = @selector(drawRect:);
|
||||
wxOSX_DrawRectHandlerPtr superimpl = (wxOSX_DrawRectHandlerPtr) [[slf superclass] instanceMethodForSelector:_cmd];
|
||||
- superimpl(slf, _cmd, *(NSRect*)rect);
|
||||
+
|
||||
+ wxWindow *peer = GetWXPeer();
|
||||
+ bool hasFocus = peer->HasFocus();
|
||||
+ if (hasFocus &&
|
||||
+ peer->NeedsFocusRing()) {
|
||||
+ superimpl(slf, _cmd, *(NSRect*)rect);
|
||||
+
|
||||
+ // Paint it again, without text, causing focus halo to be
|
||||
+ // superimposed about all else
|
||||
+ HIThemeBeginFocus( context, kHIThemeFocusRingOnly, NULL );
|
||||
+ CGContextSetTextDrawingMode( context, kCGTextInvisible );
|
||||
+ superimpl(slf, _cmd, *(NSRect*)rect);
|
||||
+ HIThemeEndFocus( context );
|
||||
+
|
||||
+ CGContextRestoreGState( context );
|
||||
+ CGContextSaveGState( context );
|
||||
+ }
|
||||
+ else
|
||||
+ superimpl(slf, _cmd, *(NSRect*)rect);
|
||||
+
|
||||
CGContextRestoreGState( context );
|
||||
CGContextSaveGState( context );
|
||||
}
|
||||
--
|
||||
2.3.2 (Apple Git-55)
|
||||
|
206
mac/wxMac_additions/pinch-spread.patch
Normal file
206
mac/wxMac_additions/pinch-spread.patch
Normal file
@ -0,0 +1,206 @@
|
||||
From 74a186065ad04a1ed3d43baeccec9083910ec623 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Licameli <paul.licameli@audacityteam.org>
|
||||
Date: Sun, 3 Jul 2016 10:16:12 -0400
|
||||
Subject: [PATCH 1/2] Add wxEVT_MAGNIFY mouse event.
|
||||
|
||||
Currently this is implemented for wxOSX only.
|
||||
|
||||
Closes #14322.
|
||||
|
||||
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
|
||||
---
|
||||
docs/changes.txt | 1 +
|
||||
include/wx/event.h | 9 ++++++++-
|
||||
interface/wx/event.h | 29 +++++++++++++++++++++++++++++
|
||||
src/common/event.cpp | 4 ++++
|
||||
src/osx/cocoa/window.mm | 10 ++++++++++
|
||||
5 files changed, 52 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/docs/changes.txt b/docs/changes.txt
|
||||
index 72e7d42..6436bfb 100644
|
||||
--- docs/changes.txt
|
||||
+++ docs/changes.txt
|
||||
@@ -585,6 +585,7 @@ All:
|
||||
|
||||
All (GUI):
|
||||
|
||||
+- Add wxEVT_MAGNIFY mouse event (Joost Nieuwenhuijse).
|
||||
- Add wxGenericListCtrl::EndEditLabel() (Tim Kosse).
|
||||
- Implement bounding box computation in wxGCDC (Toni Ruža).
|
||||
- Fix saving GIF animations with 2.5s+ delays between frames (elvissteinjr).
|
||||
diff --git a/include/wx/event.h b/include/wx/event.h
|
||||
index 61ec19c..26af365 100644
|
||||
--- include/wx/event.h
|
||||
+++ include/wx/event.h
|
||||
@@ -716,6 +716,7 @@ wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_DCLICK, wxMouseEvent);
|
||||
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);
|
||||
@@ -1751,6 +1752,8 @@ public:
|
||||
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
|
||||
{
|
||||
@@ -1805,6 +1808,7 @@ public:
|
||||
// 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; }
|
||||
|
||||
@@ -1823,6 +1827,7 @@ public:
|
||||
int m_wheelDelta;
|
||||
int m_linesPerAction;
|
||||
int m_columnsPerAction;
|
||||
+ float m_magnification;
|
||||
|
||||
protected:
|
||||
void Assign(const wxMouseEvent& evt);
|
||||
@@ -4218,6 +4223,7 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&
|
||||
#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) \
|
||||
@@ -4239,7 +4245,8 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&
|
||||
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))
|
||||
diff --git a/interface/wx/event.h b/interface/wx/event.h
|
||||
index 52bb609..7fe007a 100644
|
||||
--- interface/wx/event.h
|
||||
+++ interface/wx/event.h
|
||||
@@ -2626,6 +2626,8 @@ enum wxMouseWheelAxis
|
||||
Process a @c wxEVT_MOUSEWHEEL event.
|
||||
@event{EVT_MOUSE_EVENTS(func)}
|
||||
Process all mouse events.
|
||||
+ @event{EVT_MAGNIFY(func)}
|
||||
+ Process a @c wxEVT_MAGNIFY event (new since wxWidgets 3.1.0).
|
||||
@endEventTable
|
||||
|
||||
@library{wxcore}
|
||||
@@ -2659,6 +2661,7 @@ public:
|
||||
@li @c wxEVT_AUX2_DCLICK
|
||||
@li @c wxEVT_MOTION
|
||||
@li @c wxEVT_MOUSEWHEEL
|
||||
+ @li @c wxEVT_MAGNIFY
|
||||
*/
|
||||
wxMouseEvent(wxEventType mouseEventType = wxEVT_NULL);
|
||||
|
||||
@@ -2785,6 +2788,21 @@ public:
|
||||
wxPoint GetLogicalPosition(const wxDC& dc) const;
|
||||
|
||||
/**
|
||||
+ For magnify (pinch to zoom) events: returns the change in magnification.
|
||||
+
|
||||
+ A value of 0 means no change, a positive value means we should enlarge
|
||||
+ (or zoom in), a negative value means we should shrink (or zoom out).
|
||||
+
|
||||
+ This method is only valid to call for @c wxEVT_MAGNIFY events which are
|
||||
+ currently only generated under OS X.
|
||||
+
|
||||
+ @see Magnify()
|
||||
+
|
||||
+ @since 3.1.0
|
||||
+ */
|
||||
+ float GetMagnification() const;
|
||||
+
|
||||
+ /**
|
||||
Get wheel delta, normally 120.
|
||||
|
||||
This is the threshold for action to be taken, and one such action
|
||||
@@ -2851,6 +2869,17 @@ public:
|
||||
bool LeftUp() const;
|
||||
|
||||
/**
|
||||
+ Returns @true if the event is a magnify (i.e.\ pinch to zoom) event.
|
||||
+
|
||||
+ Such events are currently generated only under OS X.
|
||||
+
|
||||
+ @see GetMagnification()
|
||||
+
|
||||
+ @since 3.1.0
|
||||
+ */
|
||||
+ bool Magnify() const;
|
||||
+
|
||||
+ /**
|
||||
Returns @true if the Meta key was down at the time of the event.
|
||||
*/
|
||||
bool MetaDown() const;
|
||||
diff --git a/src/common/event.cpp b/src/common/event.cpp
|
||||
index d92a4ac..1015c84 100644
|
||||
--- src/common/event.cpp
|
||||
+++ src/common/event.cpp
|
||||
@@ -208,6 +208,7 @@ wxDEFINE_EVENT( wxEVT_AUX1_DCLICK, wxMouseEvent );
|
||||
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 );
|
||||
@@ -576,6 +577,7 @@ wxMouseEvent::wxMouseEvent(wxEventType commandType)
|
||||
m_wheelDelta = 0;
|
||||
m_linesPerAction = 0;
|
||||
m_columnsPerAction = 0;
|
||||
+ m_magnification = 0.0f;
|
||||
}
|
||||
|
||||
void wxMouseEvent::Assign(const wxMouseEvent& event)
|
||||
@@ -600,6 +602,8 @@ void wxMouseEvent::Assign(const wxMouseEvent& event)
|
||||
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
|
||||
diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm
|
||||
index ede8ebf..d9fa4ae 100644
|
||||
--- src/osx/cocoa/window.mm
|
||||
+++ src/osx/cocoa/window.mm
|
||||
@@ -741,6 +741,12 @@ void wxWidgetCocoaImpl::SetupMouseEvent( wxMouseEvent &wxevent , NSEvent * nsEve
|
||||
case NSMouseMoved :
|
||||
wxevent.SetEventType( wxEVT_MOTION ) ;
|
||||
break;
|
||||
+
|
||||
+ case NSEventTypeMagnify:
|
||||
+ wxevent.SetEventType( wxEVT_MAGNIFY );
|
||||
+ wxevent.m_magnification = [nsEvent magnification];
|
||||
+ break;
|
||||
+
|
||||
default :
|
||||
break ;
|
||||
}
|
||||
@@ -1772,6 +1778,10 @@ void wxOSXCocoaClassAddWXMethods(Class c)
|
||||
wxOSX_CLASS_ADD_METHOD(c, @selector(scrollWheel:), (IMP) wxOSX_mouseEvent, "v@:@" )
|
||||
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@:@" )
|
||||
|
||||
--
|
||||
2.3.2 (Apple Git-55)
|
||||
|
Loading…
x
Reference in New Issue
Block a user