diff --git a/docs/docs/reference/foundation/application.md b/docs/docs/reference/foundation/application.md index 431fff31..eaf77a07 100644 --- a/docs/docs/reference/foundation/application.md +++ b/docs/docs/reference/foundation/application.md @@ -74,6 +74,10 @@ namespace bdn { Opens the given URL in a suitable external application. Web URLs will be opened in the system's standard web browser. Application-specific URLs will open in the respective application. +* **virtual void copyToClipboard(const String &str)** + + Copies the given string to the clipboard. + ## Resources * **virtual String uriToBundledFileUri(const String &uri)** diff --git a/examples/BodenDemo/src/BodenDemo.cpp b/examples/BodenDemo/src/BodenDemo.cpp index c1ce3199..48d8fd3a 100644 --- a/examples/BodenDemo/src/BodenDemo.cpp +++ b/examples/BodenDemo/src/BodenDemo.cpp @@ -8,6 +8,7 @@ #include "FontPage.h" #include "ImagesPage.h" #include "ListViewPage.h" +#include "MiscPage.h" #include "PropertiesPage.h" #include "StyledTextPage.h" #include "TimersPage.h" @@ -23,7 +24,7 @@ using namespace bdn; class PagesDataSource : public ListViewDataSource { public: - std::array()>>, 10> pages = { + std::array()>>, 11> pages = { std::make_pair("UI Demo", [=]() { return std::make_shared(needsInit, _window); }), std::make_pair("Timer demo", [=]() { return std::make_shared(needsInit); }), std::make_pair("WebView demo", [=]() { return std::make_shared(needsInit); }), @@ -34,6 +35,7 @@ class PagesDataSource : public ListViewDataSource std::make_pair("Fonts", [=]() { return std::make_shared(needsInit); }), std::make_pair("Styled Text", [=]() { return std::make_shared(needsInit); }), std::make_pair("Focus", [=]() { return std::make_shared(needsInit); }), + std::make_pair("Misc", [=]() { return std::make_shared(needsInit); }), }; public: diff --git a/examples/BodenDemo/src/MiscPage.cpp b/examples/BodenDemo/src/MiscPage.cpp new file mode 100644 index 00000000..1622ee5d --- /dev/null +++ b/examples/BodenDemo/src/MiscPage.cpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include +#include + +#include "MiscPage.h" +#include + +namespace bdn +{ + void MiscPage::init() + { + stylesheet = FlexJsonStringify({"flexGrow" : 1.0}); + + auto buttonCopy = std::make_shared