From 06dc9073ab35e939dbcae1f578df3d0aea427ceb Mon Sep 17 00:00:00 2001 From: David Bailes Date: Tue, 14 Feb 2017 16:39:59 +0000 Subject: [PATCH] Fix for bug 1550 - metadata editor: esc does not cancel Problem: on Windows, Esc does not cancel metadata editor. Fix: 1. In tag.h, for windows, don't override IsEscapeKey(). 2. In tag.cpp, for windows, include a return in the function DoCancel, so that if a cell is being edited and the user presses Esc, this just cancels the edit, and not the dialog. This fix returns the behaviour of the dialog on Windows back to the behaviour prior to commit c1ca055. It only affects the behaviour on Windows. --- src/Tags.cpp | 3 +++ src/Tags.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/Tags.cpp b/src/Tags.cpp index 6c085555a..dd2b7fd15 100644 --- a/src/Tags.cpp +++ b/src/Tags.cpp @@ -1365,6 +1365,9 @@ void TagsEditor::DoCancel(bool escKey) // To avoid memory leak, don't forget DecRef()! editor->DecRef(); mGrid->HideCellEditControl(); +#if defined(__WXMSW__) + return; +#endif } auto focus = wxWindow::FindFocus(); diff --git a/src/Tags.h b/src/Tags.h index c02bc4f0b..3111f2542 100644 --- a/src/Tags.h +++ b/src/Tags.h @@ -142,7 +142,9 @@ class TagsEditor final : public wxDialogWrapper virtual ~TagsEditor(); +#if !defined(__WXMSW__) bool IsEscapeKey(const wxKeyEvent& /*event*/) override { return false; } +#endif void PopulateOrExchange(ShuttleGui & S);