fix an issue that caret doesn't move when moving the parent widget.
This commit is contained in:
parent
bdf928a9e8
commit
d528b5c94d
@ -121,7 +121,6 @@ namespace nana{
|
||||
{
|
||||
core_window_t* pressed{nullptr}; //The handle to a window which is being pressed
|
||||
core_window_t* hovered{nullptr}; //the latest window that mouse moved
|
||||
bool tabstop_focus_changed{false}; //KeyDown may set it true, if it is true KeyChar will ignore the message
|
||||
}condition;
|
||||
|
||||
root_misc(core_window_t * wd, unsigned width, unsigned height)
|
||||
|
@ -1032,7 +1032,6 @@ namespace detail
|
||||
{
|
||||
brock.wd_manager.set_focus(the_next, false);
|
||||
brock.wd_manager.do_lazy_refresh(the_next, true);
|
||||
root_runtime->condition.tabstop_focus_changed = true;
|
||||
}
|
||||
}
|
||||
else if(keyboard::alt == keychar)
|
||||
@ -1081,6 +1080,7 @@ namespace detail
|
||||
break;
|
||||
}
|
||||
case XLookupChars:
|
||||
if (msgwnd->flags.enabled)
|
||||
{
|
||||
const ::nana::char_t* charbuf;
|
||||
#if defined(NANA_UNICODE)
|
||||
@ -1097,6 +1097,10 @@ namespace detail
|
||||
arg.ignore = false;
|
||||
arg.key = charbuf[i];
|
||||
|
||||
// When tab is pressed, only tab-eating mode is allowed
|
||||
if ((keyboard::tab == arg.key) && !(msgwnd->flags.tab & tab_type::eating))
|
||||
continue;
|
||||
|
||||
if(context.is_alt_pressed)
|
||||
{
|
||||
arg.ctrl = arg.shift = false;
|
||||
|
@ -1408,7 +1408,6 @@ namespace detail
|
||||
brock.wd_manager.set_focus(the_next, false);
|
||||
brock.wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
brock.wd_manager.do_lazy_refresh(the_next, true);
|
||||
root_runtime->condition.tabstop_focus_changed = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1437,9 +1436,10 @@ namespace detail
|
||||
break;
|
||||
case WM_CHAR:
|
||||
msgwnd = brock.focus();
|
||||
if(false == root_runtime->condition.tabstop_focus_changed)
|
||||
if (msgwnd && msgwnd->flags.enabled)
|
||||
{
|
||||
if(msgwnd && msgwnd->flags.enabled)
|
||||
// When tab is pressed, only tab-eating mode is allowed
|
||||
if ((9 != wParam) || (msgwnd->flags.tab & tab_type::eating))
|
||||
{
|
||||
arg_keyboard arg;
|
||||
arg.evt_code = event_code::key_char;
|
||||
@ -1455,8 +1455,6 @@ namespace detail
|
||||
brock.wd_manager.do_lazy_refresh(msgwnd, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
root_runtime->condition.tabstop_focus_changed = false;
|
||||
return 0;
|
||||
case WM_KEYUP:
|
||||
if(wParam != 18) //MUST NOT BE AN ALT
|
||||
|
@ -493,9 +493,6 @@ namespace detail
|
||||
wd->pos_owner.y = y;
|
||||
_m_move_core(wd, delta);
|
||||
|
||||
if(wd->together.caret && wd->together.caret->visible())
|
||||
wd->together.caret->update();
|
||||
|
||||
auto &brock = bedrock::instance();
|
||||
arg_move arg;
|
||||
arg.window_handle = reinterpret_cast<window>(wd);
|
||||
@ -522,7 +519,7 @@ namespace detail
|
||||
auto & brock = bedrock::instance();
|
||||
bool moved = false;
|
||||
const bool size_changed = (r.width != wd->dimension.width || r.height != wd->dimension.height);
|
||||
if(wd->other.category != category::root_tag::value)
|
||||
if(category::flags::root != wd->other.category)
|
||||
{
|
||||
//Move child widgets
|
||||
if(r.x != wd->pos_owner.x || r.y != wd->pos_owner.y)
|
||||
@ -533,9 +530,6 @@ namespace detail
|
||||
_m_move_core(wd, delta);
|
||||
moved = true;
|
||||
|
||||
if(wd->together.caret && wd->together.caret->visible())
|
||||
wd->together.caret->update();
|
||||
|
||||
arg_move arg;
|
||||
arg.window_handle = reinterpret_cast<window>(wd);
|
||||
arg.x = r.x;
|
||||
@ -1425,7 +1419,12 @@ namespace detail
|
||||
if(wd->other.category != category::root_tag::value) //A root widget always starts at (0, 0) and its childs are not to be changed
|
||||
{
|
||||
wd->pos_root += delta;
|
||||
if(wd->other.category == category::frame_tag::value)
|
||||
if (category::flags::frame != wd->other.category)
|
||||
{
|
||||
if (wd->together.caret && wd->together.caret->visible())
|
||||
wd->together.caret->update();
|
||||
}
|
||||
else
|
||||
native_interface::move_window(wd->other.attribute.frame->container, wd->pos_root.x, wd->pos_root.y);
|
||||
|
||||
for (auto child : wd->children)
|
||||
|
@ -1482,6 +1482,8 @@ namespace nana{ namespace widgets
|
||||
|
||||
behavior_->pre_calc_lines(width_pixels());
|
||||
_m_scrollbar();
|
||||
|
||||
move_caret(points_.caret);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user