add a method to return first node of treebox

This commit is contained in:
Jinhao 2020-04-21 05:48:07 +08:00
parent e6a75746ad
commit 90789e428c
2 changed files with 8 additions and 0 deletions

View File

@ -515,6 +515,8 @@ namespace nana
*/
void use_entire_line(bool enable);
/// Return the first node of treebox
item_proxy first() const;
private:
std::shared_ptr<scroll_operation_interface> _m_scroll_operation() override;

View File

@ -2465,6 +2465,12 @@ namespace nana
dw->impl()->use_entire_line = enable;
}
auto treebox::first() const -> item_proxy
{
auto impl = get_drawer_trigger().impl();
return item_proxy{ const_cast<drawer_trigger_t*>(&get_drawer_trigger()), impl->attr.tree_cont.get_root()->child };
}
std::shared_ptr<scroll_operation_interface> treebox::_m_scroll_operation()
{
internal_scope_guard lock;