Merge branch 'qPCRvir-develop' into develop

This commit is contained in:
Jinhao 2015-07-19 13:18:05 +08:00
commit 13674fdc48
4 changed files with 52 additions and 11 deletions

View File

@ -34,6 +34,17 @@ namespace nana{
/// The construction that creates the widget /// The construction that creates the widget
group(window parent, const rectangle& = {}, bool visible = true); 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 /// The destruction
~group(); ~group();
@ -60,6 +71,7 @@ namespace nana{
void _m_complete_creation() override; void _m_complete_creation() override;
::nana::string _m_caption() const override; ::nana::string _m_caption() const override;
void _m_caption(::nana::string&&) override; void _m_caption(::nana::string&&) override;
void init();
private: private:
std::unique_ptr<implement> impl_; std::unique_ptr<implement> impl_;
}; };

View File

@ -31,7 +31,7 @@ namespace nana
void unknown(bool); void unknown(bool);
bool unknown() const; bool unknown() const;
bool stop(bool s = true); bool stop(bool s = true);
bool stoped() const; bool stopped() const;
private: private:
void attached(widget_reference, graph_reference) override; void attached(widget_reference, graph_reference) override;
void refresh(graph_reference) override; void refresh(graph_reference) override;
@ -71,7 +71,7 @@ namespace nana
void unknown(bool); void unknown(bool);
bool unknown() const; bool unknown() const;
bool stop(bool s=true); ///< request stop or cancel and return previus stop status bool stop(bool s=true); ///< request stop or cancel and return previus stop status
bool stoped() const; bool stopped() const;
}; };
}//end namespace nana }//end namespace nana
#endif #endif

View File

@ -31,8 +31,17 @@ namespace nana{
void create(window pnl) void create(window pnl)
{ {
caption.create(pnl); caption.create(pnl);
caption.caption(STR(""));
place_content.bind(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() group::group()
@ -46,6 +55,20 @@ namespace nana{
create(parent, r, vsb); 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() group::~group()
{ {
@ -91,12 +114,8 @@ namespace nana{
impl_->place_content[field] << wdg->handle(); impl_->place_content[field] << wdg->handle();
} }
void group::_m_complete_creation() void group::init()
{ {
panel::_m_complete_creation();
impl_->create(handle());
this->div(nullptr); this->div(nullptr);
auto & outter = impl_->place_content; auto & outter = impl_->place_content;
@ -108,7 +127,7 @@ namespace nana{
impl_->caption.bgcolor(pbg.blend(colors::black, 0.975)); impl_->caption.bgcolor(pbg.blend(colors::black, 0.975));
color bg = pbg.blend(colors::black, 0.950); color bg = pbg.blend(colors::black, 0.950);
bgcolor(pbg); bgcolor(bg);
drawing dw(*this); drawing dw(*this);
@ -127,6 +146,16 @@ namespace nana{
}); });
} }
void group::_m_complete_creation()
{
panel::_m_complete_creation();
impl_->create(handle());
init();
}
::nana::string group::_m_caption() const ::nana::string group::_m_caption() const
{ {
return impl_->caption.caption(); return impl_->caption.caption();

View File

@ -89,7 +89,7 @@ namespace nana
{ {
return unknown_; return unknown_;
} }
bool trigger::stoped() const bool trigger::stopped() const
{ {
return stop_; return stop_;
} }
@ -210,9 +210,9 @@ namespace nana
{ {
return get_drawer_trigger().stop(s); 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 class progress
}//end namespace nana }//end namespace nana