From dfe32d0cc58a2fe72c40c2ebe4babae2438f1032 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 27 Aug 2017 16:29:57 +0200 Subject: [PATCH 1/8] ignore cmake-build-debug/ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6580f35b..0972b5ae 100644 --- a/.gitignore +++ b/.gitignore @@ -39,6 +39,7 @@ lib/ *.ninja* CMakeCache.txt CMakeFiles/ +cmake-build-debug/ .idea/ cmake_install.cmake *.DS_Store From c94f69fde5497048370f33be0c3b87bffae1cf1b Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 27 Aug 2017 16:32:32 +0200 Subject: [PATCH 2/8] conveniently add include files to the project it make browsing files and navigating the code easier. /todo add all the other .h files --- build/vc2015/nana.vcxproj | 26 ++++++++++++ build/vc2015/nana.vcxproj.filters | 70 +++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+) diff --git a/build/vc2015/nana.vcxproj b/build/vc2015/nana.vcxproj index 9dd9c3bc..3ec4cf7d 100644 --- a/build/vc2015/nana.vcxproj +++ b/build/vc2015/nana.vcxproj @@ -252,6 +252,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/vc2015/nana.vcxproj.filters b/build/vc2015/nana.vcxproj.filters index 32f7afd6..d1d7ba78 100644 --- a/build/vc2015/nana.vcxproj.filters +++ b/build/vc2015/nana.vcxproj.filters @@ -292,4 +292,74 @@ Source Files\detail + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Header Files + + + Header Files + + \ No newline at end of file From 463ba5403fe2dff23d486f53fb5830551cf181dd Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Tue, 5 Sep 2017 00:14:05 +0200 Subject: [PATCH 3/8] RuntimeLibrary->MultiThreaded (/MT or /MTd) by default, static linked --- 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 18264f197451d03f9ec8d2bde93cb2a028a05447 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Tue, 5 Sep 2017 15:51:52 +0200 Subject: [PATCH 4/8] Manually-specified variables were not used by the project Forgot to clean this in: Commit: a68155c7d70c2e5d05acbd0ad30b96664d27d79f [a68155c7] Parents: 11bd0bcf88 Author: qPCR4vir Date: Montag, 27. Juni 2016 01:25:48 Build build demos separately. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4543e6b3..c80e2146 100644 --- a/.travis.yml +++ b/.travis.yml @@ -84,7 +84,7 @@ script: # we are in "... nana/../nana_lib/bin/" we need "../../nana" to get the CMakeList.txt of nana. # Thus, make install will put the nana.lib in "... nana/../nana_lib/lib/" # and the includes in "... nana/../nana_lib/include/" - - cmake -G"Unix Makefiles" ../../nana -DCMAKE_INSTALL_PREFIX=.. -DNANA_CMAKE_ENABLE_JPEG=ON -DNANA_CMAKE_ENABLE_PNG=OFF -DNANA_CMAKE_BUILD_DEMOS=ON -DNANA_CMAKE_ENABLE_AUDIO=OFF -DNANA_CMAKE_FIND_BOOST_FILESYSTEM=ON -DNANA_CMAKE_BOOST_FILESYSTEM_FORCE=OFF -DNANA_CMAKE_AUTOMATIC_GUI_TESTING=ON + - cmake -G"Unix Makefiles" ../../nana -DCMAKE_INSTALL_PREFIX=.. -DNANA_CMAKE_ENABLE_JPEG=ON -DNANA_CMAKE_ENABLE_PNG=OFF -DNANA_CMAKE_ENABLE_AUDIO=OFF -DNANA_CMAKE_FIND_BOOST_FILESYSTEM=ON -DNANA_CMAKE_BOOST_FILESYSTEM_FORCE=OFF -DNANA_CMAKE_AUTOMATIC_GUI_TESTING=ON - make install - ls - cd .. From 263776812e13c6d3baf92e696efa79e0cda67424 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Tue, 5 Sep 2017 15:53:43 +0200 Subject: [PATCH 5/8] git clone branch=hotfix-1.5/nana-demo in hotfix-1.5.4/nana travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c80e2146..9f6d3ed3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,7 +56,7 @@ matrix: - llvm-toolchain-precise before_install: - - git clone --depth=1 --branch=develop https://github.com/qPCR4vir/nana-demo.git ../nana-demo + - git clone --depth=1 --branch=hotfix-1.5 https://github.com/qPCR4vir/nana-demo.git ../nana-demo - export PATH="$HOME/bin:$PATH" #- mkdir ~/bin #it seemd that a bin already exists from 20170901 - wget --no-check-certificate --no-clobber -O /tmp/tools/cmake https://cmake.org/files/v3.4/cmake-3.4.0-rc3-Linux-x86_64.sh || true From 252b8cbf650eea663b35d6198e1127f6d8562cd3 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 7 Sep 2017 12:32:53 +0200 Subject: [PATCH 6/8] #if __has_include() --- include/nana/c++defines.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/nana/c++defines.hpp b/include/nana/c++defines.hpp index 4c7a244e..04b5113f 100644 --- a/include/nana/c++defines.hpp +++ b/include/nana/c++defines.hpp @@ -173,6 +173,7 @@ //Assume the std::thread is not implement on MinGW //But some toolchains may implement std::thread. +// it seems that MinGW 6.3 and 7.1 have std::thread #ifdef NANA_MINGW # ifndef STD_THREAD_NOT_SUPPORTED # define STD_THREAD_NOT_SUPPORTED @@ -220,6 +221,9 @@ # if __has_include() # undef STD_FILESYSTEM_NOT_SUPPORTED # endif +# if __has_include() +# undef STD_THREAD_NOT_SUPPORTED +# endif #endif #endif // NANA_CXX_DEFINES_INCLUDED From c13b66559498f60476abb5c96b7cfe74b536e743 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 7 Sep 2017 12:36:02 +0200 Subject: [PATCH 7/8] CLion cmake workaround --- CMakeLists.txt | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f89337e..0b6e1afe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ option(NANA_CMAKE_ENABLE_AUDIO "Enable class audio::play for PCM playback." OFF) option(NANA_CMAKE_VERBOSE_PREPROCESSOR "Show annoying debug messages during compilation." ON) option(NANA_CMAKE_STOP_VERBOSE_PREPROCESSOR "Stop compilation after showing the annoying debug messages." OFF) option(NANA_CMAKE_AUTOMATIC_GUI_TESTING "Activate automatic GUI testing?" OFF) +option(NANA_CLION "Activate some CLion specific workarounds" OFF) # The ISO C++ File System Technical Specification (ISO-TS, or STD) is optional. # http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf @@ -62,11 +63,12 @@ if(POLICY CMP0004) # ignore leading space cmake_policy(SET CMP0004 OLD) endif() +set(CMAKE_DEBUG_POSTFIX "_d") + ########### OS if(WIN32) add_definitions(-DWIN32) - set(CMAKE_DEBUG_POSTFIX "_d") #Global MSVC definitions. You may prefer the hand-tuned sln and projects from the nana repository. if(MSVC) option(MSVC_USE_MP "Set to ON to build nana with the /MP option (Visual Studio 2005 and above)." ON) @@ -121,10 +123,15 @@ endif(UNIX) ########### Compilers # # Using gcc: gcc 4.8 don't support C++14 and make_unique. You may want to update at least to 4.9. -# In Windows, the gcc which come with CLion was 4.8 from MinGW. You may want to install MinGW-w64 from the -# TDM-GCC Compiler Suite for Windows which will update you to gcc 5.1. # gcc 5.3 and 5.4 include filesytem, but you need to add the link flag: -lstdc++fs # +# In Windows, the gcc which come with CLion was 4.8 from MinGW. +# CLion was updated to MinGW with gcc 6.3 ? Allways check this in File/Settings.../toolchains +# You could install MinGW-w64 from the TDM-GCC Compiler Suite for Windows which will update you to gcc 5.1. +# It is posible to follow https://computingabdn.com/softech/mingw-howto-install-gcc-for-windows/ +# and install MinGW with gcc 7.1 with has STD_THREADS and fs, from: https://sourceforge.net/projects/mingw-w64/files/ +# +# # see at end of: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dynamic_or_shared.html if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # Clang || GNU @@ -275,8 +282,19 @@ target_link_libraries(${PROJECT_NAME} ${NANA_LINKS}) # Installing: the static "nana lib" will be in DESTDIR/CMAKE_INSTALL_PREFIX/lib/ # and the includes files "include/nana/" in DESTDIR/CMAKE_INSTALL_PREFIX/include/nana/ +# unfortunatelly install() is still ignored by CLion: +# https://intellij-support.jetbrains.com/hc/en-us/community/posts/205822949-CMake-install-isn-t-supported- install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) + +# http://stackoverflow.com/questions/33788729/how-do-i-get-clion-to-run-an-install-target +if(NANA_CLION) # the Clion IDE don't reconize the install target + add_custom_target(install_${PROJECT_NAME} + $(MAKE) install + DEPENDS ${PROJECT_NAME} + COMMENT "Installing ${PROJECT_NAME}") +endif() + message("The compiled Nana library will be installed in ${CMAKE_INSTALL_PREFIX}/lib") # Install the include directories too. if(NANA_CMAKE_INSTALL_INCLUDES) @@ -299,6 +317,9 @@ message ( "CMAKE_INSTALL_PREFIX = " ${CMAKE_INSTALL_PREFIX}) message ( "NANA_INCLUDE_DIR = " ${NANA_INCLUDE_DIR}) message ( "CMAKE_CURRENT_SOURCE_DIR= " ${CMAKE_CURRENT_SOURCE_DIR}) message ( "NANA_CMAKE_ENABLE_AUDIO = " ${NANA_CMAKE_ENABLE_AUDIO}) +message ( "NANA_CLION = " ${NANA_CLION}) +message ( "CMAKE_MAKE_PROGRAM = " ${CMAKE_MAKE_PROGRAM}) + message ( "NANA_CMAKE_FIND_BOOST_FILESYSTEM = " ${NANA_CMAKE_FIND_BOOST_FILESYSTEM}) message ( "NANA_CMAKE_BOOST_FILESYSTEM_FORCE = " ${NANA_CMAKE_BOOST_FILESYSTEM_FORCE}) message ( "NANA_CMAKE_BOOST_FILESYSTEM_INCLUDE_ROOT = " ${NANA_CMAKE_BOOST_FILESYSTEM_INCLUDE_ROOT}) From 3b454cc2c52504274fe397e902bedfdc0a20baa9 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 14 Sep 2017 19:39:56 +0200 Subject: [PATCH 8/8] minor doxygen changes --- include/nana/gui/widgets/detail/tree_cont.hpp | 6 ++-- include/nana/gui/widgets/treebox.hpp | 30 +++++++++++-------- source/gui/widgets/treebox.cpp | 8 +++-- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/include/nana/gui/widgets/detail/tree_cont.hpp b/include/nana/gui/widgets/detail/tree_cont.hpp index 2490ab95..3acbc6fa 100644 --- a/include/nana/gui/widgets/detail/tree_cont.hpp +++ b/include/nana/gui/widgets/detail/tree_cont.hpp @@ -1,12 +1,12 @@ -/* +/** * A Tree Container class implementation * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at + * (See accompanying file LICENSE or copy at * 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 diff --git a/include/nana/gui/widgets/treebox.hpp b/include/nana/gui/widgets/treebox.hpp index 1ddb448d..08548dd4 100644 --- a/include/nana/gui/widgets/treebox.hpp +++ b/include/nana/gui/widgets/treebox.hpp @@ -4,10 +4,10 @@ * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at + * (See accompanying file LICENSE or copy at * http://www.boost.org/LICENSE_1_0.txt) * - * @file: nana/gui/widgets/treebox.hpp + * @file nana/gui/widgets/treebox.hpp * @brief * The treebox organizes the nodes by a key string. * The treebox would have a vertical scrollbar if there are too many nodes @@ -344,7 +344,7 @@ namespace nana }//end namespace drawerbase /// \brief Displays a hierarchical list of items, such as the files and directories on a disk. - /// See also in [documentation](http://nanapro.org/en-us/help/widgets/treebox.htm) + /// See also in [documentation](http://nanapro.org/en-us/documentation/widgets/treebox.htm) class treebox :public widget_object < category::widget_tag, drawerbase::treebox::trigger, drawerbase::treebox::treebox_events> { @@ -372,7 +372,7 @@ namespace nana /// \brief The construct that creates a widget. /// @param wd A handle to the parent window of the widget being created. /// @param r the size and position of the widget in its parent window coordinate. - /// @param visible specifying the visible after creating. + /// @param visible specifying if visible after creating. treebox(window, const nana::rectangle& = rectangle(), bool visible = true); template @@ -397,18 +397,18 @@ namespace nana /// /// The treebox automatically redraws after certain operations, but, /// under some circumstances, it is good to disable the automatic drawing mode, - /// for example, before adding nodes in a loop, disable the mode to avoiding + /// for example, before adding nodes in a loop, disable the mode avoiding /// frequent and useless refresh for better performance, and then, after /// the operations, enable the automatic redraw mode again. - /// @param bool whether to enable. - void auto_draw(bool); + /// @param enable bool whether to enable. + void auto_draw(bool enable); /// \brief Enable the checkboxs for each item of the widget. - /// @param bool indicates whether to show or hide the checkboxs. + /// @param enable bool indicates whether to show or hide the checkboxs. treebox & checkable(bool enable); - bool checkable() const; ///< Determinte whether the checkboxs are enabled. + bool checkable() const; ///< Are the checkboxs are enabled? /// Clears the contents void clear(); @@ -424,26 +424,30 @@ namespace nana void icon_erase(const ::std::string& id); - item_proxy find(const ::std::string& keypath); ///< Find an item though a specified keypath. + item_proxy find(const ::std::string& keypath); ///< Find an item through a specified keypath. - /// Inserts a new node to treebox, but if the keypath exists returns the existing node. + /// Inserts a new node to treebox, but if the keypath exists change and returns the existing node. item_proxy insert(const ::std::string& path_key, ///< specifies the node hierarchy ::std::string title ///< used for displaying ); - /// Inserts a new node to treebox, but if the keypath exists returns the existing node. + /// Inserts a new node to treebox, but if the keypath exists change and returns the existing node. item_proxy insert( item_proxy pos, ///< the parent item node const ::std::string& key, ///< specifies the new node ::std::string title ///< title used for displaying in the new node. ); - item_proxy erase(item_proxy i); ///< Removes the node at pos and return the Item proxy following the removed node + + item_proxy erase(item_proxy i); ///< Removes the node at i and return the Item proxy following the removed node void erase(const ::std::string& keypath); ///< Removes the node by the key path. ::std::string make_key_path(item_proxy i, const ::std::string& splitter) const;/// #endif diff --git a/source/gui/widgets/treebox.cpp b/source/gui/widgets/treebox.cpp index 88468861..17696e53 100644 --- a/source/gui/widgets/treebox.cpp +++ b/source/gui/widgets/treebox.cpp @@ -1,13 +1,15 @@ -/* +/** * A Treebox Implementation * Nana C++ Library(http://www.nanapro.org) * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or copy at + * (See accompanying file LICENSE or copy at * http://www.boost.org/LICENSE_1_0.txt) * - * @file: nana/gui/widgets/treebox.cpp + * @file nana/gui/widgets/treebox.cpp + * @brief + * */ #include #include