3 * Text control with an history of commands typed
5 * Nicolas Boichat, July 2004
10 Copyright (C) 2004-2006 Kern Sibbald
12 This program is free software; you can redistribute it and/or
13 modify it under the terms of the GNU General Public License
14 version 2 as amended with additional clauses defined in the
15 file LICENSE in the main source directory.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 the file LICENSE for additional details.
24 #ifndef WXBHISTORYTEXTCTRL
25 #define WXBHISTORYTEXTCTRL
27 #include "wx/wxprec.h"
33 #include <wx/treectrl.h>
34 #include <wx/hashmap.h>
36 WX_DECLARE_STRING_HASH_MAP( wxString, wxbCommands );
38 class wxbHistoryTextCtrl: public wxTextCtrl {
40 wxbHistoryTextCtrl(wxStaticText* help, wxWindow* parent, wxWindowID id,
41 const wxString& value = wxT(""), const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 const wxValidator& validator = wxDefaultValidator,
44 const wxString& name = wxTextCtrlNameStr);
46 void HistoryAdd(wxString cmd);
48 void AddCommand(wxString cmd, wxString description);
49 void ClearCommandList();
51 virtual void SetValue(const wxString& value);
53 wxArrayString history;
58 void OnKeyUp(wxKeyEvent& event);
59 void OnKeyDown(wxKeyEvent& event);
61 DECLARE_EVENT_TABLE();
64 #endif //WXBHISTORYTEXTCTRL