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.
This commit is contained in:
David Bailes 2017-02-14 16:39:59 +00:00
parent 92349739f9
commit 06dc9073ab
2 changed files with 5 additions and 0 deletions

View File

@ -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();

View File

@ -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);