add clear() to treebox
This commit is contained in:
parent
cfe97c3cfd
commit
281e92eb59
@ -421,6 +421,9 @@ namespace nana
|
|||||||
|
|
||||||
bool checkable() const; ///< Determinte whether the checkboxs are enabled.
|
bool checkable() const; ///< Determinte whether the checkboxs are enabled.
|
||||||
|
|
||||||
|
/// Clears the contents
|
||||||
|
void clear();
|
||||||
|
|
||||||
/// \brief Creates an icon scheme with the specified name.
|
/// \brief Creates an icon scheme with the specified name.
|
||||||
///
|
///
|
||||||
/// The icon scheme includes 3 images for node states.
|
/// The icon scheme includes 3 images for node states.
|
||||||
|
@ -866,8 +866,7 @@ namespace nana
|
|||||||
item_proxy& item_proxy::check(bool ck)
|
item_proxy& item_proxy::check(bool ck)
|
||||||
{
|
{
|
||||||
trigger_->check(node_, ck ? checkstate::checked : checkstate::unchecked);
|
trigger_->check(node_, ck ? checkstate::checked : checkstate::unchecked);
|
||||||
if(trigger_->draw())
|
trigger_->draw();
|
||||||
API::update_window(trigger_->impl()->data.widget_ptr->handle());
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1664,7 +1663,8 @@ namespace nana
|
|||||||
if (!impl_->attr.auto_draw)
|
if (!impl_->attr.auto_draw)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
impl_->draw(false);
|
if(impl_->draw(false))
|
||||||
|
API::update_window(impl_->data.widget_ptr->handle());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2198,6 +2198,13 @@ namespace nana
|
|||||||
return get_drawer_trigger().checkable();
|
return get_drawer_trigger().checkable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void treebox::clear()
|
||||||
|
{
|
||||||
|
auto impl = get_drawer_trigger().impl();
|
||||||
|
impl->attr.tree_cont.clear();
|
||||||
|
get_drawer_trigger().draw();
|
||||||
|
}
|
||||||
|
|
||||||
treebox::node_image_type& treebox::icon(const std::string& id) const
|
treebox::node_image_type& treebox::icon(const std::string& id) const
|
||||||
{
|
{
|
||||||
return get_drawer_trigger().icon(id);
|
return get_drawer_trigger().icon(id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user