Enum EventData

Source
pub enum EventData {
Show 15 variants NoData, OnWindowClose(WindowCloseData), OnMinMaxInfo(MinMaxInfo), OnTooltipText(ToolTipTextData), OnChar(char), OnKey(u32), OnPaint(PaintData), OnMouseWheel(i32), OnFileDrop(DropFiles), OnTreeItemDelete(TreeItem), OnTreeItemUpdate { item: TreeItem, action: TreeItemAction, }, OnTreeViewEndItemEdit { f_cancel: bool, new_text: String, }, OnTreeItemSelectionChanged { old: TreeItem, new: TreeItem, }, OnListViewItemIndex { row_index: usize, column_index: usize, }, OnListViewItemChanged { row_index: usize, column_index: usize, selected: bool, },
}
Expand description

Events data sent by the controls.

Variants§

§

NoData

The event has no data

§

OnWindowClose(WindowCloseData)

Sets if the window should be closed after the event

§

OnMinMaxInfo(MinMaxInfo)

Contains the default maximized position and dimensions, and the default minimum and maximum tracking sizes. An application can override the defaults by setting the members of this event.

§

OnTooltipText(ToolTipTextData)

Sets the text of a tooltip. The method on_tooltip_text should be used to access the inner data

§

OnChar(char)

The character entered by a user by an OnChar event

§

OnKey(u32)

The windows key code entered by a user. See the nwg::keys module

§

OnPaint(PaintData)

Hold resources that will most likely be used during painting.

§

OnMouseWheel(i32)

The delta value of a mouse wheel event. A positive value indicates that the wheel was rotated to the right; a negative value indicates that the wheel was rotated to the left.

§

OnFileDrop(DropFiles)

The path to one or more files that were dropped in the application

§

OnTreeItemDelete(TreeItem)

The handle to the item being deleted. The item is still valid.

§

OnTreeItemUpdate

The handle to the item being changed.

Fields

§

OnTreeViewEndItemEdit

When ends the editing of a treeview item’s label.

Fields

§f_cancel: bool
§new_text: String
§

OnTreeItemSelectionChanged

The handles the the old item and the new item.

Fields

§

OnListViewItemIndex

Row index and column index of the list view item that raised the event row_index 0xFFF... means the absence of an item

Fields

§row_index: usize
§column_index: usize
§

OnListViewItemChanged

Row index, column index, and selected state of the list view item that raised the event

Fields

§row_index: usize
§column_index: usize
§selected: bool

Implementations§

Source§

impl EventData

Source

pub fn on_paint(&self) -> &PaintData

Unwraps event data into a &PaintData. Panics if it’s not the right type.

Source

pub fn on_min_max(&self) -> &MinMaxInfo

Unwraps event data into a &MinMaxInfo. Panics if it’s not the right type.

Source

pub fn on_char(&self) -> char

Unwraps event data into a char. Panics if it’s not the right type.

Source

pub fn on_tooltip_text(&self) -> &ToolTipTextData

Unwraps event data into a &ToolTipTextData. Panics if it’s not the right type.

Source

pub fn on_file_drop(&self) -> &DropFiles

Unwraps event data into a &DragData. Panics if it’s not the right type.

Source

pub fn on_key(&self) -> u32

Unwraps event data into the virtual key code for OnKeyPress and OnKeyRelease

Source

pub fn on_tree_item_delete(&self) -> &TreeItem

unwraps event data into the removed tree item

Source

pub fn on_tree_item_update(&self) -> (&TreeItem, TreeItemAction)

unwraps event data into the update tree view item and the action

Source

pub fn on_tree_item_selection_changed(&self) -> (&TreeItem, &TreeItem)

unwraps event data into the removed tree item

Source

pub fn on_tree_view_end_item_edit(&self) -> (bool, String)

unwraps event data into f_cancel, new_text. f_cancel indicates the editing is cancel or not. new_text is the new input text when editing is not cancel.

Source

pub fn on_list_view_item_index(&self) -> (usize, usize)

unwraps event data into the indices of a list view index (row_index, column_index)

Source

pub fn on_list_view_item_changed(&self) -> (usize, usize, bool)

unwraps event data into the indices of a list view index (row_index, column_index, selected)

Trait Implementations§

Source§

impl Debug for EventData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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>,

Source§

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>,

Source§

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.