Struct winsafe::gui::events::ListViewEvents

source ·
pub struct ListViewEvents(/* private fields */);
Available on crate feature gui only.
Expand description

Exposes list view control notifications.

These event methods are just proxies to the WindowEvents of the parent window, who is the real responsible for the child event handling.

You cannot directly instantiate this object, it is created internally by the control.

Implementations§

source§

impl ListViewEvents

source

pub fn lvn_begin_drag<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

LVN_BEGINDRAG notification.

source

pub fn lvn_begin_label_edit<F>(&self, func: F)
where F: Fn(&NMLVDISPINFO<'_>) -> AnyResult<bool> + 'static,

LVN_BEGINLABELEDIT notification.

source

pub fn lvn_begin_r_drag<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

LVN_BEGINRDRAG notification.

source

pub fn lvn_begin_scroll<F>(&self, func: F)
where F: Fn(&NMLVSCROLL) -> AnyResult<()> + 'static,

LVN_BEGINSCROLL notification.

source

pub fn lvn_column_click<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

LVN_COLUMNCLICK notification.

source

pub fn lvn_column_drop_down<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

LVN_COLUMNDROPDOWN notification.

source

pub fn lvn_column_overflow_click<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

source

pub fn lvn_delete_all_items<F>(&self, func: F)
where F: Fn() -> AnyResult<bool> + 'static,

LVN_DELETEALLITEMS notification.

§Examples
use winsafe::{self as w, prelude::*, gui};

let wnd: gui::WindowMain; // initialized somewhere
let list: gui::ListView;

list.on().lvn_delete_all_items(
    move || -> w::AnyResult<bool> {
        println!("All items deleted.");
        Ok(true) // supress subsequent WM_DELETEITEM notifications
    },
);
source

pub fn lvn_delete_item<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

LVN_DELETEITEM notification.

§Examples
use winsafe::{self as w, prelude::*, gui};

let wnd: gui::WindowMain; // initialized somewhere
let list: gui::ListView;

list.on().lvn_delete_item(
    move |p: &w::NMLISTVIEW| -> w::AnyResult<()> {
        println!("Item: {}", p.iItem);
        Ok(())
    },
);
source

pub fn lvn_end_label_edit<F>(&self, func: F)
where F: Fn(&NMLVDISPINFO<'_>) -> AnyResult<bool> + 'static,

LVN_ENDLABELEDIT notification.

source

pub fn lvn_end_scroll<F>(&self, func: F)
where F: Fn(&NMLVSCROLL) -> AnyResult<()> + 'static,

LVN_ENDSCROLL notification.

source

pub fn lvn_get_disp_info<F>(&self, func: F)
where F: Fn(&mut NMLVDISPINFO<'_>) -> AnyResult<()> + 'static,

LVN_GETDISPINFO notification.

source

pub fn lvn_get_empty_markup<F>(&self, func: F)
where F: Fn(&mut NMLVEMPTYMARKUP) -> AnyResult<bool> + 'static,

LVN_GETEMPTYMARKUP notification.

source

pub fn lvn_get_info_tip<F>(&self, func: F)
where F: Fn(&NMLVGETINFOTIP<'_>) -> AnyResult<()> + 'static,

LVN_GETINFOTIP notification.

source

pub fn lvn_hot_track<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

LVN_HOTTRACK notification.

LVN_INCREMENTALSEARCH notification.

source

pub fn lvn_insert_item<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

LVN_INSERTITEM notification.

source

pub fn lvn_item_activate<F>(&self, func: F)
where F: Fn(&NMITEMACTIVATE) -> AnyResult<()> + 'static,

LVN_ITEMACTIVATE notification.

source

pub fn lvn_item_changed<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<()> + 'static,

LVN_ITEMCHANGED notification.

§Examples
use winsafe::{self as w, prelude::*, gui};

let wnd: gui::WindowMain; // initialized somewhere
let list: gui::ListView;

list.on().lvn_item_changed(
    move |p: &w::NMLISTVIEW| -> w::AnyResult<()> {
        println!("Item: {}", p.iItem);
        Ok(())
    },
);
source

pub fn lvn_item_changing<F>(&self, func: F)
where F: Fn(&NMLISTVIEW) -> AnyResult<bool> + 'static,

LVN_ITEMCHANGING notification.

source

pub fn lvn_key_down<F>(&self, func: F)
where F: Fn(&NMLVKEYDOWN) -> AnyResult<()> + 'static,

LVN_KEYDOWN notification.

§Examples
use winsafe::{self as w, prelude::*, co, gui};

let wnd: gui::WindowMain; // initialized somewhere
let list: gui::ListView;

list.on().lvn_key_down(
    move |p: &w::NMLVKEYDOWN| -> w::AnyResult<()> {
        if p.wVKey == co::VK::DELETE {
            println!("DEL key was pressed.");
        }
        Ok(())
    },
);

LVN_LINKCLICK notification.

source

pub fn lvn_marquee_begin<F>(&self, func: F)
where F: Fn() -> AnyResult<()> + 'static,

LVN_MARQUEEBEGIN notification.

source

pub fn lvn_od_cache_hint<F>(&self, func: F)
where F: Fn(&NMLVCACHEHINT) -> AnyResult<()> + 'static,

LVN_ODCACHEHINT notification.

source

pub fn lvn_od_find_item<F>(&self, func: F)
where F: Fn(&mut NMLVFINDITEM<'_>) -> AnyResult<Option<u32>> + 'static,

LVN_ODFINDITEM notification.

source

pub fn lvn_od_state_changed<F>(&self, func: F)
where F: Fn(&NMLVODSTATECHANGE) -> AnyResult<()> + 'static,

LVN_ODSTATECHANGED notification.

source

pub fn lvn_set_disp_info<F>(&self, func: F)
where F: Fn(&NMLVDISPINFO<'_>) -> AnyResult<()> + 'static,

LVN_SETDISPINFO notification.

source

pub fn nm_click<F>(&self, func: F)
where F: Fn(&NMITEMACTIVATE) -> AnyResult<()> + 'static,

NM_CLICK notification.

source

pub fn nm_custom_draw<F>(&self, func: F)
where F: Fn(&mut NMLVCUSTOMDRAW) -> AnyResult<CDRF> + 'static,

NM_CUSTOMDRAW notification.

source

pub fn nm_dbl_clk<F>(&self, func: F)
where F: Fn(&NMITEMACTIVATE) -> AnyResult<()> + 'static,

NM_DBLCLK notification.

source

pub fn nm_hover<F>(&self, func: F)
where F: Fn() -> AnyResult<i32> + 'static,

NM_HOVER notification.

source

pub fn nm_kill_focus<F>(&self, func: F)
where F: Fn() -> AnyResult<()> + 'static,

NM_KILLFOCUS notification.

source

pub fn nm_r_click<F>(&self, func: F)
where F: Fn(&NMITEMACTIVATE) -> AnyResult<i32> + 'static,

NM_RCLICK notification.

source

pub fn nm_r_dbl_clk<F>(&self, func: F)
where F: Fn(&NMITEMACTIVATE) -> AnyResult<()> + 'static,

NM_RDBLCLK notification.

source

pub fn nm_released_capture<F>(&self, func: F)
where F: Fn() -> AnyResult<()> + 'static,

NM_RELEASEDCAPTURE notification.

source

pub fn nm_return<F>(&self, func: F)
where F: Fn() -> AnyResult<()> + 'static,

NM_RETURN notification.

source

pub fn nm_set_focus<F>(&self, func: F)
where F: Fn() -> AnyResult<()> + 'static,

NM_SETFOCUS notification.

Trait Implementations§

source§

impl<T> GuiNativeControlEvents<ListViewEvents> for ListView<T>

source§

fn on(&self) -> &ListViewEvents

Exposes the specific control events. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.