From 81b3c420fdf5accfbc7e333de0f31807a8daf000 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 16 Feb 2018 11:26:08 +0100 Subject: [PATCH] Set OK as the default button in Select{Single,Multi}Option() dialogs --- common/confirm.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/common/confirm.cpp b/common/confirm.cpp index 773c3ae4b6..a881283333 100644 --- a/common/confirm.cpp +++ b/common/confirm.cpp @@ -190,9 +190,11 @@ int SelectSingleOption( wxWindow* aParent, const wxString& aTitle, const wxStrin } wxStdDialogButtonSizer* m_sdboxSizer = new wxStdDialogButtonSizer(); - m_sdboxSizer->AddButton( new wxButton( dlg, wxID_OK ) ); + wxButton* btnOk = new wxButton( dlg, wxID_OK ); + m_sdboxSizer->AddButton( btnOk ); m_sdboxSizer->AddButton( new wxButton( dlg, wxID_CANCEL ) ); m_sdboxSizer->Realize(); + btnOk->SetDefault(); boxSizer->Add( m_sdboxSizer, 1, wxEXPAND | wxALL, 5 ); dlg->SetSizer( boxSizer ); @@ -252,9 +254,11 @@ public: boxSizer->Add( btnSizer, 0, wxEXPAND | wxALL, 5 ); wxStdDialogButtonSizer* m_sdboxSizer = new wxStdDialogButtonSizer(); - m_sdboxSizer->AddButton( new wxButton( this, wxID_OK ) ); + wxButton* btnOk = new wxButton( this, wxID_OK ); + m_sdboxSizer->AddButton( btnOk ); m_sdboxSizer->AddButton( new wxButton( this, wxID_CANCEL ) ); m_sdboxSizer->Realize(); + btnOk->SetDefault(); boxSizer->Add( m_sdboxSizer, 0, wxEXPAND | wxALL, 5 ); SetSizer( boxSizer );