fix issue that listbox scheme mouse_wheel.lines has no effect

This commit is contained in:
Jinhao 2017-11-01 11:57:52 +08:00
parent e5dc98bf4e
commit 0796c1540b
3 changed files with 11 additions and 8 deletions

View File

@ -1,12 +1,12 @@
/** /*
* A Tree Container class implementation * A Tree Container class implementation
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
* *
* Distributed under the Boost Software License, Version 1.0. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at * (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt) * http://www.boost.org/LICENSE_1_0.txt)
* *
* @file nana/gui/widgets/detail/tree_cont.hpp * @file: nana/gui/widgets/detail/tree_cont.hpp
*/ */
#ifndef NANA_GUI_WIDGETS_DETAIL_TREE_CONT_HPP #ifndef NANA_GUI_WIDGETS_DETAIL_TREE_CONT_HPP

View File

@ -3931,6 +3931,11 @@ namespace nana
essence_->content_view.reset(new widgets::skeletons::content_view{ widget.handle() }); essence_->content_view.reset(new widgets::skeletons::content_view{ widget.handle() });
essence_->resize_disp_area(); essence_->resize_disp_area();
//Set the content_view wheel speed with the listbox scheme.
essence_->content_view->set_wheel_speed([this] {
return essence_->scheme_ptr->mouse_wheel.lines;
});
essence_->content_view->events().hover_outside = [this](const point& cur_pos) { essence_->content_view->events().hover_outside = [this](const point& cur_pos) {
essence_->update_mouse_selection(cur_pos); essence_->update_mouse_selection(cur_pos);
}; };

View File

@ -1,15 +1,13 @@
/** /*
* A Treebox Implementation * A Treebox Implementation
* Nana C++ Library(http://www.nanapro.org) * Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
* *
* Distributed under the Boost Software License, Version 1.0. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE or copy at * (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt) * http://www.boost.org/LICENSE_1_0.txt)
* *
* @file nana/gui/widgets/treebox.cpp * @file: nana/gui/widgets/treebox.cpp
* @brief
*
*/ */
#include <nana/gui/widgets/treebox.hpp> #include <nana/gui/widgets/treebox.hpp>
#include <nana/gui/widgets/scroll.hpp> #include <nana/gui/widgets/scroll.hpp>