From 9b39d8490b96506f1772bf60dac9d506aed75a22 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Fri, 11 May 2018 17:16:34 +0800 Subject: [PATCH] add select method for spinbox --- include/nana/gui/widgets/spinbox.hpp | 3 +++ source/gui/widgets/spinbox.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/nana/gui/widgets/spinbox.hpp b/include/nana/gui/widgets/spinbox.hpp index 15cbc694..542874f7 100644 --- a/include/nana/gui/widgets/spinbox.hpp +++ b/include/nana/gui/widgets/spinbox.hpp @@ -103,6 +103,9 @@ namespace nana std::pair range_int() const; std::pair range_double() const; + /// Selects/unselects the text + void select(bool); + /// Gets the spined value ::std::string value() const; void value(const ::std::string&); diff --git a/source/gui/widgets/spinbox.cpp b/source/gui/widgets/spinbox.cpp index 41b592f3..af1288eb 100644 --- a/source/gui/widgets/spinbox.cpp +++ b/source/gui/widgets/spinbox.cpp @@ -696,6 +696,16 @@ namespace nana return range->range(); } + void spinbox::select(bool sel) + { + internal_scope_guard lock; + if (handle()) + { + get_drawer_trigger().impl()->editor()->select(sel); + API::refresh_window(*this); + } + } + ::std::string spinbox::value() const { internal_scope_guard lock;