Added select_points method
This commit is contained in:
@@ -167,6 +167,8 @@ namespace nana{ namespace widgets
|
||||
|
||||
bool select(bool);
|
||||
|
||||
bool select_points(nana::upoint arg_a, nana::upoint arg_b);
|
||||
|
||||
/// Sets the end position of a selected string.
|
||||
void set_end_caret(bool stay_in_view);
|
||||
|
||||
|
||||
@@ -1865,6 +1865,15 @@ namespace nana{ namespace widgets
|
||||
return false;
|
||||
}
|
||||
|
||||
bool text_editor::select_points(nana::upoint arg_a, nana::upoint arg_b)
|
||||
{
|
||||
select_.a = arg_a;
|
||||
select_.b = arg_b;
|
||||
select_.mode_selection = selection::mode::method_selected;
|
||||
impl_->try_refresh = sync_graph::refresh;
|
||||
return true;
|
||||
}
|
||||
|
||||
void text_editor::set_end_caret(bool stay_in_view)
|
||||
{
|
||||
bool new_sel_end = (select_.b != points_.caret);
|
||||
|
||||
@@ -588,6 +588,15 @@ namespace drawerbase {
|
||||
API::refresh_window(*this);
|
||||
}
|
||||
|
||||
|
||||
void textbox::select_points(nana::upoint arg_a, nana::upoint arg_b)
|
||||
{
|
||||
auto editor = get_drawer_trigger().editor();
|
||||
internal_scope_guard lock;
|
||||
if (editor && editor->select_points(arg_a, arg_b))
|
||||
API::refresh_window(*this);
|
||||
}
|
||||
|
||||
std::pair<upoint, upoint> textbox::selection() const
|
||||
{
|
||||
std::pair<upoint, upoint> points;
|
||||
|
||||
Reference in New Issue
Block a user