filter out the middle and right button for item selection(#413)

This commit is contained in:
Jinhao 2019-04-10 00:41:04 +08:00
parent a4c3784efe
commit d931ebb61c
2 changed files with 10 additions and 6 deletions

View File

@ -1,7 +1,7 @@
/*
* A Combox Implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2019 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@ -676,6 +676,9 @@ namespace nana
{
auto * editor = drawer_->editor();
editor->mouse_pressed(arg);
//Pops up the droplist only if left button is clicked
if(arg.is_left_button())
drawer_->open_lister_if_push_button_positioned();
drawer_->draw();

View File

@ -1,6 +1,6 @@
/*
* A Tabbar Implementation
* Copyright(C) 2003-2018 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2003-2019 Jinhao(cnjinhao@hotmail.com)
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
@ -1291,7 +1291,8 @@ namespace nana
void trigger::mouse_down(graph_reference, const arg_mouse& arg)
{
if(layouter_->press())
//Activates the tab only if left button is clicked.
if(arg.is_left_button() && layouter_->press())
{
if(false == layouter_->active_by_trace(arg))
layouter_->toolbox_answer(arg);
@ -1593,10 +1594,10 @@ namespace nana
API::dev::lazy_refresh();
}
void driver::mouse_down(graph_reference graph, const arg_mouse&)
void driver::mouse_down(graph_reference graph, const arg_mouse& arg)
{
auto & indexes = model_->get_indexes();
if ((indexes.hovered_pos == model_->npos) || (indexes.active_pos == indexes.hovered_pos))
if ((indexes.hovered_pos == model_->npos) || (indexes.active_pos == indexes.hovered_pos) || !arg.is_left_button())
return;
if (indexes.active_pos != indexes.hovered_pos)