From 7eece66df090951cfcb1b2a2bd7687d3b39cb798 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Wed, 17 Jun 2015 10:29:11 +0200 Subject: [PATCH 1/4] kainjow : "stoped" typo, should be "stopped" --- include/nana/gui/widgets/progress.hpp | 4 ++-- source/gui/widgets/progress.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/nana/gui/widgets/progress.hpp b/include/nana/gui/widgets/progress.hpp index f7697d7e..3faaca68 100644 --- a/include/nana/gui/widgets/progress.hpp +++ b/include/nana/gui/widgets/progress.hpp @@ -31,7 +31,7 @@ namespace nana void unknown(bool); bool unknown() const; bool stop(bool s = true); - bool stoped() const; + bool stopped() const; private: void attached(widget_reference, graph_reference) override; void refresh(graph_reference) override; @@ -71,7 +71,7 @@ namespace nana void unknown(bool); bool unknown() const; bool stop(bool s=true); ///< request stop or cancel and return previus stop status - bool stoped() const; + bool stopped() const; }; }//end namespace nana #endif diff --git a/source/gui/widgets/progress.cpp b/source/gui/widgets/progress.cpp index e37b5814..d328b130 100644 --- a/source/gui/widgets/progress.cpp +++ b/source/gui/widgets/progress.cpp @@ -89,7 +89,7 @@ namespace nana { return unknown_; } - bool trigger::stoped() const + bool trigger::stopped() const { return stop_; } @@ -210,9 +210,9 @@ namespace nana { return get_drawer_trigger().stop(s); } - bool progress::stoped() const + bool progress::stopped() const { - return get_drawer_trigger().stoped(); + return get_drawer_trigger().stopped(); } //end class progress }//end namespace nana From ec4a5108786b5a7574217703a191fea5062f41d1 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 19 Jul 2015 02:42:22 +0200 Subject: [PATCH 2/4] The construction that creates the widget and set the title or caption --- include/nana/gui/widgets/group.hpp | 12 ++++++++++ source/gui/widgets/group.cpp | 38 ++++++++++++++++++++++++++---- 2 files changed, 45 insertions(+), 5 deletions(-) diff --git a/include/nana/gui/widgets/group.hpp b/include/nana/gui/widgets/group.hpp index 77abd8cc..0b956380 100644 --- a/include/nana/gui/widgets/group.hpp +++ b/include/nana/gui/widgets/group.hpp @@ -34,6 +34,17 @@ namespace nana{ /// The construction that creates the widget group(window parent, const rectangle& = {}, bool visible = true); + /// The construction that creates the widget and set the titel or caption + + group(window parent, ///< + string titel_ /*= { STR("") }*/, ///< + bool format = false, ///< Use a formated label? + unsigned gap = 2, ///< betwen the content and the external limit + rectangle r = {} , ///< + bool visible = true + ); + + /// The destruction ~group(); @@ -60,6 +71,7 @@ namespace nana{ void _m_complete_creation() override; ::nana::string _m_caption() const override; void _m_caption(::nana::string&&) override; + void init(); private: std::unique_ptr impl_; }; diff --git a/source/gui/widgets/group.cpp b/source/gui/widgets/group.cpp index 71d8cc58..ddde3b1d 100644 --- a/source/gui/widgets/group.cpp +++ b/source/gui/widgets/group.cpp @@ -33,6 +33,14 @@ namespace nana{ caption.create(pnl); place_content.bind(pnl); } + + implement() = default; + implement(window grp_panel, string titel, bool format, unsigned gap=2) + : caption (grp_panel, std::move(titel), format), + place_content{grp_panel}, + gap{gap} + { + } }; group::group() @@ -46,6 +54,20 @@ namespace nana{ create(parent, r, vsb); } + group::group( window parent, ///< + string titel_ /*={}*/, ///< + bool format /*=false*/, ///< + unsigned gap /*=2*/, ///< + rectangle r /*={} */, ///< + bool vsb /*= true */ ///< + ) + : panel(parent, r, vsb), + impl_(new implement(*this, std::move(titel_), vsb)) + { + impl_->caption.format(format); + init(); + } + group::~group() { @@ -91,12 +113,8 @@ namespace nana{ impl_->place_content[field] << wdg->handle(); } - void group::_m_complete_creation() + void group::init() { - panel::_m_complete_creation(); - - impl_->create(handle()); - this->div(nullptr); auto & outter = impl_->place_content; @@ -127,6 +145,16 @@ namespace nana{ }); } + void group::_m_complete_creation() + { + panel::_m_complete_creation(); + + impl_->create(handle()); + + + init(); + } + ::nana::string group::_m_caption() const { return impl_->caption.caption(); From 7bd336dc438b6750856c397e0027ccdcf4eabd4b Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 19 Jul 2015 02:43:43 +0200 Subject: [PATCH 3/4] FIX: a background artifact --- source/gui/widgets/group.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gui/widgets/group.cpp b/source/gui/widgets/group.cpp index ddde3b1d..9ce29739 100644 --- a/source/gui/widgets/group.cpp +++ b/source/gui/widgets/group.cpp @@ -126,7 +126,7 @@ namespace nana{ impl_->caption.bgcolor(pbg.blend(colors::black, 0.975)); color bg = pbg.blend(colors::black, 0.950); - bgcolor(pbg); + bgcolor(bg); drawing dw(*this); From b92e391b62323a76638cb30f0cf27dc9590f2ec7 Mon Sep 17 00:00:00 2001 From: qPCR4vir Date: Sun, 19 Jul 2015 02:45:09 +0200 Subject: [PATCH 4/4] FIX: eliminate a default group label "panel widget" --> "" --- source/gui/widgets/group.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/gui/widgets/group.cpp b/source/gui/widgets/group.cpp index 9ce29739..aae4a58c 100644 --- a/source/gui/widgets/group.cpp +++ b/source/gui/widgets/group.cpp @@ -31,6 +31,7 @@ namespace nana{ void create(window pnl) { caption.create(pnl); + caption.caption(STR("")); place_content.bind(pnl); }