add treebox.horvered method
This commit is contained in:
parent
8b2dc1eddd
commit
5320ead6bd
@ -480,6 +480,8 @@ namespace nana
|
|||||||
*/
|
*/
|
||||||
void scroll_into_view(item_proxy item);
|
void scroll_into_view(item_proxy item);
|
||||||
|
|
||||||
|
/// Gets the current hovered node.
|
||||||
|
item_proxy hovered(bool exclude_expander) const;
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<scroll_operation_interface> _m_scroll_operation() override;
|
std::shared_ptr<scroll_operation_interface> _m_scroll_operation() override;
|
||||||
|
|
||||||
|
|||||||
@ -2371,6 +2371,19 @@ namespace nana
|
|||||||
API::refresh_window(*this);
|
API::refresh_window(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
treebox::item_proxy treebox::hovered(bool exclude_expander) const
|
||||||
|
{
|
||||||
|
internal_scope_guard lock;
|
||||||
|
auto dw = &get_drawer_trigger();
|
||||||
|
if (dw->impl()->node_state.pointed)
|
||||||
|
{
|
||||||
|
//Returns empty item_proxy if the mouse is on expander and exclude_expander is required.
|
||||||
|
if (exclude_expander && (dw->impl()->node_state.comp_pointed == drawerbase::treebox::component::expander))
|
||||||
|
return item_proxy{};
|
||||||
|
}
|
||||||
|
return item_proxy(const_cast<drawer_trigger_t*>(dw), dw->impl()->node_state.pointed);
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<scroll_operation_interface> treebox::_m_scroll_operation()
|
std::shared_ptr<scroll_operation_interface> treebox::_m_scroll_operation()
|
||||||
{
|
{
|
||||||
internal_scope_guard lock;
|
internal_scope_guard lock;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user