diff --git a/LATEST_RELEASE_NOTES.md b/LATEST_RELEASE_NOTES.md index f7a4070..086b63b 100644 --- a/LATEST_RELEASE_NOTES.md +++ b/LATEST_RELEASE_NOTES.md @@ -1,8 +1,8 @@ -# wxUI release notes for v0.1.8 +# wxUI release notes for v0.1.9 Bugs addressed in this release: -* [#154](../../issues/154) Generic constructor overload takes wxWindow, should have been Window - Other changes: +* [#157](../../issues/157) Text needs withWrap + diff --git a/include/wxUI/Text.h b/include/wxUI/Text.h index 021826f..2196c31 100644 --- a/include/wxUI/Text.h +++ b/include/wxUI/Text.h @@ -59,6 +59,12 @@ struct Text : public details::WidgetDetails { { } + auto setWrap(int wrapLength) -> Text& + { + wrap = wrapLength; + return *this; + } + struct Proxy : super::WidgetProxy { PROXY_BOILERPLATE(); @@ -78,10 +84,15 @@ struct Text : public details::WidgetDetails { private: std::string text; + std::optional wrap; auto createImpl(wxWindow* parent) -> wxWindow* override { - return setProxy(new underlying_t(parent, getIdentity(), text, getPos(), getSize(), getStyle())); + auto* widget = new underlying_t(parent, getIdentity(), text, getPos(), getSize(), getStyle()); + if (wrap) { + widget->Wrap(*wrap); + } + return setProxy(widget); } };