Deselect textbox contents on mouse_down event.

Add the condition that textbox's content should be selected when it's focused with tabstop.
This commit is contained in:
beru 2015-05-21 04:15:20 +09:00
parent 9fc7d3e403
commit 8899cc870c
2 changed files with 13 additions and 2 deletions

View File

@ -1629,7 +1629,10 @@ namespace nana{ namespace widgets
select_.mode_selection = selection::mode_mouse_selected;
}
else
{
select(false);
select_.mode_selection = selection::mode_no_selected;
}
}
text_area_.border_renderer(graph_, _m_bgcolor());

View File

@ -15,6 +15,9 @@
#include <stdexcept>
#include <sstream>
#include <nana/gui/detail/bedrock.hpp>
#include <nana/gui/detail/inner_fwd_implement.hpp>
namespace nana
{
arg_textbox::arg_textbox(textbox& wdg)
@ -90,8 +93,13 @@ namespace drawerbase {
{
refresh(graph);
if (arg.getting) {
editor_->select(true);
editor_->move_caret_end();
static auto& brock = detail::bedrock::instance();
auto native_window = reinterpret_cast<native_window_type>(arg.receiver);
auto* root_runtime = brock.wd_manager.root_runtime(native_window);
if (root_runtime && root_runtime->condition.tabstop_focus_changed) {
editor_->select(true);
editor_->move_caret_end();
}
}
editor_->show_caret(arg.getting);
editor_->reset_caret();