fix textbox caret_pos issue

This commit is contained in:
Jinhao
2016-08-27 05:23:25 +08:00
parent 1fd0da7d79
commit b13f0a4ce5
3 changed files with 10 additions and 3 deletions

View File

@@ -1840,8 +1840,11 @@ namespace nana{ namespace widgets
//move_caret
//Set caret position through text coordinate
void text_editor::move_caret(const upoint& crtpos)
void text_editor::move_caret(const upoint& crtpos, bool reset_caret)
{
if (reset_caret)
points_.caret = crtpos;
if (!API::is_focus_ready(window_))
return;

View File

@@ -345,7 +345,7 @@ namespace drawerbase {
auto editor = get_drawer_trigger().editor();
internal_scope_guard lock;
if (editor)
editor->move_caret(pos);
editor->move_caret(pos, true);
return *this;
}