diff --git a/EAPMethods/include/EAP_UI.h b/EAPMethods/include/EAP_UI.h index 8512039..855c1cf 100644 --- a/EAPMethods/include/EAP_UI.h +++ b/EAPMethods/include/EAP_UI.h @@ -231,6 +231,11 @@ public: /// Constructs a banner pannel and set the title text to product name /// wxEAPBannerPanel(wxWindow* parent); + +protected: + /// \cond internal + virtual bool AcceptsFocusFromKeyboard() const { return false; } + /// \endcond }; diff --git a/EAPMethods/src/EAP_UI.cpp b/EAPMethods/src/EAP_UI.cpp index cb79c22..2015d42 100644 --- a/EAPMethods/src/EAP_UI.cpp +++ b/EAPMethods/src/EAP_UI.cpp @@ -36,11 +36,14 @@ wxEAPCredentialsDialog::wxEAPCredentialsDialog(wxWindow* parent) : wxEAPCredenti void wxEAPCredentialsDialog::AddContents(wxPanel **contents, size_t content_count) { - for (size_t i = 0; i < content_count; i++) - m_panels->Add(contents[i], 0, wxALL|wxEXPAND, 5); + if (content_count) { + for (size_t i = 0; i < content_count; i++) + m_panels->Add(contents[i], 0, wxALL|wxEXPAND, 5); - this->Layout(); - this->GetSizer()->Fit(this); + this->Layout(); + this->GetSizer()->Fit(this); + contents[0]->SetFocusFromKbd(); + } } diff --git a/EAPMethods/src/TTLS_UI.cpp b/EAPMethods/src/TTLS_UI.cpp index c9695b0..e1e4615 100644 --- a/EAPMethods/src/TTLS_UI.cpp +++ b/EAPMethods/src/TTLS_UI.cpp @@ -204,6 +204,8 @@ wxEAPTTLSConfig::wxEAPTTLSConfig(eap::config_ttls &cfg, LPCTSTR pszCredTarget, w this->SetSizer(sb_content); this->Layout(); + m_outer_identity->SetFocusFromKbd(); + // Connect Events this->Connect(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(wxEAPTTLSConfig::OnInitDialog)); }