Add EnterPressed handled in UserDialog and Search (for description)

This commit is contained in:
2011-04-09 19:22:32 +02:00
parent 0e93b41bc7
commit 7533319ad4
4 changed files with 22 additions and 8 deletions

View File

@@ -19,7 +19,7 @@
#include "AccountPanel.h"
enum {SEARCH_ID, GRID_ID, CALENDAR_FROM_ID, CALENDAR_TO_ID,
enum {DESCRIPTION_ID=1, SEARCH_ID, GRID_ID, CALENDAR_FROM_ID, CALENDAR_TO_ID,
CHANGE_ACCOUNT_ID, CHANGE_CATEGORY_ID, RENAME_ID};
BEGIN_EVENT_TABLE(SearchPanel, wxPanel)
@@ -31,6 +31,7 @@ EVT_BUTTON(CHANGE_ACCOUNT_ID, SearchPanel::OnButtonChangeAccount)
EVT_BUTTON(CHANGE_CATEGORY_ID, SearchPanel::OnButtonChangeCategory)
EVT_BUTTON(RENAME_ID, SearchPanel::OnButtonRename)
EVT_SHOW(SearchPanel::OnShow)
EVT_TEXT_ENTER(DESCRIPTION_ID, SearchPanel::OnEnter)
END_EVENT_TABLE()
#define UNESCAPE_CHARS(s) { \
@@ -69,7 +70,8 @@ SearchPanel::SearchPanel(KissCount* kiss, wxUI *parent) : KissPanel(kiss, parent
wxCAL_MONDAY_FIRST);
_description = new wxTextCtrl(this, wxID_ANY);
_description = new wxTextCtrl(this, DESCRIPTION_ID);
_description->SetWindowStyle(_description->GetWindowStyle() | wxTE_PROCESS_ENTER);
wxSize size = _description->GetSize();
size.SetWidth(size.GetWidth()*2);
_description->SetMinSize(size);
@@ -261,6 +263,11 @@ void SearchPanel::Search()
_operations = _kiss->Search(description, dateFrom, dateTo, amountFrom, amountTo, categories,types, accounts);
}
void SearchPanel::OnEnter(wxCommandEvent& event)
{
OnButtonSearch(event);
}
void SearchPanel::OnButtonSearch(wxCommandEvent& event)
{
Search();