From 8d7f888cf44051671db52ed8dbfc02e912cb5cab Mon Sep 17 00:00:00 2001 From: Arthur Caputo Date: Fri, 24 Jun 2022 11:17:13 -0300 Subject: [PATCH] Removed broken char8_t support --- include/nana/gui/widgets/menu.hpp | 10 +--------- source/gui/widgets/menu.cpp | 26 -------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/include/nana/gui/widgets/menu.hpp b/include/nana/gui/widgets/menu.hpp index fcad50d49..e94b05bb5 100644 --- a/include/nana/gui/widgets/menu.hpp +++ b/include/nana/gui/widgets/menu.hpp @@ -49,9 +49,7 @@ namespace nana bool checked() const; item_proxy& text(std::string title_utf8); -#ifdef __cpp_char8_t - item_proxy& text(std::u8string_view title); -#endif + std::string text() const; std::size_t index() const; @@ -110,9 +108,6 @@ namespace nana virtual void item(graph_reference, const nana::rectangle&, const attr&) = 0; virtual void item_image(graph_reference, const nana::point&, unsigned image_px, const paint::image&) = 0; virtual void item_text(graph_reference, const nana::point&, const std::string&, unsigned text_pixels, const attr&) = 0; -#ifdef __cpp_char8_t - virtual void item_text(graph_reference, const nana::point&, std::u8string_view, unsigned text_pixels, const attr&) = 0; -#endif virtual void sub_arrow(graph_reference, const nana::point&, unsigned item_pixels, const attr&) = 0; }; }//end namespace drawerbase::menu @@ -153,9 +148,6 @@ namespace nana void close(); void image(std::size_t pos, const paint::image& icon); void text(std::size_t pos, std::string text_utf8); -#ifdef __cpp_char8_t - void text(std::size_t pos, std::u8string_view text); -#endif std::string text(std::size_t pos) const; void check_style(std::size_t pos, checks); void checked(std::size_t pos, bool); diff --git a/source/gui/widgets/menu.cpp b/source/gui/widgets/menu.cpp index 4ed629284..11a62eef5 100644 --- a/source/gui/widgets/menu.cpp +++ b/source/gui/widgets/menu.cpp @@ -147,17 +147,6 @@ namespace nana auto wstr = to_wstring(text); tr.render(pos, { wstr.c_str(), wstr.length() }, text_pixels, paint::text_renderer::mode::truncate_with_ellipsis); } -#ifdef __cpp_char8_t - void item_text(graph_reference graph, const nana::point& pos, std::u8string_view title, unsigned text_pixels, const attr& at) override - { - graph.palette(true, at.enabled ? colors::black : colors::gray_border); - nana::paint::text_renderer tr(graph); - - auto wstr = to_wstring(title); - tr.render(pos, { wstr.c_str(), wstr.length() }, text_pixels, paint::text_renderer::mode::truncate_with_ellipsis); - } -#endif - void sub_arrow(graph_reference graph, const nana::point& pos, unsigned pixels, const attr&) override { @@ -340,14 +329,6 @@ namespace nana return *this; } -#ifdef __cpp_char8_t - menu_item_type::item_proxy& menu_item_type::item_proxy::text(std::u8string_view title) - { - menu_->text(pos_, to_string(title)); - return *this; - } -#endif - std::string menu_item_type::item_proxy::text() const { return menu_->text(pos_); @@ -1251,13 +1232,6 @@ namespace nana impl_->mbuilder.data().items.at(index)->text.swap(text_utf8); } -#ifdef __cpp_char8_t - void menu::text(std::size_t index, std::u8string_view text) - { - impl_->mbuilder.data().items.at(index)->text = to_string(text); - } -#endif - std::string menu::text(std::size_t index) const { return impl_->mbuilder.data().items.at(index)->text;