Struct winsafe::gui::spec::TreeViewItem
source · pub struct TreeViewItem<'a, T: 'static = ()> { /* private fields */ }
gui
only.Expand description
Implementations§
source§impl<'a, T> TreeViewItem<'a, T>
impl<'a, T> TreeViewItem<'a, T>
sourcepub fn add_child(&self, text: &str, icon_index: Option<u32>, data: T) -> Self
pub fn add_child(&self, text: &str, icon_index: Option<u32>, data: T) -> Self
Adds a new child item by sending a
tvm::InsertItem
message, and returns
the newly added item.
sourcepub fn data(&self) -> Option<Rc<RefCell<T>>>
pub fn data(&self) -> Option<Rc<RefCell<T>>>
Returns a Rc
/RefCell
with the
stored data by sending an lvm::GetItem
message.
Returns None
if the ListView
holds a ()
, or if the item holds an
invalid index.
sourcepub fn delete(&self)
pub fn delete(&self)
Deletes the item by sending a
tvm::DeleteItem
message.
sourcepub fn edit_label(&self) -> HWND
pub fn edit_label(&self) -> HWND
Begins in-place editing of the item’s text by sending a
tvm::EditLabel
message.
Returns a handle to the edit control.
sourcepub fn ensure_visible(&self) -> bool
pub fn ensure_visible(&self) -> bool
Ensures that a tree-view item is visible, expanding the parent item or
scrolling the tree-view control, if necessary, by sending a
tvm::EnsureVisible
message.
Returns whether a scroll occurred and no items were expanded.
sourcepub fn expand(&self, expand: bool)
pub fn expand(&self, expand: bool)
Expands or collapse the item by sending a
tvm::Expand
message.
sourcepub fn is_expanded(&self) -> bool
pub fn is_expanded(&self) -> bool
Tells if the item is expanded by sending a
tvm::GetItemState
message.
sourcepub fn is_root(&self) -> bool
pub fn is_root(&self) -> bool
Tells if the item is a root by sending a
tvm::GetNextItem
message.
sourcepub fn iter_children(&self) -> impl Iterator<Item = TreeViewItem<'a, T>> + 'a
pub fn iter_children(&self) -> impl Iterator<Item = TreeViewItem<'a, T>> + 'a
Returns an iterator over the child items.
sourcepub fn iter_next_siblings(
&self
) -> impl Iterator<Item = TreeViewItem<'a, T>> + 'a
pub fn iter_next_siblings( &self ) -> impl Iterator<Item = TreeViewItem<'a, T>> + 'a
Returns an iterator over the next sibling items.
sourcepub fn iter_prev_siblings(
&self
) -> impl Iterator<Item = TreeViewItem<'a, T>> + 'a
pub fn iter_prev_siblings( &self ) -> impl Iterator<Item = TreeViewItem<'a, T>> + 'a
Returns an iterator over the previous sibling items.
sourcepub fn parent(&self) -> Option<Self>
pub fn parent(&self) -> Option<Self>
Retrieves the parent of the item by sending a
tvm::GetNextItem
message.
sourcepub fn set_text(&self, text: &str)
pub fn set_text(&self, text: &str)
Sets the text of the item by sending a
tvm::SetItem
message.
sourcepub fn text(&self) -> String
pub fn text(&self) -> String
Retrieves the text of the item by sending a
tvm::GetItem
message.