Struct winsafe::gui::events::ButtonEvents[][src]

pub struct ButtonEvents { /* fields omitted */ }
Expand description

Exposes button 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

BCN_DROPDOWN notification.

Sent when the user clicks a drop down arrow on a button.

BCN_HOTITEMCHANGE notification.

Notifies the button control owner that the mouse is entering or leaving the client area of the button control.

BN_CLICKED command notification.

Sent when the user clicks a button.

Examples

use winsafe::{gui, BoxResult};

let btn: gui::Button; // initialized somewhere

btn.on().bn_clicked({
    let btn = btn.clone(); // pass into the closure
    move || -> BoxResult<()> {
        println!("HWND: {}", btn.hwnd());
        Ok(())
    }
});

BN_DBLCLK command notification.

Sent when the user double-clicks a button. This notification code is sent automatically for BS::USERBUTTON, BS::RADIOBUTTON, and BS::OWNERDRAW buttons. Other button types send only if they have the BS::NOTIFY style.

BN_KILLFOCUS command notification.

Sent when a button loses the keyboard focus. The button must have the BS::NOTIFY style to send this notification code.

BN_SETFOCUS command notification.

Sent when a button receives the keyboard focus. The button must have the BS::NOTIFY style to send this notification code.

NM_CUSTOMDRAW notification.

Notifies about custom draw operations on the button.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.