Merge branch 'hotfix-1.2' into prepare-utf8
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
|
||||
#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#if defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#include <nana/std_thread.hpp>
|
||||
#include <nana/std_mutex.hpp>
|
||||
#include <nana/std_condition_variable.hpp>
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <thread>
|
||||
#endif //NANA_MINGW
|
||||
#endif // STD_THREAD_NOT_SUPPORTED
|
||||
|
||||
namespace nana
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <nana/gui/detail/native_window_interface.hpp>
|
||||
#include <nana/gui/screen.hpp>
|
||||
#if defined(NANA_WINDOWS)
|
||||
#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#if defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#include <nana/std_mutex.hpp>
|
||||
#else
|
||||
#include <mutex>
|
||||
|
||||
@@ -463,10 +463,10 @@ namespace detail
|
||||
}
|
||||
}
|
||||
|
||||
void window_manager::default_icon(const nana::paint::image& small_icon, const nana::paint::image& big_icon)
|
||||
void window_manager::default_icon(const nana::paint::image& _small, const nana::paint::image& big)
|
||||
{
|
||||
impl_->default_icon_big = big_icon;
|
||||
impl_->default_icon_small = small_icon;
|
||||
impl_->default_icon_big = big;
|
||||
impl_->default_icon_small = _small;
|
||||
}
|
||||
|
||||
void window_manager::icon(core_window_t* wd, const paint::image& small_icon, const paint::image& big_icon)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#if defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#include <nana/std_mutex.hpp>
|
||||
#else
|
||||
#include <mutex>
|
||||
|
||||
@@ -95,13 +95,13 @@ namespace nana
|
||||
|
||||
std::string pos_str() const
|
||||
{
|
||||
#ifdef NANA_MINGW
|
||||
#ifdef UNDEFINED_to_string
|
||||
std::stringstream ss;
|
||||
ss<<pos();
|
||||
return ss.str();
|
||||
#else
|
||||
return std::to_string(pos());
|
||||
#endif // NANA_MINGW
|
||||
#endif // UNDEFINED_to_string
|
||||
}
|
||||
|
||||
token read()
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <map>
|
||||
#include <memory>
|
||||
|
||||
#if defined(NANA_MINGW) && defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#if defined(STD_THREAD_NOT_SUPPORTED)
|
||||
#include <nana/std_mutex.hpp>
|
||||
#else
|
||||
#include <mutex>
|
||||
|
||||
@@ -30,6 +30,12 @@ namespace nana
|
||||
|
||||
::nana::color bgcolor;
|
||||
::nana::color fgcolor;
|
||||
|
||||
item_t() = default;
|
||||
|
||||
item_t(nana::string&& text, any && value)
|
||||
: text(std::move(text)), value(std::move(value))
|
||||
{}
|
||||
};
|
||||
|
||||
class def_renderer
|
||||
@@ -414,13 +420,13 @@ namespace nana
|
||||
evt_agent_ = evt;
|
||||
}
|
||||
|
||||
void push_back(const nana::string& text, const nana::any & value)
|
||||
void insert(std::size_t pos, nana::string&& text, nana::any&& value)
|
||||
{
|
||||
item_t m;
|
||||
m.text = text;
|
||||
m.value = value;
|
||||
list_.push_back(m);
|
||||
activate(static_cast<size_t>(list_.size() - 1));
|
||||
if (pos >= list_.size())
|
||||
pos = list_.size();
|
||||
|
||||
list_.emplace(iterator_at(pos), std::move(text), std::move(value));
|
||||
this->activate(pos);
|
||||
render();
|
||||
}
|
||||
|
||||
@@ -433,9 +439,13 @@ namespace nana
|
||||
{
|
||||
if(pos < list_.size())
|
||||
{
|
||||
if ((nullptr == evt_agent_) || evt_agent_->removed(pos))
|
||||
bool close_attach = true;
|
||||
if ((nullptr == evt_agent_) || evt_agent_->removed(pos, close_attach))
|
||||
{
|
||||
API::show_window(iterator_at(pos)->relative, false);
|
||||
if (close_attach)
|
||||
API::close_window(iterator_at(pos)->relative);
|
||||
else
|
||||
API::show_window(iterator_at(pos)->relative, false);
|
||||
list_.erase(iterator_at(pos));
|
||||
_m_adjust();
|
||||
|
||||
@@ -593,7 +603,7 @@ namespace nana
|
||||
return basis_.active;
|
||||
}
|
||||
|
||||
void relate(std::size_t pos, window wd)
|
||||
void attach(std::size_t pos, window wd)
|
||||
{
|
||||
if(pos < list_.size())
|
||||
{
|
||||
@@ -1152,9 +1162,9 @@ namespace nana
|
||||
layouter_->event_agent(evt);
|
||||
}
|
||||
|
||||
void trigger::push_back(const nana::string& text, const nana::any& value)
|
||||
void trigger::insert(std::size_t pos, nana::string&& text, nana::any&& value)
|
||||
{
|
||||
layouter_->push_back(text, value);
|
||||
layouter_->insert(pos, std::move(text), std::move(value));
|
||||
}
|
||||
|
||||
std::size_t trigger::length() const
|
||||
@@ -1167,9 +1177,14 @@ namespace nana
|
||||
return layouter_->toolbox_object().close_fly(fly);
|
||||
}
|
||||
|
||||
void trigger::relate(std::size_t i, window wd)
|
||||
void trigger::attach(std::size_t pos, window wd)
|
||||
{
|
||||
layouter_->relate(i, wd);
|
||||
layouter_->attach(pos, wd);
|
||||
}
|
||||
|
||||
void trigger::erase(std::size_t pos)
|
||||
{
|
||||
layouter_->erase(pos);
|
||||
}
|
||||
|
||||
void trigger::tab_color(std::size_t i, bool is_bgcolor, const ::nana::color& clr)
|
||||
|
||||
Reference in New Issue
Block a user