ferroui-base 0.3.0

The base library of FerroUI: the property system, layout, input, styling, media, text, animation, data binding and the compositor
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::interactivity::RoutedEventArgs;
use crate::reactive::IDisposable;
use std::rc::Rc;

/// A control that can be clicked: what the access key and hot key handling
/// needs from a button-like control.
pub trait IClickableControl {
    /// Raised when the control is clicked. Disposing the returned handle
    /// unsubscribes.
    fn click(&self, handler: Rc<dyn Fn(&RoutedEventArgs)>) -> Rc<dyn IDisposable>;

    /// Raises the click of the control.
    fn raise_click(&self);

    /// Gets a value indicating whether this control and all its parents are
    /// enabled.
    fn is_effectively_enabled(&self) -> bool;
}