a bool param to determines whether the caret move to end of text

This commit is contained in:
Jinhao
2016-05-10 15:52:06 +08:00
parent 79f484dd2e
commit df68cfa3ad
7 changed files with 61 additions and 35 deletions

View File

@@ -254,13 +254,14 @@ namespace drawerbase {
return *this;
}
textbox& textbox::reset(const std::string& str)
textbox& textbox::reset(const std::string& str, bool end_caret)
{
internal_scope_guard lock;
auto editor = get_drawer_trigger().editor();
if (editor)
{
editor->text(to_wstring(str));
{
editor->text(to_wstring(str), end_caret);
editor->textbase().reset();
API::update_window(this->handle());
}
@@ -622,7 +623,7 @@ namespace drawerbase {
auto editor = get_drawer_trigger().editor();
if (editor)
{
editor->text(to_wstring(str));
editor->text(to_wstring(str), false);
API::update_window(this->handle());
}
}