pub struct ListView<T: 'static = ()>(/* private fields */);
gui
only.Expand description
Native list view control. Not to be confused with the simpler list box 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.
You can have access to the internal header of the list view by creating a
Header
object.
Implementations§
source§impl<T> ListView<T>
impl<T> ListView<T>
sourcepub fn new(parent: &impl GuiParent, opts: ListViewOpts) -> Self
pub fn new(parent: &impl GuiParent, opts: ListViewOpts) -> Self
Instantiates a new ListView
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 ListView
in an event closure.
sourcepub fn new_dlg(
parent: &impl GuiParent,
ctrl_id: u16,
resize_behavior: (Horz, Vert),
context_menu_id: Option<u16>
) -> Self
pub fn new_dlg( parent: &impl GuiParent, ctrl_id: u16, resize_behavior: (Horz, Vert), context_menu_id: Option<u16> ) -> Self
Instantiates a new ListView
object, to be loaded from a dialog
resource with
HWND::GetDlgItem
.
Since the image list is always managed by the control itself,
LVS::SHAREIMAGELISTS
style will
always be added.
§Panics
Panics if the parent dialog was already created – that is, you cannot
dynamically create a ListView
in an event closure.
Panics if the context menu, when specified, does not exist.
sourcepub const fn columns(&self) -> ListViewColumns<'_, T>
pub const fn columns(&self) -> ListViewColumns<'_, T>
Exposes the column methods.
Returns the context menu attached to this list view, if any.
The context menu is attached when the list view is created, either by
calling ListView::new
or
ListView::new_dlg
.
sourcepub fn image_list(&self, kind: LVSIL) -> Option<&HIMAGELIST>
pub fn image_list(&self, kind: LVSIL) -> Option<&HIMAGELIST>
Retrieves a reference to one of the associated image lists by sending an
lvm::GetImageList
message.
The image list is owned by the control.
sourcepub const fn items(&self) -> ListViewItems<'_, T>
pub const fn items(&self) -> ListViewItems<'_, T>
Exposes the item methods.
sourcepub fn current_view(&self) -> LV_VIEW
pub fn current_view(&self) -> LV_VIEW
Retrieves the current view by sending an
lvm::GetView
message.
sourcepub fn set_current_view(&self, view: LV_VIEW)
pub fn set_current_view(&self, view: LV_VIEW)
Sets the current view by sending an
lvm::SetView
message.
sourcepub fn set_extended_style(&self, set: bool, ex_style: LVS_EX)
pub fn set_extended_style(&self, set: bool, ex_style: LVS_EX)
Sets or unsets the given extended list view styles by sending an
lvm::SetExtendedListViewStyle
message.
sourcepub fn set_image_list(
&self,
kind: LVSIL,
himagelist: ImageListDestroyGuard
) -> Option<ImageListDestroyGuard>
pub fn set_image_list( &self, kind: LVSIL, himagelist: ImageListDestroyGuard ) -> Option<ImageListDestroyGuard>
Sets the one of the associated image lists by sending an
lvm::SetImageList
message.
The image list will be owned by the control. Returns the previous one, if any.
sourcepub fn set_redraw(&self, can_redraw: bool)
pub fn set_redraw(&self, can_redraw: bool)
Allows or disallows the redrawing of the control by sending a
wm::SetRedraw
message.
Trait Implementations§
source§impl<T> GuiChildFocus for ListView<T>
impl<T> GuiChildFocus for ListView<T>
source§fn focus(&self)
fn focus(&self)
HWND:SetFocus
. Read more