From d362f031dd5d318f5e2d4f61017f12dbd70b7b53 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Wed, 11 Sep 2019 18:48:14 +0200 Subject: [PATCH 01/11] listbox header: ignore auto_draw ?? changing column visibility - too slow. --- source/gui/widgets/listbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 1439964b..d9561985 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -2909,7 +2909,7 @@ namespace nana //es_header::column member functions void es_header::column::_m_refresh() noexcept { - ess_->update(true); + ess_->update(false); } size_type es_header::column::position(bool disp_order) const noexcept From 0345d503baf047bf0c07caddb9ad353bc89041eb Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Wed, 11 Sep 2019 18:49:23 +0200 Subject: [PATCH 02/11] add parameter name --- include/nana/gui/widgets/button.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/nana/gui/widgets/button.hpp b/include/nana/gui/widgets/button.hpp index 5dc4b9b4..f67d2718 100644 --- a/include/nana/gui/widgets/button.hpp +++ b/include/nana/gui/widgets/button.hpp @@ -87,10 +87,10 @@ namespace nana{ typedef widget_object base_type; public: button(); - button(window, bool visible); - button(window, const ::std::string& caption, bool visible = true); - button(window, const char* caption, bool visible = true); - button(window, const nana::rectangle& = rectangle(), bool visible = true); + button(window parent, bool visible); + button(window parent, const ::std::string& caption, bool visible = true); + button(window parent, const char* caption, bool visible = true); + button(window parent, const nana::rectangle& = rectangle(), bool visible = true); /// Shows an icon in front of caption /** From 514ebaf4260f39e7bfd320c2ff3928f73cd22a51 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 5 Dec 2019 13:03:09 +0100 Subject: [PATCH 03/11] FIX #469, #492 ? --- build/cmake/shared_libs.cmake | 4 ++-- source/paint/image.cpp | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/build/cmake/shared_libs.cmake b/build/cmake/shared_libs.cmake index 85e4a706..a158317d 100644 --- a/build/cmake/shared_libs.cmake +++ b/build/cmake/shared_libs.cmake @@ -39,8 +39,8 @@ endif() if(NANA_STATIC_STDLIB) target_link_libraries(nana PUBLIC - $<$:-static-libgcc> - $<$:-static-libstdc++> + $<$:-static-libgcc -static-libstdc++> + $<$:-static-libgcc -static-libstdc++> ) endif() diff --git a/source/paint/image.cpp b/source/paint/image.cpp index 857c31f7..389ed68e 100644 --- a/source/paint/image.cpp +++ b/source/paint/image.cpp @@ -1,4 +1,4 @@ -/* +/** * Paint Image Implementation * Nana C++ Library(http://www.nanapro.org) * Copyright(C) 2003-2019 Jinhao(cnjinhao@hotmail.com) @@ -7,9 +7,8 @@ * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * - * @file: nana/paint/image.cpp - * @contributors: - * nabijaczleweli(pr#106) + * @file nana/paint/image.cpp + * @contributors nabijaczleweli(pr#106) */ #include From 55c9ce790d612366159a03690da2609e2e7b23fc Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 5 Dec 2019 13:17:20 +0100 Subject: [PATCH 04/11] update travis --- .travis.yml | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 82e8fd42..d3056da8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,8 +43,12 @@ matrix: - llvm-toolchain-precise before_install: + # donwload nana-demo first + # we are in: 'user'/nana/ - cd .. - - git clone --depth=1 --branch=hotfix https://github.com/qPCR4vir/nana-demo.git nana-demo + # we are in: 'user'/ + - git clone --depth=1 --branch=master https://github.com/qPCR4vir/nana-demo.git nana-demo + # now we have 'user'/nana-demo, 'user'/nana/ and we are in: 'user'/ - export PATH="$HOME/bin:$PATH" - wget --no-check-certificate --no-clobber -O /tmp/tools/cmake https://cmake.org/files/v3.12/cmake-3.12.0-rc3-Linux-x86_64.sh || true - chmod -R +x /tmp/tools @@ -53,22 +57,24 @@ install: - /tmp/tools/cmake --prefix="$HOME" --exclude-subdir before_script : - # we have: qPCR4vir/nana/../nana-demo and now we are in: qPCR4vir/nana/ our executable tests will access: ../nana-demo/Examples/*.bmp etc.(need to be in parallel with nana-demo/Examples) - #- cd ../nana-demo - - mkdir demo-build + - mkdir demo-build - cd demo-build + # now we have 'user'/nana-demo, 'user'/nana/ , 'user'/demo-build/ and we are in: 'user'/demo-build/ services: - - # travis don't have a physical monitor. We need to install an emulator: https://docs.travis-ci.com/user/gui-and-headless-browsers/ + # travis don't have a physical monitor. We need to install an emulator: + # https://docs.travis-ci.com/user/gui-and-headless-browsers/ - xvfb script: - cmake -G"Unix Makefiles" ../nana-demo -DCMAKE_INSTALL_PREFIX=.. -DNANA_CMAKE_ENABLE_JPEG=ON -DNANA_CMAKE_FIND_BOOST_FILESYSTEM=OFF -DNANA_CMAKE_AUTOMATIC_GUI_TESTING=ON -DNANA_CMAKE_INSTALL=OFF - make install + # we have installed in 'user'/ ('user'/demo-build/..), and cmake created 'user'/nana-test/ # todo: separate resources from sources (a directory for images) - ls + # we were still in: 'user'/demo-build/ - cd ../nana-test/bin - - ls + - ls -lh - ./a_group_impl - ./animate-bmp - ./audio_player @@ -107,22 +113,21 @@ script: - ./menu_debug #- ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1736 #- ./MontiHall # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1775 - #- ./helloworld_demo # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1786 + - ./helloworld_demo + # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1786 #- ./notepad # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1799 - - ./menu_debug - - ./menu_popuper - #- ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1846 + - ./menu_popuper #- ./widget_show2 # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1730 #- ./widget_show # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1740 - ./place_login - ./png #- ./screen # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1909 - - ./stretch_image - #- ./threading # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1826 ? - #- ./thread-pool # https://travis-ci.org/qPCR4vir/nana/jobs/140247564#L1782 + - ./stretch_image + - ./textbox_line_number + - ./threading # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1826 ? + - ./thread-pool # https://travis-ci.org/qPCR4vir/nana/jobs/140247564#L1782 - ./various_events #- ./window-dragger # https://travis-ci.org/qPCR4vir/nana/jobs/140245438#L1820 - ./windows-subclassing - - ./textbox_line_number From 08a1aba80181a97f5ad18099676dc3e8fe3bffdf Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 5 Dec 2019 13:53:18 +0100 Subject: [PATCH 05/11] update travis just align --- .travis.yml | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3056da8..6b0160be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,7 +79,7 @@ script: - ./animate-bmp - ./audio_player - ./background-effects - #- ./calculator # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1159 + #- ./calculator # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1159 - ./categ - ./clicked - ./decore @@ -87,13 +87,13 @@ script: - ./drag-button - ./draw - ./file_explorer - #- ./example_menu # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1348 + #- ./example_menu # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1348 - ./example_listbox - #- ./example_combox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1378 + #- ./example_combox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1378 - ./example.button - #- ./filebox-txt # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1393 + #- ./filebox-txt # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1393 - ./folder_tree - #- ./folder_tree_nana # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1408 + #- ./folder_tree_nana # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1408 #- ./folder_tree_std # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1421 - ./framework_design_1 - ./framework_design_2 @@ -101,33 +101,32 @@ script: - ./group - ./HelloWord #- ./helloword_quit # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1572 - #- ./inputbox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1585 + #- ./inputbox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1585 - ./label_listener - ./lambda_event.Cpp11 - ./listbox_inline_widget - ./listbox_Resolver - ./loader_1 - #- ./loader_2 # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1732 + #- ./loader_2 # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1732 - ./mbox - ./main - ./menu_debug - #- ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1736 - #- ./MontiHall # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1775 - - ./helloworld_demo - # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1786 - #- ./notepad # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1799 + #- ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1736 + #- ./MontiHall # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1775 + - ./helloworld_demo # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1786 + #- ./notepad # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1799 - ./menu_popuper - #- ./widget_show2 # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1730 - #- ./widget_show # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1740 + #- ./widget_show2 # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1730 + #- ./widget_show # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1740 - ./place_login - ./png - #- ./screen # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1909 + #- ./screen # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1909 - ./stretch_image - ./textbox_line_number - - ./threading # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1826 ? - - ./thread-pool # https://travis-ci.org/qPCR4vir/nana/jobs/140247564#L1782 + - ./threading # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1826 ? + - ./thread-pool # https://travis-ci.org/qPCR4vir/nana/jobs/140247564#L1782 - ./various_events - #- ./window-dragger # https://travis-ci.org/qPCR4vir/nana/jobs/140245438#L1820 + #- ./window-dragger # https://travis-ci.org/qPCR4vir/nana/jobs/140245438#L1820 - ./windows-subclassing From 5d147f6849e2ca7c2ebd51e25a5fe89c7a658a36 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 5 Dec 2019 13:54:23 +0100 Subject: [PATCH 06/11] update travis run all? tests --- .travis.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b0160be..93e15f9e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,7 +79,7 @@ script: - ./animate-bmp - ./audio_player - ./background-effects - #- ./calculator # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1159 + - ./calculator # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1159 - ./categ - ./clicked - ./decore @@ -87,46 +87,46 @@ script: - ./drag-button - ./draw - ./file_explorer - #- ./example_menu # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1348 + - ./example_menu # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1348 - ./example_listbox - #- ./example_combox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1378 + - ./example_combox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1378 - ./example.button - #- ./filebox-txt # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1393 + - ./filebox-txt # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1393 - ./folder_tree - #- ./folder_tree_nana # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1408 - #- ./folder_tree_std # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1421 + - ./folder_tree_nana # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1408 + - ./folder_tree_std # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1421 - ./framework_design_1 - ./framework_design_2 - ./framework_design_3 - ./group - ./HelloWord - #- ./helloword_quit # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1572 - #- ./inputbox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1585 + - ./helloword_quit # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1572 + - ./inputbox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1585 - ./label_listener - ./lambda_event.Cpp11 - ./listbox_inline_widget - ./listbox_Resolver - ./loader_1 - #- ./loader_2 # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1732 + - ./loader_2 # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1732 - ./mbox - ./main - ./menu_debug - #- ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1736 - #- ./MontiHall # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1775 + - ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1736 + - ./MontiHall # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1775 - ./helloworld_demo # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1786 - #- ./notepad # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1799 + - ./notepad # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1799 - ./menu_popuper - #- ./widget_show2 # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1730 - #- ./widget_show # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1740 + - ./widget_show2 # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1730 + - ./widget_show # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1740 - ./place_login - ./png - #- ./screen # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1909 + - ./screen # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1909 - ./stretch_image - ./textbox_line_number - ./threading # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1826 ? - ./thread-pool # https://travis-ci.org/qPCR4vir/nana/jobs/140247564#L1782 - ./various_events - #- ./window-dragger # https://travis-ci.org/qPCR4vir/nana/jobs/140245438#L1820 + - ./window-dragger # https://travis-ci.org/qPCR4vir/nana/jobs/140245438#L1820 - ./windows-subclassing From 357e8ccd730fb568dd3fcd0f2209cab3d7aed84b Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 5 Dec 2019 14:28:40 +0100 Subject: [PATCH 07/11] travis run calculator 2+2=4 !! --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 93e15f9e..94062da2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -79,7 +79,7 @@ script: - ./animate-bmp - ./audio_player - ./background-effects - - ./calculator # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1159 + - ./calculator # COOL !!! https://travis-ci.org/qPCR4vir/nana/builds/621103509#L924 - ./categ - ./clicked - ./decore @@ -87,11 +87,11 @@ script: - ./drag-button - ./draw - ./file_explorer - - ./example_menu # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1348 + - ./example_menu # OK ! https://travis-ci.org/qPCR4vir/nana/builds/621103509#L1022 - ./example_listbox - - ./example_combox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1378 + - ./example_combox # OK ! https://travis-ci.org/qPCR4vir/nana/builds/621103509#L1044 - ./example.button - - ./filebox-txt # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1393 + # - ./filebox-txt # https://travis-ci.org/qPCR4vir/nana/builds/621103509#L1068 - ./folder_tree - ./folder_tree_nana # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1408 - ./folder_tree_std # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1421 From 3c4848d31a784a5f22ff86389803710441954b42 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Thu, 5 Dec 2019 15:10:36 +0100 Subject: [PATCH 08/11] deprecated example --- .travis.yml | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 94062da2..e0b80b04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -92,41 +92,40 @@ script: - ./example_combox # OK ! https://travis-ci.org/qPCR4vir/nana/builds/621103509#L1044 - ./example.button # - ./filebox-txt # https://travis-ci.org/qPCR4vir/nana/builds/621103509#L1068 - - ./folder_tree - - ./folder_tree_nana # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1408 - - ./folder_tree_std # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1421 + - ./folder_tree_nana # todo failed https://travis-ci.org/qPCR4vir/nana/builds/621116812#L1193 + - ./folder_tree_std # todo failed https://travis-ci.org/qPCR4vir/nana/builds/621116812#L1200 - ./framework_design_1 - ./framework_design_2 - ./framework_design_3 - ./group - ./HelloWord - - ./helloword_quit # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1572 - - ./inputbox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1585 + - ./helloword_quit # ok + - ./inputbox # ok - ./label_listener - ./lambda_event.Cpp11 - ./listbox_inline_widget - ./listbox_Resolver - ./loader_1 - - ./loader_2 # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1732 + - ./loader_2 # ok - ./mbox - ./main - ./menu_debug - - ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1736 - - ./MontiHall # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1775 - - ./helloworld_demo # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1786 - - ./notepad # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1799 + - ./modal_form # ok + - ./MontiHall # ok + - ./helloworld_demo # ok + - ./notepad # ok !! - ./menu_popuper - - ./widget_show2 # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1730 - - ./widget_show # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1740 + - ./widget_show2 # ok !! + - ./widget_show # ok !! - ./place_login - ./png - - ./screen # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1909 + - ./screen # ok - ./stretch_image - ./textbox_line_number - - ./threading # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1826 ? - - ./thread-pool # https://travis-ci.org/qPCR4vir/nana/jobs/140247564#L1782 + - ./threading # ok + - ./thread-pool # ok - ./various_events - - ./window-dragger # https://travis-ci.org/qPCR4vir/nana/jobs/140245438#L1820 + - ./window-dragger # ok - ./windows-subclassing From f88224766d73e6f9bdc3ee53297c9454f9ece163 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Fri, 6 Dec 2019 01:27:58 +0100 Subject: [PATCH 09/11] doxy comments, void form::div(std::string div_text); --- include/nana/gui/programming_interface.hpp | 2 +- include/nana/gui/widgets/form.hpp | 31 +++++++++++++--------- source/gui/widgets/form.cpp | 6 ++--- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/include/nana/gui/programming_interface.hpp b/include/nana/gui/programming_interface.hpp index 9c463521..c35e161b 100644 --- a/include/nana/gui/programming_interface.hpp +++ b/include/nana/gui/programming_interface.hpp @@ -395,7 +395,7 @@ namespace API /// Blocks the execution and other windows' messages until the specified window is closed. void modal_window(window); - /// Blocks the execution until the specified window is closesd. + /// Blocks the execution until the specified window is closed. void wait_for(window); color fgcolor(window); diff --git a/include/nana/gui/widgets/form.hpp b/include/nana/gui/widgets/form.hpp index 65f4572e..652bd9ce 100644 --- a/include/nana/gui/widgets/form.hpp +++ b/include/nana/gui/widgets/form.hpp @@ -1,13 +1,13 @@ /** * A Form 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 * http://www.boost.org/LICENSE_1_0.txt) * - * @file: nana/gui/widgets/form.hpp + * @file nana/gui/widgets/form.hpp */ #ifndef NANA_GUI_WIDGET_FORM_HPP @@ -42,7 +42,7 @@ namespace nana //place methods place & get_place(); - void div(const char* div_text); + void div(std::string div_text); place::field_reference operator[](const char* field_name); void collocate() noexcept; private: @@ -51,23 +51,30 @@ namespace nana }//end namespace form }//end namespace drawerbase - /// \brief Pop-up window. Is different from other window widgets: its default constructor creates the window. + /// The form widget represents a popup window. + /// + /// Overall it is a root widget (\see: Overview of widgets) which attaches the OS/Windowing system's native window. + /// It is different from other window widgets in that its default constructor creates the window. /// \see nana::appearance class form : public drawerbase::form::form_base { public: + /// helper template class for creating the appearance of the form. using appear = ::nana::appear; - /// Creates a window at the point and size specified by rect, and with the specified appearance. Creates a form owned by the desktop. - form(const rectangle& = API::make_center(300, 200), const appearance& = {}); //Default constructor - form(const form&, const ::nana::size& = { 300, 200 }, const appearance& = {}); //Copy constructor - form(window, const ::nana::size& = { 300, 200 }, const appearance& = {}); - /// Creates a window at the point and size specified by rect, with the specified appearance. This window is always floating above its owner. - form(window, const rectangle&, const appearance& = {}); + /// Creates a window form owned by the desktop, at the point and size specified by rect, and with the specified appearance. + explicit form(const rectangle& = API::make_center(300, 200), const appearance& = {}); //Default constructor + /// Creates a window always floating above its owner at the point and size specified by rect, with the specified appearance. This window is always floating above its owner. + explicit form(window owner, const ::nana::size& = { 300, 200 }, const appearance& = {}); + explicit form(window owner, const rectangle&, const appearance& = {}); + form(const form&, const ::nana::size& = { 300, 200 }, const appearance& = {}); //Copy constructor - void modality() const; - void wait_for_this(); + /// Blocks the execution and other windows' messages until this window is closed. + void modality() const; + + /// Blocks the execution until this window is closed. + void wait_for_this(); void keyboard_accelerator(const accel_key&, const std::function& fn); }; diff --git a/source/gui/widgets/form.cpp b/source/gui/widgets/form.cpp index 9414a07b..1a2814cc 100644 --- a/source/gui/widgets/form.cpp +++ b/source/gui/widgets/form.cpp @@ -39,7 +39,7 @@ namespace nana place & form_base::get_place() { if (this->empty()) - throw std::runtime_error("form::get_plac: the form has destroyed."); + throw std::runtime_error("form::get_place(): the form has been destroyed."); if (!place_) place_.reset(new place{ *this }); @@ -47,9 +47,9 @@ namespace nana return *place_; } - void form_base::div(const char* div_text) + void form_base::div(std::string div_text) { - get_place().div(div_text); + get_place().div(std::move(div_text)); } place::field_reference form_base::operator[](const char* field_name) From 538c91ebcf32995abf115e82e74295eae2d98646 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 8 Dec 2019 11:34:01 +0100 Subject: [PATCH 10/11] comments --- build/cmake/select_filesystem.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/cmake/select_filesystem.cmake b/build/cmake/select_filesystem.cmake index a4729484..8dfcda21 100644 --- a/build/cmake/select_filesystem.cmake +++ b/build/cmake/select_filesystem.cmake @@ -1,12 +1,12 @@ # The ISO C++ File System Technical Specification (ISO-TS, or STD) was optional. # http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf # It is part of c++17. -# The library may be not available or working correctly in the std library you use. As a workaround we may try -# to "implement" it (ab)using Boost (almost compatible) +# The library may be not available or working correctly in the std library you use. +# As a workaround we will use Nana own partial, but functional implementation. +# You may opt to try to "implement" the std filesystem it (ab)using Boost (almost compatible) # http://www.boost.org/doc/libs/1_60_0/libs/filesystem/doc/index.htm -# or you can choose to use the (partial, but functional) implementation provided by nana. -# If you include the file or -# the selected option will be inlined by nana into std::filesystem +# By ncluding the file or +# the selected option is inlined by nana into std::filesystem. # By default Nana will try to use the STD. If STD is not available Nana own implementation will be used. # You can change that default if you change one of the following # (please don't define more than one of the _XX_FORCE options): From f0fa70d51c1f35af72b28462903be97bbabb2500 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 8 Dec 2019 18:32:47 +0100 Subject: [PATCH 11/11] explicit fs tests, no c++ separate test --- CMakeLists.txt | 1 + build/cmake/select_filesystem.cmake | 155 +++++++++++++++++----------- 2 files changed, 93 insertions(+), 63 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7d0167a..d0b3e008 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ project(nana VERSION 1.7.2 add_library(nana) add_library(nana::nana ALIAS nana) target_compile_features(nana PUBLIC cxx_std_17) +# set(CMAKE_CXX_STANDARD 17) # need after cxx_std_14 or cxx_std_17 ?? target_compile_features(nana diff --git a/build/cmake/select_filesystem.cmake b/build/cmake/select_filesystem.cmake index 8dfcda21..8b2acf1d 100644 --- a/build/cmake/select_filesystem.cmake +++ b/build/cmake/select_filesystem.cmake @@ -55,8 +55,6 @@ else() endif() check_include_file_cxx (filesystem NANA_HAVE_FILESYSTEM) - check_include_file_cxx (experimental/filesystem NANA_HAVE_EXP_FILESYSTEM) - if (NANA_HAVE_FILESYSTEM) message (STATUS "C++ Filesystem header: ") set (TEST_FS_LIB ON) @@ -67,21 +65,24 @@ else() std::filesystem::path p{\"\tmp/\"}; throw std::filesystem::filesystem_error(\"Empty file name!\", std::make_error_code(std::errc::invalid_argument)); }") - elseif (NANA_HAVE_EXP_FILESYSTEM) - message (STATUS "C++ Filesystem header: ") - set (TEST_FS_LIB ON) - set (CXXSTD_FS_TEST_SOURCE - "#include - int main() - { - std::experimental::filesystem::path p{\"/tmp/\"}; - throw std::experimental::filesystem::filesystem_error(\"Empty file name!\", std::make_error_code(std::errc::invalid_argument)); - }") - else () - message (WARNING "No std::filesystem include file found: nana::filesystem will be used. - Set NANA_CMAKE_NANA_FILESYSTEM_FORCE to ON to avoid this warning.") - target_compile_definitions(nana PUBLIC STD_FILESYSTEM_NOT_SUPPORTED) - set (TEST_FS_LIB OFF) + else() + check_include_file_cxx (experimental/filesystem NANA_HAVE_EXP_FILESYSTEM) + if (NANA_HAVE_EXP_FILESYSTEM) + message (STATUS "C++ Filesystem header: ") + set (TEST_FS_LIB ON) + set (CXXSTD_FS_TEST_SOURCE + "#include + int main() + { + std::experimental::filesystem::path p{\"/tmp/\"}; + throw std::experimental::filesystem::filesystem_error(\"Empty file name!\", std::make_error_code(std::errc::invalid_argument)); + }") + else () + message (WARNING "No std::filesystem include file found: nana::filesystem will be used. + Set NANA_CMAKE_NANA_FILESYSTEM_FORCE to ON to avoid this warning.") + target_compile_definitions(nana PUBLIC STD_FILESYSTEM_NOT_SUPPORTED) + set (TEST_FS_LIB OFF) + endif () endif () if (TEST_FS_LIB) @@ -94,56 +95,84 @@ else() set (CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH}) set (CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS}) set (CMAKE_REQUIRED_FLAGS_ORIGINAL ${CMAKE_REQUIRED_FLAGS}) - - set (CXXSTD_TEST_SOURCE - "#if !defined (__cplusplus) || (__cplusplus < 201703L) - #error NOCXX17 - #endif - int main() {}") - - check_cxx_source_compiles ("${CXXSTD_TEST_SOURCE}" CXX17_BUILTIN) - - if (CXX17_BUILTIN) - message (STATUS "C++ Standard-17 support: builtin") - else () - set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_ORIGINAL} -std=c++17") - check_cxx_source_compiles ("${CXXSTD_TEST_SOURCE}" CXX17_FLAG) - if (CXX17_FLAG) - message (STATUS "C++ Standard-17 support: via -std=c++17") - else () - message (WARNING "nana requires C++17??, but your compiler does not support it.") - endif () - endif () - set (CMAKE_REQUIRED_LIBRARIES_ORIGINAL ${CMAKE_REQUIRED_LIBRARIES}) - check_cxx_source_compiles ("${CXXSTD_TEST_SOURCE}" C++17FS_FLAG) - if (C++17FS_FLAG) + # c++: builtin + set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_ORIGINAL}") + set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL}) + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXXBuiltIn_FS_BuiltIn) + if (CXXBuiltIn_FS_BuiltIn) message (STATUS "C++ Filesystem library: builtin") - else () - set (C++17FS_LIB "") - foreach (_LIB stdc++fs) - set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} ${_LIB}) - check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" C++17FS_LIB-l${_LIB}) - message (STATUS "C++ Filesystem library: testing -l${_LIB}") - if (C++17FS_LIB-l${_LIB}) - target_link_libraries (nana PUBLIC ${_LIB}) - message (STATUS "C++ Filesystem library: via -l${_LIB}") - set (C++17FS_LIB ${_LIB}) - break () - endif () - set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL}) - endforeach () + else() + set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} stdc++fs") + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXXBuiltIn_FS_stdcppfs) + if (CXXBuiltIn_FS_stdcppfs) + message (STATUS "C++ Filesystem library: stdc++fs") + target_link_libraries (nana PUBLIC stdc++fs) + else() + set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} c++fs") + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXXBuiltIn_FS_cppfs) + if (CXXBuiltIn_FS_cppfs) + message (STATUS "C++ Filesystem library: c++fs") + target_link_libraries (nana PUBLIC c++fs) + else() - if (C++17FS_LIB) - message (STATUS "C++ Filesystem library: via -l${C++17FS_LIB}") - else () - message (WARNING "No std::filesystem library found: nana::filesystem will be used. - Set NANA_CMAKE_NANA_FILESYSTEM_FORCE to ON to avoid this warning.") - target_compile_definitions(nana PUBLIC STD_FILESYSTEM_NOT_SUPPORTED) - endif () + # c++: -std=c++17 + set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_ORIGINAL} -std=c++17") + set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL}) + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXX_std__cpp17_FS_BuiltIn) + if (CXX_std__cpp17_FS_BuiltIn) + message (STATUS "C++: -std=c++17; Filesystem library: builtin") + else() + set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} stdc++fs") + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXX_std__cpp17_FS_stdcppfs) + if (CXX_std__cpp17_FS_stdcppfs) + message (STATUS "C++: -std=c++17; Filesystem library: stdc++fs") + target_link_libraries (nana PUBLIC stdc++fs) + else() + set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} c++fs") + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXX_std__cpp17_FS_cppfs) + if (CXX_std__cpp17_FS_cppfs) + message (STATUS "C++: -std=c++17; Filesystem library: c++fs") + target_link_libraries (nana PUBLIC c++fs) + else() + + # c++: /std:c++17 + set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_ORIGINAL} /std:c++17") + set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL}) + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXX_std_cpp17_FS_BuiltIn) + if (CXX_std_cpp17_FS_BuiltIn) + message (STATUS "C++: /std:c++17; Filesystem library: builtin") + else() + set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} stdc++fs") + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXX_std_cpp17_FS_stdcppfs) + if (CXX_std_cpp17_FS_stdcppfs) + message (STATUS "C++: /std:c++17; Filesystem library: stdc++fs") + target_link_libraries (nana PUBLIC stdc++fs) + else() + set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} c++fs") + check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXX_std_cpp17_FS_cppfs) + if (CXX_std_cpp17_FS_cppfs) + message (STATUS "C++: /std:c++17; Filesystem library: c++fs") + target_link_libraries (nana PUBLIC c++fs) + + else () + message (WARNING "No std::filesystem library found: nana::filesystem will be used. + Set NANA_CMAKE_NANA_FILESYSTEM_FORCE to ON to avoid this warning.") + target_compile_definitions(nana PUBLIC STD_FILESYSTEM_NOT_SUPPORTED) + set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL}) endif () - endif () -endif() + endif () + endif () + endif () + endif () + endif () + endif () + endif () + endif () + + endif (TEST_FS_LIB) +endif () +