41 typedef std::vector<std::wstring> history_list;
47 std::wstring pre_history_text;
58 std::wstring::size_type curloc, startloc;
63 history_list *history;
65 history_list::size_type history_loc;
79 bool clear_on_first_edit;
81 void normalize_cursor();
86 int get_line_of_character(
size_t n,
int width);
91 int get_character_of_line(
size_t n,
int width);
99 wchar_t get_char(
size_t n);
102 size_t get_num_chars()
const {
return prompt.size() + text.size(); }
106 editline(
const std::wstring &_prompt,
107 const std::wstring &_text=L
"",
108 history_list *history=NULL);
111 editline(
const std::string &_prompt,
112 const std::string &_text=
"",
113 history_list *history=NULL);
115 editline(
int maxlength,
const std::wstring &_prompt,
116 const std::wstring &_text, history_list *history);
119 editline(
int maxlength,
const std::string &_prompt,
120 const std::string &_text, history_list *history);
124 create(
const std::wstring &prompt,
const std::wstring &text = L
"",
125 history_list *history = NULL)
133 create(
const std::string &prompt,
const std::string &text =
"",
134 history_list *history = NULL)
142 create(
int maxlength,
const std::wstring &prompt,
143 const std::wstring &text = L
"", history_list *history = NULL)
151 create(
int maxlength,
const std::string &prompt,
152 const std::string &text =
"", history_list *history = NULL)
171 clear_on_first_edit = value;
174 void set_allow_wrap(
bool allow) { allow_wrap = allow; }
175 bool get_allow_wrap()
const {
return allow_wrap; }
178 void paint(
const style &st);
179 void dispatch_mouse(
short id,
int x,
int y,
int z, mmask_t bstate);
181 sigc::signal1<void, std::wstring> entered;
183 sigc::signal1<void, std::wstring> text_changed;
186 std::wstring get_text() {
return text;}
187 void set_text(std::wstring _text);
192 void set_text(std::string _text);
194 bool get_cursorvisible();
195 point get_cursorloc();
198 int height_request(
int height);
200 static void add_to_history(std::wstring s,
201 history_list *history);
204 void add_to_history(std::wstring s);
205 void reset_history();
208 static void init_bindings();