The construction that creates the widget and set the title or caption
This commit is contained in:
@@ -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_;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -33,6 +33,14 @@ namespace nana{
|
|||||||
caption.create(pnl);
|
caption.create(pnl);
|
||||||
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 +54,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 +113,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;
|
||||||
@@ -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
|
::nana::string group::_m_caption() const
|
||||||
{
|
{
|
||||||
return impl_->caption.caption();
|
return impl_->caption.caption();
|
||||||
|
|||||||
Reference in New Issue
Block a user