std::wstring widget::caption_wstring() const throw() { #if defined(NANA_WINDOWS) return _m_caption(); #else return to_wstring(_m_caption()); #endif }
widget& widget::caption(std::string utf8) { ::nana::throw_not_utf8(utf8); native_string_type str = to_nstring(utf8); _m_caption(std::move(str)); return *this; }
double textbox::to_double() const { auto s = _m_caption(); if (s.empty()) return 0; return std::stod(s); }
int textbox::to_int() const { auto s = _m_caption(); if (s.empty()) return 0; return std::stoi(s, nullptr, 0); }
void widget::i18n(i18n_eval eval) { if (handle()) { native_string_type str = to_nstring(eval()); _m_caption(std::move(str)); internationalization_parts::set_eval(handle(), std::move(eval)); } }
void widget::caption(const nana::string& str) { _m_caption(str); }
nana::string widget::caption() const { return _m_caption(); }
void i18n(std::string msgid, Args&&... args) { _m_caption(nana::internationalization().get(msgid, std::forward<Args>(args)...)); }
widget& widget::caption(std::wstring text) { native_string_type str = to_nstring(text); _m_caption(std::move(str)); return *this; }
std::string widget::caption() const throw() { return to_utf8(_m_caption()); }
textbox& textbox::from(double d) { _m_caption(to_nstring(d)); return *this; }
textbox& textbox::from(int n) { _m_caption(to_nstring(n)); return *this; }