fix no response of Delete key
This commit is contained in:
parent
58b206cb93
commit
9a5dfe7f88
@ -157,7 +157,8 @@ namespace nana{ namespace widgets
|
|||||||
|
|
||||||
void set_accept(std::function<bool(char_type)>);
|
void set_accept(std::function<bool(char_type)>);
|
||||||
void set_accept(accepts);
|
void set_accept(accepts);
|
||||||
bool respone_keyboard(char_type);
|
bool respone_char(char_type);
|
||||||
|
bool respone_key(char_type);
|
||||||
|
|
||||||
void typeface_changed();
|
void typeface_changed();
|
||||||
|
|
||||||
@ -227,7 +228,6 @@ namespace nana{ namespace widgets
|
|||||||
void del();
|
void del();
|
||||||
void backspace(bool record_undo = true);
|
void backspace(bool record_undo = true);
|
||||||
void undo(bool reverse);
|
void undo(bool reverse);
|
||||||
bool move(nana::char_t);
|
|
||||||
void move_ns(bool to_north); //Moves up and down
|
void move_ns(bool to_north); //Moves up and down
|
||||||
void move_left();
|
void move_left();
|
||||||
void move_right();
|
void move_right();
|
||||||
|
|||||||
@ -677,6 +677,7 @@ namespace nana
|
|||||||
if(!drawer_->widget_ptr()->enabled())
|
if(!drawer_->widget_ptr()->enabled())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
bool call_other_keys = false;
|
||||||
if(drawer_->editable())
|
if(drawer_->editable())
|
||||||
{
|
{
|
||||||
bool is_move_up = false;
|
bool is_move_up = false;
|
||||||
@ -684,7 +685,7 @@ namespace nana
|
|||||||
{
|
{
|
||||||
case keyboard::os_arrow_left:
|
case keyboard::os_arrow_left:
|
||||||
case keyboard::os_arrow_right:
|
case keyboard::os_arrow_right:
|
||||||
drawer_->editor()->move(arg.key);
|
drawer_->editor()->respone_key(arg.key);
|
||||||
drawer_->editor()->reset_caret();
|
drawer_->editor()->reset_caret();
|
||||||
break;
|
break;
|
||||||
case keyboard::os_arrow_up:
|
case keyboard::os_arrow_up:
|
||||||
@ -692,6 +693,8 @@ namespace nana
|
|||||||
case keyboard::os_arrow_down:
|
case keyboard::os_arrow_down:
|
||||||
drawer_->move_items(is_move_up, true);
|
drawer_->move_items(is_move_up, true);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
call_other_keys = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -706,14 +709,19 @@ namespace nana
|
|||||||
case keyboard::os_arrow_down:
|
case keyboard::os_arrow_down:
|
||||||
drawer_->move_items(is_move_up, true);
|
drawer_->move_items(is_move_up, true);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
call_other_keys = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (call_other_keys)
|
||||||
|
drawer_->editor()->respone_key(arg.key);
|
||||||
|
|
||||||
API::lazy_refresh();
|
API::lazy_refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
void trigger::key_char(graph_reference graph, const arg_keyboard& arg)
|
void trigger::key_char(graph_reference graph, const arg_keyboard& arg)
|
||||||
{
|
{
|
||||||
if (drawer_->editor()->respone_keyboard(arg.key))
|
if (drawer_->editor()->respone_char(arg.key))
|
||||||
API::lazy_refresh();
|
API::lazy_refresh();
|
||||||
}
|
}
|
||||||
//end class trigger
|
//end class trigger
|
||||||
|
|||||||
@ -559,7 +559,7 @@ namespace nana
|
|||||||
|
|
||||||
void drawer::key_press(graph_reference, const arg_keyboard& arg)
|
void drawer::key_press(graph_reference, const arg_keyboard& arg)
|
||||||
{
|
{
|
||||||
if (impl_->editor()->move(arg.key))
|
if (impl_->editor()->respone_key(arg.key))
|
||||||
{
|
{
|
||||||
impl_->editor()->reset_caret();
|
impl_->editor()->reset_caret();
|
||||||
impl_->draw_spins();
|
impl_->draw_spins();
|
||||||
@ -569,7 +569,7 @@ namespace nana
|
|||||||
|
|
||||||
void drawer::key_char(graph_reference, const arg_keyboard& arg)
|
void drawer::key_char(graph_reference, const arg_keyboard& arg)
|
||||||
{
|
{
|
||||||
if (impl_->editor()->respone_keyboard(arg.key))
|
if (impl_->editor()->respone_char(arg.key))
|
||||||
{
|
{
|
||||||
if (!impl_->value(impl_->editor()->text()))
|
if (!impl_->value(impl_->editor()->text()))
|
||||||
impl_->draw_spins();
|
impl_->draw_spins();
|
||||||
|
|||||||
@ -136,7 +136,7 @@ namespace drawerbase {
|
|||||||
|
|
||||||
void drawer::key_press(graph_reference, const arg_keyboard& arg)
|
void drawer::key_press(graph_reference, const arg_keyboard& arg)
|
||||||
{
|
{
|
||||||
if(editor_->move(arg.key))
|
if(editor_->respone_key(arg.key))
|
||||||
{
|
{
|
||||||
editor_->reset_caret();
|
editor_->reset_caret();
|
||||||
API::lazy_refresh();
|
API::lazy_refresh();
|
||||||
@ -145,7 +145,7 @@ namespace drawerbase {
|
|||||||
|
|
||||||
void drawer::key_char(graph_reference, const arg_keyboard& arg)
|
void drawer::key_char(graph_reference, const arg_keyboard& arg)
|
||||||
{
|
{
|
||||||
if (editor_->respone_keyboard(arg.key))
|
if (editor_->respone_char(arg.key))
|
||||||
API::lazy_refresh();
|
API::lazy_refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user