add a method to textbox

a method to get bounds of a text selection
This commit is contained in:
Jinhao
2016-09-12 00:01:12 +08:00
parent d6cb631bc2
commit 422f2c768b
4 changed files with 46 additions and 27 deletions

View File

@@ -469,6 +469,18 @@ namespace drawerbase {
API::update_window(*this);
}
std::pair<upoint, upoint> textbox::selection() const
{
std::pair<upoint, upoint> points;
internal_scope_guard lock;
auto editor = get_drawer_trigger().editor();
if (editor)
editor->get_select_points(points.first, points.second);
return points;
}
void textbox::copy() const
{
internal_scope_guard lock;