diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index d5bb0607..86184718 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -1,7 +1,7 @@ /** * A List Box 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 @@ -1538,6 +1538,7 @@ the nana::detail::basic_window member pointer scheme void enable_single(bool for_selection, bool category_limited); void disable_single(bool for_selection); + bool is_single_enabled(bool for_selection) const noexcept; ///< Determines whether the single selection/check is enabled. export_options& def_export_options(); diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 0c797c57..d7789748 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -1850,6 +1850,11 @@ namespace nana (for_selection ? single_selection_ : single_check_) = false; } + bool is_single_enabled(bool for_selection) const noexcept + { + return (for_selection ? single_selection_ : single_check_); + } + size_type size_item(size_type cat) const { return get(cat)->items.size(); @@ -5959,9 +5964,16 @@ namespace nana void listbox::disable_single(bool for_selection) { + internal_scope_guard lock; _m_ess().lister.disable_single(for_selection); } + bool listbox::is_single_enabled(bool for_selection) const noexcept + { + internal_scope_guard lock; + return _m_ess().lister.is_single_enabled(for_selection); + } + listbox::export_options& listbox::def_export_options() { return _m_ess().def_exp_options;