Merge branch 'qPCR4vir-minor_change' into develop

This commit is contained in:
Jinhao 2019-12-10 03:58:34 +08:00
commit 62e6d0dbe8
10 changed files with 166 additions and 127 deletions

View File

@ -43,8 +43,12 @@ matrix:
- llvm-toolchain-precise - llvm-toolchain-precise
before_install: before_install:
# donwload nana-demo first
# we are in: 'user'/nana/
- cd .. - 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" - 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 - 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 - chmod -R +x /tmp/tools
@ -53,27 +57,29 @@ install:
- /tmp/tools/cmake --prefix="$HOME" --exclude-subdir - /tmp/tools/cmake --prefix="$HOME" --exclude-subdir
before_script : 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) - mkdir demo-build
#- cd ../nana-demo
- mkdir demo-build
- cd demo-build - cd demo-build
# now we have 'user'/nana-demo, 'user'/nana/ , 'user'/demo-build/ and we are in: 'user'/demo-build/
services: 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 - xvfb
script: 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 - 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 - 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) # todo: separate resources from sources (a directory for images)
- ls - ls
# we were still in: 'user'/demo-build/
- cd ../nana-test/bin - cd ../nana-test/bin
- ls - ls -lh
- ./a_group_impl - ./a_group_impl
- ./animate-bmp - ./animate-bmp
- ./audio_player - ./audio_player
- ./background-effects - ./background-effects
#- ./calculator # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1159 - ./calculator # COOL !!! https://travis-ci.org/qPCR4vir/nana/builds/621103509#L924
- ./categ - ./categ
- ./clicked - ./clicked
- ./decore - ./decore
@ -81,48 +87,45 @@ script:
- ./drag-button - ./drag-button
- ./draw - ./draw
- ./file_explorer - ./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_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 - ./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 # todo failed https://travis-ci.org/qPCR4vir/nana/builds/621116812#L1193
#- ./folder_tree_nana # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1408 - ./folder_tree_std # todo failed https://travis-ci.org/qPCR4vir/nana/builds/621116812#L1200
#- ./folder_tree_std # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1421
- ./framework_design_1 - ./framework_design_1
- ./framework_design_2 - ./framework_design_2
- ./framework_design_3 - ./framework_design_3
- ./group - ./group
- ./HelloWord - ./HelloWord
#- ./helloword_quit # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1572 - ./helloword_quit # ok
#- ./inputbox # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1585 - ./inputbox # ok
- ./label_listener - ./label_listener
- ./lambda_event.Cpp11 - ./lambda_event.Cpp11
- ./listbox_inline_widget - ./listbox_inline_widget
- ./listbox_Resolver - ./listbox_Resolver
- ./loader_1 - ./loader_1
#- ./loader_2 # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1732 - ./loader_2 # ok
- ./mbox - ./mbox
- ./main - ./main
- ./menu_debug - ./menu_debug
#- ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140250744#L1736 - ./modal_form # ok
#- ./MontiHall # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1775 - ./MontiHall # ok
#- ./helloworld_demo # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1786 - ./helloworld_demo # ok
#- ./notepad # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1799 - ./notepad # ok !!
- ./menu_debug - ./menu_popuper
- ./menu_popuper - ./widget_show2 # ok !!
#- ./modal_form # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1846 - ./widget_show # ok !!
#- ./widget_show2 # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1730
#- ./widget_show # https://travis-ci.org/qPCR4vir/nana/jobs/140245437#L1740
- ./place_login - ./place_login
- ./png - ./png
#- ./screen # https://travis-ci.org/qPCR4vir/nana/jobs/140238537#L1909 - ./screen # ok
- ./stretch_image - ./stretch_image
#- ./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 - ./textbox_line_number
- ./threading # ok
- ./thread-pool # ok
- ./various_events
- ./window-dragger # ok
- ./windows-subclassing

View File

@ -32,6 +32,7 @@ project(nana VERSION 1.7.2
add_library(nana) add_library(nana)
add_library(nana::nana ALIAS nana) add_library(nana::nana ALIAS nana)
target_compile_features(nana PUBLIC cxx_std_17) target_compile_features(nana PUBLIC cxx_std_17)
# set(CMAKE_CXX_STANDARD 17)
# need after cxx_std_14 or cxx_std_17 ?? # need after cxx_std_14 or cxx_std_17 ??
target_compile_features(nana target_compile_features(nana

View File

@ -1,12 +1,12 @@
# The ISO C++ File System Technical Specification (ISO-TS, or STD) was optional. # 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 # http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf
# It is part of c++17. # 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 # The library may be not available or working correctly in the std library you use.
# to "implement" it (ab)using Boost (almost compatible) # 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 # 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. # By ncluding the file <nana/filesystem/filesystem.hpp> or <nana/filesystem/filesystem_ext.hpp>
# If you include the file <nana/filesystem/filesystem.hpp> or <nana/filesystem/filesystem_ext.hpp> # the selected option is inlined by nana into std::filesystem.
# the selected option will be 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. # 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 # You can change that default if you change one of the following
# (please don't define more than one of the _XX_FORCE options): # (please don't define more than one of the _XX_FORCE options):
@ -55,8 +55,6 @@ else()
endif() endif()
check_include_file_cxx (filesystem NANA_HAVE_FILESYSTEM) check_include_file_cxx (filesystem NANA_HAVE_FILESYSTEM)
check_include_file_cxx (experimental/filesystem NANA_HAVE_EXP_FILESYSTEM)
if (NANA_HAVE_FILESYSTEM) if (NANA_HAVE_FILESYSTEM)
message (STATUS "C++ Filesystem header: <filesystem>") message (STATUS "C++ Filesystem header: <filesystem>")
set (TEST_FS_LIB ON) set (TEST_FS_LIB ON)
@ -67,21 +65,24 @@ else()
std::filesystem::path p{\"\tmp/\"}; std::filesystem::path p{\"\tmp/\"};
throw std::filesystem::filesystem_error(\"Empty file name!\", std::make_error_code(std::errc::invalid_argument)); throw std::filesystem::filesystem_error(\"Empty file name!\", std::make_error_code(std::errc::invalid_argument));
}") }")
elseif (NANA_HAVE_EXP_FILESYSTEM) else()
message (STATUS "C++ Filesystem header: <experimental/filesystem>") check_include_file_cxx (experimental/filesystem NANA_HAVE_EXP_FILESYSTEM)
set (TEST_FS_LIB ON) if (NANA_HAVE_EXP_FILESYSTEM)
set (CXXSTD_FS_TEST_SOURCE message (STATUS "C++ Filesystem header: <experimental/filesystem>")
"#include <experimental/filesystem> set (TEST_FS_LIB ON)
int main() set (CXXSTD_FS_TEST_SOURCE
{ "#include <experimental/filesystem>
std::experimental::filesystem::path p{\"/tmp/\"}; int main()
throw std::experimental::filesystem::filesystem_error(\"Empty file name!\", std::make_error_code(std::errc::invalid_argument)); {
}") std::experimental::filesystem::path p{\"/tmp/\"};
else () throw std::experimental::filesystem::filesystem_error(\"Empty file name!\", std::make_error_code(std::errc::invalid_argument));
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.") else ()
target_compile_definitions(nana PUBLIC STD_FILESYSTEM_NOT_SUPPORTED) message (WARNING "No std::filesystem include file found: nana::filesystem will be used.
set (TEST_FS_LIB OFF) 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 () endif ()
if (TEST_FS_LIB) if (TEST_FS_LIB)
@ -94,56 +95,84 @@ else()
set (CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH}) set (CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH})
set (CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS}) set (CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS})
set (CMAKE_REQUIRED_FLAGS_ORIGINAL ${CMAKE_REQUIRED_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}) 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") message (STATUS "C++ Filesystem library: builtin")
else () else()
set (C++17FS_LIB "") set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} stdc++fs")
foreach (_LIB stdc++fs) check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXXBuiltIn_FS_stdcppfs)
set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} ${_LIB}) if (CXXBuiltIn_FS_stdcppfs)
check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" C++17FS_LIB-l${_LIB}) message (STATUS "C++ Filesystem library: stdc++fs")
message (STATUS "C++ Filesystem library: testing -l${_LIB}") target_link_libraries (nana PUBLIC stdc++fs)
if (C++17FS_LIB-l${_LIB}) else()
target_link_libraries (nana PUBLIC ${_LIB}) set (CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES_ORIGINAL} c++fs")
message (STATUS "C++ Filesystem library: via -l${_LIB}") check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXXBuiltIn_FS_cppfs)
set (C++17FS_LIB ${_LIB}) if (CXXBuiltIn_FS_cppfs)
break () message (STATUS "C++ Filesystem library: c++fs")
endif () target_link_libraries (nana PUBLIC c++fs)
set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL}) else()
endforeach ()
if (C++17FS_LIB) # c++: -std=c++17
message (STATUS "C++ Filesystem library: via -l${C++17FS_LIB}") set (CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS_ORIGINAL} -std=c++17")
else () set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES_ORIGINAL})
message (WARNING "No std::filesystem library found: nana::filesystem will be used. check_cxx_source_compiles ("${CXXSTD_FS_TEST_SOURCE}" CXX_std__cpp17_FS_BuiltIn)
Set NANA_CMAKE_NANA_FILESYSTEM_FORCE to ON to avoid this warning.") if (CXX_std__cpp17_FS_BuiltIn)
target_compile_definitions(nana PUBLIC STD_FILESYSTEM_NOT_SUPPORTED) message (STATUS "C++: -std=c++17; Filesystem library: builtin")
endif () 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 ()
endif (TEST_FS_LIB)
endif ()

View File

@ -39,8 +39,8 @@ endif()
if(NANA_STATIC_STDLIB) if(NANA_STATIC_STDLIB)
target_link_libraries(nana target_link_libraries(nana
PUBLIC PUBLIC
$<$<CXX_COMPILER_ID:GNU>:-static-libgcc> $<$<CXX_COMPILER_ID:GNU>:-static-libgcc -static-libstdc++>
$<$<CXX_COMPILER_ID:Clang>:-static-libstdc++> $<$<CXX_COMPILER_ID:Clang>:-static-libgcc -static-libstdc++>
) )
endif() endif()

View File

@ -395,7 +395,7 @@ namespace API
/// Blocks the execution and other windows' messages until the specified window is closed. /// Blocks the execution and other windows' messages until the specified window is closed.
void modal_window(window); 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); void wait_for(window);
color fgcolor(window); color fgcolor(window);

View File

@ -87,10 +87,10 @@ namespace nana{
typedef widget_object<category::widget_tag, drawerbase::button::trigger> base_type; typedef widget_object<category::widget_tag, drawerbase::button::trigger> base_type;
public: public:
button(); button();
button(window, bool visible); button(window parent, bool visible);
button(window, const ::std::string& caption, bool visible = true); button(window parent, const ::std::string& caption, bool visible = true);
button(window, const char* caption, bool visible = true); button(window parent, const char* caption, bool visible = true);
button(window, const nana::rectangle& = rectangle(), bool visible = true); button(window parent, const nana::rectangle& = rectangle(), bool visible = true);
/// Shows an icon in front of caption /// Shows an icon in front of caption
/** /**

View File

@ -1,13 +1,13 @@
/** /**
* A Form Implementation * A Form Implementation
* Nana C++ Library(http://www.nanapro.org) * 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. * Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt 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/form.hpp * @file nana/gui/widgets/form.hpp
*/ */
#ifndef NANA_GUI_WIDGET_FORM_HPP #ifndef NANA_GUI_WIDGET_FORM_HPP
@ -42,7 +42,7 @@ namespace nana
//place methods //place methods
place & get_place(); place & get_place();
void div(const char* div_text); void div(std::string div_text);
place::field_reference operator[](const char* field_name); place::field_reference operator[](const char* field_name);
void collocate() noexcept; void collocate() noexcept;
private: private:
@ -51,23 +51,30 @@ namespace nana
}//end namespace form }//end namespace form
}//end namespace drawerbase }//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 /// \see nana::appearance
class form class form
: public drawerbase::form::form_base : public drawerbase::form::form_base
{ {
public: public:
/// helper template class for creating the appearance of the form.
using appear = ::nana::appear; 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. /// Creates a window form owned by the desktop, at the point and size specified by rect, and with the specified appearance.
form(const rectangle& = API::make_center(300, 200), const appearance& = {}); //Default constructor explicit form(const rectangle& = API::make_center(300, 200), const appearance& = {}); //Default constructor
form(const form&, const ::nana::size& = { 300, 200 }, const appearance& = {}); //Copy 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.
form(window, const ::nana::size& = { 300, 200 }, const appearance& = {}); explicit form(window owner, 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. explicit form(window owner, const rectangle&, const appearance& = {});
form(window, const rectangle&, const appearance& = {}); form(const form&, const ::nana::size& = { 300, 200 }, const appearance& = {}); //Copy constructor
void modality() const; /// Blocks the execution and other windows' messages until this window is closed.
void wait_for_this(); void modality() const;
/// Blocks the execution until this window is closed.
void wait_for_this();
void keyboard_accelerator(const accel_key&, const std::function<void()>& fn); void keyboard_accelerator(const accel_key&, const std::function<void()>& fn);
}; };

View File

@ -39,7 +39,7 @@ namespace nana
place & form_base::get_place() place & form_base::get_place()
{ {
if (this->empty()) 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_) if (!place_)
place_.reset(new place{ *this }); place_.reset(new place{ *this });
@ -47,9 +47,9 @@ namespace nana
return *place_; 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) place::field_reference form_base::operator[](const char* field_name)

View File

@ -2909,7 +2909,7 @@ namespace nana
//es_header::column member functions //es_header::column member functions
void es_header::column::_m_refresh() noexcept void es_header::column::_m_refresh() noexcept
{ {
ess_->update(true); ess_->update(false);
} }
size_type es_header::column::position(bool disp_order) const noexcept size_type es_header::column::position(bool disp_order) const noexcept

View File

@ -1,4 +1,4 @@
/* /**
* Paint Image Implementation * Paint Image Implementation
* Nana C++ Library(http://www.nanapro.org) * Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2019 Jinhao(cnjinhao@hotmail.com) * Copyright(C) 2003-2019 Jinhao(cnjinhao@hotmail.com)
@ -7,9 +7,8 @@
* (See accompanying file LICENSE_1_0.txt 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/paint/image.cpp * @file nana/paint/image.cpp
* @contributors: * @contributors nabijaczleweli(pr#106)
* nabijaczleweli(pr#106)
*/ */
#include <nana/push_ignore_diagnostic> #include <nana/push_ignore_diagnostic>