use UTF-8 for string representation
This commit is contained in:
@@ -21,11 +21,12 @@ namespace nana
|
||||
{
|
||||
namespace tabbar
|
||||
{
|
||||
using native_string_type = ::nana::detail::native_string_type;
|
||||
struct item_t
|
||||
{
|
||||
window relative{nullptr};
|
||||
paint::image img;
|
||||
nana::string text;
|
||||
native_string_type text;
|
||||
any value;
|
||||
|
||||
::nana::color bgcolor;
|
||||
@@ -33,7 +34,7 @@ namespace nana
|
||||
|
||||
item_t() = default;
|
||||
|
||||
item_t(nana::string&& text, any && value)
|
||||
item_t(native_string_type&& text, any && value)
|
||||
: text(std::move(text)), value(std::move(value))
|
||||
{}
|
||||
};
|
||||
@@ -420,7 +421,7 @@ namespace nana
|
||||
evt_agent_ = evt;
|
||||
}
|
||||
|
||||
void insert(std::size_t pos, nana::string&& text, nana::any&& value)
|
||||
void insert(std::size_t pos, native_string_type&& text, nana::any&& value)
|
||||
{
|
||||
if (pos >= list_.size())
|
||||
pos = list_.size();
|
||||
@@ -639,7 +640,7 @@ namespace nana
|
||||
m.img.close();
|
||||
}
|
||||
|
||||
bool text(std::size_t pos, const nana::string& str)
|
||||
bool text(std::size_t pos, const native_string_type& str)
|
||||
{
|
||||
if (pos >= list_.size())
|
||||
throw std::out_of_range("tabbar: invalid position");
|
||||
@@ -654,7 +655,7 @@ namespace nana
|
||||
return false;
|
||||
}
|
||||
|
||||
nana::string text(std::size_t pos) const
|
||||
native_string_type text(std::size_t pos) const
|
||||
{
|
||||
if (pos >= list_.size())
|
||||
throw std::out_of_range("tabbar: invalid position");
|
||||
@@ -1163,7 +1164,7 @@ namespace nana
|
||||
layouter_->event_agent(evt);
|
||||
}
|
||||
|
||||
void trigger::insert(std::size_t pos, nana::string&& text, nana::any&& value)
|
||||
void trigger::insert(std::size_t pos, native_string_type&& text, nana::any&& value)
|
||||
{
|
||||
layouter_->insert(pos, std::move(text), std::move(value));
|
||||
}
|
||||
@@ -1200,13 +1201,13 @@ namespace nana
|
||||
API::refresh_window(layouter_->widget_handle());
|
||||
}
|
||||
|
||||
void trigger::text(std::size_t i, const nana::string& str)
|
||||
void trigger::text(std::size_t i, const native_string_type& str)
|
||||
{
|
||||
if(layouter_->text(i, str))
|
||||
API::refresh_window(layouter_->widget_handle());
|
||||
}
|
||||
|
||||
nana::string trigger::text(std::size_t i) const
|
||||
native_string_type trigger::text(std::size_t i) const
|
||||
{
|
||||
return layouter_->text(i);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user