pub struct TreeView<T: 'static = ()>(/* private fields */);
gui
only.Expand description
Native tree view control.
The generic parameter specifies the type of the object that will be embedded
on each item – if you don’t want to store anything, just use ()
as the
type. Internally, this storage is implemented with pointers in the item’s
LPARAM
fields.
Implementations§
source§impl<T> TreeView<T>
impl<T> TreeView<T>
sourcepub fn new(parent: &impl GuiParent, opts: TreeViewOpts) -> Self
pub fn new(parent: &impl GuiParent, opts: TreeViewOpts) -> Self
Instantiates a new TreeView
object, to be created on the parent window
with
HWND::CreateWindowEx
.
§Panics
Panics if the parent window was already created – that is, you cannot
dynamically create a TreeView
in an event closure.
sourcepub fn new_dlg(
parent: &impl GuiParent,
ctrl_id: u16,
resize_behavior: (Horz, Vert)
) -> Self
pub fn new_dlg( parent: &impl GuiParent, ctrl_id: u16, resize_behavior: (Horz, Vert) ) -> Self
Instantiates a new TreeView
object, to be loaded from a dialog
resource with
HWND::GetDlgItem
.
§Panics
Panics if the parent dialog was already created – that is, you cannot
dynamically create a TreeView
in an event closure.
sourcepub fn image_list(&self, kind: TVSIL) -> Option<&HIMAGELIST>
pub fn image_list(&self, kind: TVSIL) -> Option<&HIMAGELIST>
Retrieves a reference to one of the associated image lists by sending a
tvm::GetImageList
message.
The image list is owned by the control.
sourcepub const fn items(&self) -> TreeViewItems<'_, T>
pub const fn items(&self) -> TreeViewItems<'_, T>
Exposes the item methods.
sourcepub fn set_extended_style(&self, set: bool, ex_style: TVS_EX)
pub fn set_extended_style(&self, set: bool, ex_style: TVS_EX)
Sets or unsets the given extended list view styles by sending a
tvm::SetExtendedStyle
message.
sourcepub fn set_image_list(
&self,
kind: TVSIL,
himagelist: ImageListDestroyGuard
) -> Option<ImageListDestroyGuard>
pub fn set_image_list( &self, kind: TVSIL, himagelist: ImageListDestroyGuard ) -> Option<ImageListDestroyGuard>
Sets the one of the associated image lists by sending a
tvm::SetImageList
message.
The image list will be owned by the control. Returns the previous one, if any.
Trait Implementations§
source§impl<T> GuiChildFocus for TreeView<T>
impl<T> GuiChildFocus for TreeView<T>
source§fn focus(&self)
fn focus(&self)
HWND:SetFocus
. Read more