From acde3d615292a7401597246608596517d7664475 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Fri, 1 Jul 2016 00:10:06 -0400 Subject: [PATCH] Make tool bar pushbuttons cooperate with Voiceover on Mac... ... Use Command+f5 to start VoiceOver, then control+alt+ left and right arrows to navigate. Much better now, but still we need to do something about sliders, meters, and numeric text controls. --- src/widgets/AButton.cpp | 8 ++++---- src/widgets/AButton.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/widgets/AButton.cpp b/src/widgets/AButton.cpp index 2097af780..4d64460d7 100644 --- a/src/widgets/AButton.cpp +++ b/src/widgets/AButton.cpp @@ -35,7 +35,7 @@ #include "../Project.h" #include -BEGIN_EVENT_TABLE(AButton, wxWindow) +BEGIN_EVENT_TABLE(AButton, wxButton) EVT_MOUSE_EVENTS(AButton::OnMouseEvent) EVT_MOUSE_CAPTURE_LOST(AButton::OnCaptureLost) EVT_KEY_DOWN(AButton::OnKeyDown) @@ -161,7 +161,7 @@ AButton::AButton(wxWindow * parent, wxImage down, wxImage dis, bool toggle): - wxWindow() + wxButton() { Init(parent, id, pos, size, ImageRoll(up), ImageRoll(over), @@ -178,7 +178,7 @@ AButton::AButton(wxWindow * parent, ImageRoll down, ImageRoll dis, bool toggle): - wxWindow() + wxButton() { Init(parent, id, pos, size, up, over, down, dis, @@ -205,7 +205,7 @@ void AButton::Init(wxWindow * parent, // a navigation event - move to next control. As a workaround, the style wxWANTS_CHARS // results in all characters being available in the OnKeyDown function below. Note // that OnKeyDown now has to handle navigation. - Create(parent, id, pos, size, wxWANTS_CHARS); + Create(parent, id, wxEmptyString, pos, size, wxWANTS_CHARS | wxBORDER_NONE); mWasShiftDown = false; mWasControlDown = false; diff --git a/src/widgets/AButton.h b/src/widgets/AButton.h index 0b9ae77f5..9274adffb 100644 --- a/src/widgets/AButton.h +++ b/src/widgets/AButton.h @@ -19,12 +19,13 @@ #include #endif +#include #include #include #include "ImageRoll.h" -class AButton final : public wxWindow { +class AButton final : public wxButton { friend class AButtonAx; class Listener;