Struct winsafe::gui::spec::ListViewItem
source · pub struct ListViewItem<'a, T: 'static = ()> { /* private fields */ }
gui
only.Expand description
A single item of a ListView
control.
Note: Each object keeps the zero-based index of an item. If new items are added/removed from the list view control, the object may then point to a different item.
You cannot directly instantiate this object, it is created internally by the control.
Implementations§
source§impl<'a, T> ListViewItem<'a, T>
impl<'a, T> ListViewItem<'a, T>
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 an
lvm::DeleteItem
message.
sourcepub fn ensure_visible(&self)
pub fn ensure_visible(&self)
Scrolls the list by sending an
lvm::EnsureVisible
message so that
the item is visible in the list.
sourcepub fn focus(&self)
pub fn focus(&self)
Sets the item as the focused one sending an
lvm:SetItemState
message.
sourcepub fn icon_index(&self) -> Option<u32>
pub fn icon_index(&self) -> Option<u32>
Retrieves the icon index of the item by sending an
lvm::GetItem
message.
sourcepub fn is_focused(&self) -> bool
pub fn is_focused(&self) -> bool
Tells if the item is the focused one by sending an
lvm::GetItemState
message.
sourcepub fn is_selected(&self) -> bool
pub fn is_selected(&self) -> bool
Tells if the item is selected by sending an
lvm::GetItemState
message.
sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Tells if the item is currently visible by sending an
lvm::IsItemVisible
message.
sourcepub fn map_index_to_id(&self) -> u32
pub fn map_index_to_id(&self) -> u32
Retrieves the unique ID for the item index by sending an
lvm::MapIndexToId
message.
If the item index has became invalid, returns None
.
sourcepub fn rect(&self, portion: LVIR) -> RECT
pub fn rect(&self, portion: LVIR) -> RECT
Retrieves the bound rectangle of item by sending an
lvm::GetItemRect
message.
sourcepub fn select(&self, set: bool)
pub fn select(&self, set: bool)
Sets or removes the selection from the item by sending an
lvm::SetItemState
message.
sourcepub fn set_icon_index(&self, icon_index: Option<u32>)
pub fn set_icon_index(&self, icon_index: Option<u32>)
Sets the icon index of the item by sending an
lvm::SetItem
message.
sourcepub fn set_text(&self, column_index: u32, text: &str)
pub fn set_text(&self, column_index: u32, text: &str)
Sets the text of the item under a column by sending an
lvm::SetItemText
message.
sourcepub fn text(&self, column_index: u32) -> String
pub fn text(&self, column_index: u32) -> String
Retrieves the text of an item under a column by sending an
lvm::GetItemText
message.