add a method to show caret for the uneditable textbox

When an uneditable textbox has a caret, user can select the text and copy
it.
This commit is contained in:
Jinhao
2016-09-03 07:46:43 +08:00
parent 0f951d6b3e
commit d6cb631bc2
6 changed files with 41 additions and 16 deletions

View File

@@ -415,7 +415,16 @@ namespace drawerbase {
internal_scope_guard lock;
auto editor = get_drawer_trigger().editor();
if(editor)
editor->editable(able);
editor->editable(able, false);
return *this;
}
textbox& textbox::enable_caret()
{
internal_scope_guard lock;
auto editor = get_drawer_trigger().editor();
if (editor)
editor->editable(editor->attr().editable, true);
return *this;
}