From c05a11e6056ec3996a770b28edfc09e133b2819e Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Tue, 25 Jul 2017 22:30:25 +0200 Subject: [PATCH 1/7] doxy listbox --- include/nana/gui/widgets/listbox.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/nana/gui/widgets/listbox.hpp b/include/nana/gui/widgets/listbox.hpp index 6215d276..a4f3e91c 100644 --- a/include/nana/gui/widgets/listbox.hpp +++ b/include/nana/gui/widgets/listbox.hpp @@ -987,9 +987,13 @@ namespace nana cat_proxy(essence*, size_type pos) noexcept; cat_proxy(essence*, category_t*) noexcept; - /// Append an item at abs end of the category, set_value determines whether assign T object to the value of item. - template - item_proxy append(T&& t, bool set_value = false) + /// Append an item at the end of this category using the oresolver to generate the texts to be put in each column. + /// + /// First you have to make sure there is an overload of the operator<<() of the oresolver for the type of the object used here + /// If a listbox have a model set, try call append_model instead. + template + item_proxy append( T&& t, ///< Value used by the resolver to generate the texts to be put in each column of the item + bool set_value = false) ///< determines whether to set the object as the value of this item. { oresolver ores(ess_); @@ -1039,7 +1043,7 @@ namespace nana model_guard model(); - /// Appends one item at the end of this category with the specifies text in the column fields + /// Appends one item at the end of this category with the specifies texts in the column fields void append(std::initializer_list texts_utf8); void append(std::initializer_list texts); From 7446235f75babe0a899ee7dddf7cfa80a889b989 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Tue, 25 Jul 2017 22:31:06 +0200 Subject: [PATCH 2/7] project headers files --- build/vc2017/nana.vcxproj.filters | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/vc2017/nana.vcxproj.filters b/build/vc2017/nana.vcxproj.filters index ef973d0c..32582fdf 100644 --- a/build/vc2017/nana.vcxproj.filters +++ b/build/vc2017/nana.vcxproj.filters @@ -41,6 +41,9 @@ {c1cdf46a-519f-422a-947f-39e173045414} + + {d87c71b7-71e7-4221-953e-783325beffe4} + From 6d0a1ea9e0709880bf57eef2357f8a528d6ef1d9 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Tue, 25 Jul 2017 22:31:53 +0200 Subject: [PATCH 3/7] project RuntimeLibrary MultiThreadedDebug MT --- build/vc2017/nana.vcxproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/vc2017/nana.vcxproj b/build/vc2017/nana.vcxproj index 818d6cf8..7b457574 100644 --- a/build/vc2017/nana.vcxproj +++ b/build/vc2017/nana.vcxproj @@ -101,6 +101,7 @@ Level3 Disabled WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug Windows @@ -113,6 +114,7 @@ Level3 Disabled _DEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreadedDebug Windows @@ -127,6 +129,7 @@ true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreaded Windows @@ -143,6 +146,7 @@ true true NDEBUG;_LIB;%(PreprocessorDefinitions) + MultiThreaded Windows From 16f835e0834a87c3977998cf1d8197f53e6d7e56 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 3 Dec 2017 01:55:41 +0100 Subject: [PATCH 4/7] enable directory_iterator range-based for statements while using Boost --- include/nana/filesystem/filesystem.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/nana/filesystem/filesystem.hpp b/include/nana/filesystem/filesystem.hpp index 067586f5..40fc05de 100644 --- a/include/nana/filesystem/filesystem.hpp +++ b/include/nana/filesystem/filesystem.hpp @@ -75,6 +75,16 @@ namespace std { socket = boost::filesystem::file_type::socket_file, unknown = boost::filesystem::file_type::type_unknown, }; + /// enable directory_iterator range-based for statements + inline directory_iterator begin(directory_iterator iter) noexcept + { + return iter; + } + + inline directory_iterator end(const directory_iterator&) noexcept + { + return {}; + } } // filesystem } // experimental } // std From 5f947d5ec87fa8b3593b5e8597363d698b11a1cb Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 3 Dec 2017 01:57:27 +0100 Subject: [PATCH 5/7] convenient generic_u8string(path) as workaround Boost not having path.generic_u8string() - a good point for http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0251r0.pdf --- include/nana/filesystem/filesystem_ext.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/nana/filesystem/filesystem_ext.hpp b/include/nana/filesystem/filesystem_ext.hpp index 2c28acad..2ff6bece 100644 --- a/include/nana/filesystem/filesystem_ext.hpp +++ b/include/nana/filesystem/filesystem_ext.hpp @@ -34,6 +34,16 @@ namespace filesystem_ext std::experimental::filesystem::path path_user(); ///< extention ? +/// workaround Boost not having path.generic_u8string() - a good point for http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0251r0.pdf +inline std::string generic_u8string(const std::experimental::filesystem::path& p) +{ + #if NANA_USING_BOOST_FILESYSTEM + return nana::to_utf8(p.generic_wstring()); + #else + return p.generic_u8string(); + #endif +} + inline bool is_directory(const std::experimental::filesystem::directory_entry& dir) noexcept { return is_directory(dir.status()); From 504da0c1e6faca93538dfe7983c666ebcb85c895 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sat, 27 Jan 2018 01:11:12 +0100 Subject: [PATCH 6/7] =?UTF-8?q?FIX:=20error:=20=E2=80=98to=5Futf8=E2=80=99?= =?UTF-8?q?=20is=20not=20a=20member=20of=20=E2=80=98nana=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/nana/filesystem/filesystem_ext.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/nana/filesystem/filesystem_ext.hpp b/include/nana/filesystem/filesystem_ext.hpp index 2ff6bece..50f82f82 100644 --- a/include/nana/filesystem/filesystem_ext.hpp +++ b/include/nana/filesystem/filesystem_ext.hpp @@ -16,6 +16,8 @@ #define NANA_FILESYSTEM_EXT_HPP #include +#include + namespace nana { From 8f28ef26a08e826d0b0329fbe90258cb4e339506 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Mon, 29 Jan 2018 00:37:40 +0100 Subject: [PATCH 7/7] Fix: boost enable directory_iterator C++11 range-base for statement --- include/nana/filesystem/filesystem.hpp | 47 +++++++++++++++++++++----- 1 file changed, 39 insertions(+), 8 deletions(-) diff --git a/include/nana/filesystem/filesystem.hpp b/include/nana/filesystem/filesystem.hpp index 40fc05de..ab90a584 100644 --- a/include/nana/filesystem/filesystem.hpp +++ b/include/nana/filesystem/filesystem.hpp @@ -55,6 +55,37 @@ #define NANA_USING_BOOST_FILESYSTEM 1 # include # include +// dont include generic_u8string +// http://www.boost.org/doc/libs/1_66_0/boost/filesystem/path.hpp +// enable directory_iterator C++11 range-base for +// http://www.boost.org/doc/libs/1_66_0/boost/filesystem/operations.hpp +// but travis come with an oooold version of boost +// NOT enable directory_iterator C++11 range-base for +// http://www.boost.org/doc/libs/1_54_0/boost/filesystem/operations.hpp +namespace boost +{ + namespace filesystem + { + + // enable directory_iterator C++11 range-base for statement use --------------------// + + // begin() and end() are only used by a range-based for statement in the context of + // auto - thus the top-level const is stripped - so returning const is harmless and + // emphasizes begin() is just a pass through. + inline + const directory_iterator& begin(const directory_iterator& iter) BOOST_NOEXCEPT + { + return iter; + } + inline + directory_iterator end(const directory_iterator&) BOOST_NOEXCEPT + { + return directory_iterator(); + } + + } // namespace filesystem +} + // add boost::filesystem into std::experimental::filesystem namespace std { @@ -76,15 +107,15 @@ namespace std { unknown = boost::filesystem::file_type::type_unknown, }; /// enable directory_iterator range-based for statements - inline directory_iterator begin(directory_iterator iter) noexcept - { - return iter; - } + //inline directory_iterator begin(directory_iterator iter) noexcept + //{ + // return iter; + //} - inline directory_iterator end(const directory_iterator&) noexcept - { - return {}; - } + //inline directory_iterator end(const directory_iterator&) noexcept + //{ + // return {}; + //} } // filesystem } // experimental } // std