From 799b1206a1b55a1e233bfffedf49ddf14a98d73f Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Mon, 15 Feb 2016 18:29:40 +0100 Subject: [PATCH] group convenient return a reference to checkbox option see widget_show2 for an example of convenience --- include/nana/gui/widgets/group.hpp | 3 ++- source/gui/widgets/group.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/nana/gui/widgets/group.hpp b/include/nana/gui/widgets/group.hpp index 79162f06..2e264289 100644 --- a/include/nana/gui/widgets/group.hpp +++ b/include/nana/gui/widgets/group.hpp @@ -19,6 +19,7 @@ #include #include +#include namespace nana{ class group @@ -49,7 +50,7 @@ namespace nana{ ~group(); /// Adds an option for user selection - group& add_option(::std::string); + checkbox& add_option(::std::string); /// Enables/disables the radio mode which is single selection group& radio_mode(bool); diff --git a/source/gui/widgets/group.cpp b/source/gui/widgets/group.cpp index aa4d3346..91b1bd9a 100644 --- a/source/gui/widgets/group.cpp +++ b/source/gui/widgets/group.cpp @@ -103,7 +103,7 @@ namespace nana{ delete impl_->radio_logic; } - group& group::add_option(std::string text) + checkbox& group::add_option(std::string text) { _THROW_IF_EMPTY() @@ -118,7 +118,7 @@ namespace nana{ if (impl_->radio_logic) impl_->radio_logic->add(*opt); - return *this; + return *impl_->options.back(); } group& group::radio_mode(bool enable)