TEXT_CTRL_EVAL: Close the parent dialog after pressing Enter

Fixes: lp:1744721
* https://bugs.launchpad.net/kicad/+bug/1744721
This commit is contained in:
Maciej Suminski 2018-01-23 11:49:01 +01:00
parent 975c08c464
commit 121e670508
2 changed files with 6 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 CERN
* Copyright (C) 2017-2018 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or
@ -59,7 +59,10 @@ void TEXT_CTRL_EVAL::onTextFocusLost( wxFocusEvent& aEvent )
void TEXT_CTRL_EVAL::onTextEnter( wxCommandEvent& aEvent )
{
evaluate();
aEvent.Skip();
// Accept the changes and close the parent dialog
wxCommandEvent event( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK );
wxPostEvent( GetParent(), event );
}

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2017 CERN
* Copyright (C) 2017-2018 CERN
* @author Maciej Suminski <maciej.suminski@cern.ch>
*
* This program is free software; you can redistribute it and/or