CodeWindow: Replace wxStaticText/wxTextCtrl combo with a wxSearchCtrl

Same thing, one control.
This commit is contained in:
Lioncash 2015-08-03 04:19:52 -04:00
parent 8ea9b07b59
commit 6866373202
1 changed files with 6 additions and 6 deletions

View File

@ -10,6 +10,7 @@
#include <wx/listbox.h>
#include <wx/menu.h>
#include <wx/panel.h>
#include <wx/srchctrl.h>
#include <wx/stattext.h>
#include <wx/textctrl.h>
#include <wx/textdlg.h>
@ -83,12 +84,11 @@ CCodeWindow::CCodeWindow(const SConfig& _LocalCoreStartupParameter, CFrame *pare
m_aui_toolbar = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORIZONTAL | wxAUI_TB_PLAIN_BACKGROUND);
wxTextCtrl* const address_textctrl = new wxTextCtrl(m_aui_toolbar, IDM_ADDRBOX);
address_textctrl->Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this);
wxSearchCtrl* const address_searchctrl = new wxSearchCtrl(m_aui_toolbar, IDM_ADDRBOX);
address_searchctrl->Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this);
address_searchctrl->SetDescriptiveText(_("Search Address"));
m_aui_toolbar->AddControl(new wxStaticText(m_aui_toolbar, wxID_ANY, _("Address Search:")));
m_aui_toolbar->AddSpacer(5);
m_aui_toolbar->AddControl(address_textctrl);
m_aui_toolbar->AddControl(address_searchctrl);
m_aui_toolbar->Realize();
m_aui_manager.SetManagedWindow(this);
@ -225,7 +225,7 @@ void CCodeWindow::OnCodeViewChange(wxCommandEvent &event)
void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event)
{
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)m_aui_toolbar->FindControl(IDM_ADDRBOX);
wxSearchCtrl* pAddrCtrl = (wxSearchCtrl*)m_aui_toolbar->FindControl(IDM_ADDRBOX);
// Trim leading and trailing whitespace.
wxString txt = pAddrCtrl->GetValue().Trim().Trim(false);