Merge branch 'qPCR4vir-test_error' into develop

This commit is contained in:
Jinhao 2019-05-07 00:25:46 +08:00
commit 3d89eb2ea1
16 changed files with 547 additions and 409 deletions

View File

@ -46,8 +46,6 @@ before_install:
- cd ..
- git clone --depth=1 --branch=hotfix 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.12/cmake-3.12.0-rc3-Linux-x86_64.sh || true
- chmod -R +x /tmp/tools
@ -65,7 +63,7 @@ before_script :
- cd demo-build
script:
- cmake -G"Unix Makefiles" ../nana-demo -DCMAKE_INSTALL_PREFIX=.. -DNANA_CMAKE_ENABLE_JPEG=ON -DNANA_CMAKE_FIND_BOOST_FILESYSTEM=ON -DNANA_CMAKE_AUTOMATIC_GUI_TESTING=ON
- 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
- make install
# todo: separate resources from sources (a directory for images)
- ls

View File

@ -17,6 +17,9 @@ if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # AN
target_compile_options(nana PRIVATE -Wall
PUBLIC -g )
# todo: set in target property of nana
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -mtune=native -DNDEBUG")
set(THREADS_PREFER_PTHREAD_FLAG ON) # todo - test this
find_package(Threads REQUIRED)
target_link_libraries(nana PRIVATE Threads::Threads)

View File

@ -30,6 +30,8 @@ if (NANA_CMAKE_VERBOSE_PREPROCESSOR)
cmake_print_variables(CMAKE_BUILD_TYPE)
cmake_print_variables(CMAKE_CONFIGURATION_TYPES)
cmake_print_variables(CMAKE_CXX_FLAGS_RELEASE)
message ( "CMAKE_CXX_COMPILER_ID = " ${CMAKE_CXX_COMPILER_ID})
message ( "COMPILER_IS_CLANG = " ${COMPILER_IS_CLANG})
message ( "CMAKE_COMPILER_IS_GNUCXX = " ${CMAKE_COMPILER_IS_GNUCXX})

View File

@ -102,6 +102,7 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -116,6 +117,7 @@
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -132,6 +134,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -150,6 +153,7 @@
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -252,6 +256,7 @@
<ClInclude Include="..\..\include\nana\gui.hpp" />
<ClInclude Include="..\..\include\nana\gui\animation.hpp" />
<ClInclude Include="..\..\include\nana\gui\basis.hpp" />
<ClInclude Include="..\..\include\nana\gui\dragdrop.hpp" />
<ClInclude Include="..\..\include\nana\gui\dragger.hpp" />
<ClInclude Include="..\..\include\nana\gui\drawing.hpp" />
<ClInclude Include="..\..\include\nana\gui\effects.hpp" />

View File

@ -474,6 +474,9 @@
<ClInclude Include="..\..\include\nana\verbose_preprocessor.hpp">
<Filter>Include</Filter>
</ClInclude>
<ClInclude Include="..\..\include\nana\gui\dragdrop.hpp">
<Filter>Include\gui</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\include\nana\pop_ignore_diagnostic">

View File

@ -40,7 +40,16 @@ namespace nana
simple_dragdrop(simple_dragdrop&&) = delete;
simple_dragdrop& operator=(simple_dragdrop&&) = delete;
public:
simple_dragdrop(window source);
explicit simple_dragdrop(window source);
simple_dragdrop(window drag_origin,
std::function<bool()> when,
window drop_target,
std::function<void()> how)
: simple_dragdrop{drag_origin}
{
condition(when);
make_drop(drop_target, how);
}
~simple_dragdrop();
/// Condition checker

View File

@ -1,16 +1,16 @@
/*
/**
* An Implementation of Place for Layout
* 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/place.cpp
* @file nana/gui/place.cpp
*
* @contributions:
* min/max and splitter bar initial weight by Ariel Vina-Rodriguez.
* @contributions
* error, width/height, min/max and splitter bar initial weight by Ariel Vina-Rodriguez.
*/
#ifndef NANA_GUI_PLACE_HPP
@ -79,6 +79,7 @@ namespace nana
{
struct implement;
class field_interface
{
field_interface(const field_interface&) = delete;
@ -103,6 +104,19 @@ namespace nana
virtual void _m_add_agent(const detail::place_agent&) = 0;
};
public:
class error :public std::invalid_argument
{
public:
error( const std::string& what,
const place& plc,
std::string field = "unknown",
std::string::size_type pos = std::string::npos);
std::string base_what;
std::string owner_caption; ///< truncate caption (title) of the "placed" widget
std::string div_text; ///< involved div_text
std::string field; ///< posible field where the error ocurred.
std::string::size_type pos; ///< posible position in the div_text where the error ocurred. npos if unknown
};
/// reference to a field manipulator which refers to a field object created by place
using field_reference = field_interface &;
@ -119,9 +133,13 @@ namespace nana
void splitter_renderer(std::function<void(window, paint::graphics&, mouse_action)> fn);
void div(std::string div_text); ///< Divides the attached widget into fields.
const std::string& div() const noexcept; ///< Returns div-text that depends on fields status.
void modify(const char* field_name, const char* div_text); ///< Modifies a specified field.
void div(std::string div_text); ///< Divides the attached widget into fields. May throw placa::error
const std::string& div() const noexcept; ///< Returns div-text that depends on fields status.
static bool valid_field_name(const char* name) ///< must begin with _a-zA-Z
{
return name && (*name == '_' || (('a' <= *name && *name <= 'z') || ('A' <= *name && *name <= 'Z')));
}
void modify(const char* field_name, const char* div_text); ///< Modifies a specified field. May throw placa::error
field_reference field(const char* name);///< Returns a field with the specified name.
@ -152,6 +170,8 @@ namespace nana
private:
implement * impl_;
};
}//end namespace nana
#include <nana/pop_ignore_diagnostic>

View File

@ -35,7 +35,10 @@ namespace nana{
}//end namespace drawerbase
class group
: public widget_object<category::widget_tag, drawerbase::panel::drawer, general_events, drawerbase::group::scheme>
: public widget_object<category::widget_tag,
drawerbase::panel::drawer,
general_events,
drawerbase::group::scheme>
{
struct implement;
public:
@ -56,9 +59,8 @@ namespace nana{
group(window parent, const rectangle& = {}, bool visible = true);
/// The construction that creates the widget and set the title or caption
group(window parent, ///< a handle to the parent
::std::string title, ///< caption of the group
group(window parent, ///< a handle to the parent
::std::string title, ///< caption of the group
bool formatted = false, ///< Enable/disable the formatted text for the title
unsigned gap = 2, ///< between the content and the external limit
const rectangle& r = {} ,

View File

@ -1292,7 +1292,10 @@ the nana::detail::basic_window member pointer scheme
\example listbox_Resolver.cpp
*/
class listbox
: public widget_object<category::widget_tag, drawerbase::listbox::trigger, drawerbase::listbox::listbox_events, drawerbase::listbox::scheme>,
: public widget_object<category::widget_tag,
drawerbase::listbox::trigger,
drawerbase::listbox::listbox_events,
drawerbase::listbox::scheme>,
public concepts::any_objective<drawerbase::listbox::size_type, 2>
{
public:
@ -1462,7 +1465,7 @@ the nana::detail::basic_window member pointer scheme
size_type column_size() const;
/// Move column to view_position
void move_column(size_type abs_pos, size_type view_pos);
void move_column(size_type abs_pos, size_type view_pos);
/// Sort columns in range first_col to last_col inclusive using the values from a row
void reorder_columns(size_type first_col,

View File

@ -77,7 +77,10 @@ namespace nana
/// Spinbox Widget
class spinbox
: public widget_object <category::widget_tag, drawerbase::spinbox::drawer, drawerbase::spinbox::spinbox_events, ::nana::widgets::skeletons::text_editor_scheme>
: public widget_object <category::widget_tag,
drawerbase::spinbox::drawer,
drawerbase::spinbox::spinbox_events,
::nana::widgets::skeletons::text_editor_scheme>
{
public:
/// Constructs a spinbox.

View File

@ -350,7 +350,9 @@ namespace nana
/// \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/documentation/widgets/treebox.htm)
class treebox
:public widget_object <category::widget_tag, drawerbase::treebox::trigger, drawerbase::treebox::treebox_events, drawerbase::treebox::scheme>
:public widget_object <category::widget_tag,
drawerbase::treebox::trigger,
drawerbase::treebox::treebox_events, drawerbase::treebox::scheme>
{
public:
/// A type refers to the item and is also used to iterate through the nodes.

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,13 @@
/*
/**
* Parts of Class Place
* 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
* (See accompanying file LICENSE or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* @file: nana/gui/place_parts.hpp
* @file nana/gui/place_parts.hpp
*/
#ifndef NANA_GUI_PLACE_PARTS_HPP
#define NANA_GUI_PLACE_PARTS_HPP

View File

@ -1,4 +1,4 @@
/*
/**
* A Categorize Implementation
* Nana C++ Library(http://www.nanapro.org)
* Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com)
@ -7,7 +7,7 @@
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* @file: nana/gui/widgets/categorize.cpp
* @file nana/gui/widgets/categorize.cpp
*/
#include <nana/gui/wvl.hpp>

View File

@ -1,19 +1,19 @@
/**
* A group widget implementation
* Nana C++ Library(http://www.nanaro.org)
* Copyright(C) 2015-2018 Jinhao(cnjinhao@hotmail.com)
* Copyright(C) 2015-2019 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/group.cpp
* @file nana/gui/widgets/group.cpp
*
* @Author: Stefan Pfeifer(st-321), Ariel Vina-Rodriguez (qPCR4vir)
* @author Stefan Pfeifer(st-321), Ariel Vina-Rodriguez (qPCR4vir)
*
* @brief group is a widget used to visually group and layout other widgets.
*
* @contributor:
* @contributor
* dankan1890(https://github.com/dankan1890)
*/

View File

@ -549,9 +549,9 @@ namespace nana
if (!front) view++;
if (view >= cont_.size() ) return;
auto i = std::find_if( cont_.begin(),
cont_.end(),
[&](const column& c){return col==c.index;});
auto i = std::find_if( cont_.begin(),
cont_.end(),
[&](const column& c){return col==c.index;});
if (i==cont_.end()) return;
@ -4474,7 +4474,7 @@ namespace nana
essence_->stop_mouse_selection();
need_refresh = true;
}
if (operation_states::msup_deselect == essence_->operation.state)
{
essence_->operation.state = operation_states::none;
@ -6193,7 +6193,7 @@ namespace nana
std::vector<size_type> new_idx;
for(size_type i=first_col; i<=last_col; ++i) new_idx.push_back(i);
internal_scope_guard lock;
auto ip_row = this->at(row);
auto pnany=_m_ess().lister.anyobj(row,false);