Allow starting request by pressing "Enter" in the sample

Just a small ergonomic improvement.
This commit is contained in:
Vadim Zeitlin 2021-01-04 23:16:52 +01:00
parent f89781bfdd
commit d2dc11da4f

View File

@ -51,9 +51,12 @@ public:
mainSizer->Add(new wxStaticText(this, wxID_ANY, "Request URL:"), mainSizer->Add(new wxStaticText(this, wxID_ANY, "Request URL:"),
wxSizerFlags().Border()); wxSizerFlags().Border());
m_urlTextCtrl = new wxTextCtrl(this, wxID_ANY, m_urlTextCtrl = new wxTextCtrl(this, wxID_ANY,
"https://www.wxwidgets.org/downloads/logos/blocks.png"); "https://www.wxwidgets.org/downloads/logos/blocks.png",
wxDefaultPosition, wxDefaultSize,
wxTE_PROCESS_ENTER);
mainSizer->Add(m_urlTextCtrl, mainSizer->Add(m_urlTextCtrl,
wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT)); wxSizerFlags().Expand().Border(wxLEFT | wxRIGHT));
m_urlTextCtrl->Bind(wxEVT_TEXT_ENTER, &WebRequestFrame::OnStartButton, this);
m_notebook = new wxNotebook(this, wxID_ANY); m_notebook = new wxNotebook(this, wxID_ANY);
m_notebook->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, &WebRequestFrame::OnNotebookPageChanged, this); m_notebook->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, &WebRequestFrame::OnNotebookPageChanged, this);