Trait carbide_core::event::event::Event[][src]

pub trait Event<S>: CommonWidget<S> + StateSync<S> where
    S: GlobalState
{ fn handle_mouse_event(
        &mut self,
        event: &MouseEvent,
        consumed: &bool,
        env: &mut Environment<S>,
        global_state: &mut S
    );
fn handle_keyboard_event(
        &mut self,
        event: &KeyboardEvent,
        env: &mut Environment<S>,
        global_state: &mut S
    );
fn handle_other_event(&mut self, event: &WidgetEvent);
fn process_mouse_event(
        &mut self,
        event: &MouseEvent,
        consumed: &bool,
        env: &mut Environment<S>,
        global_state: &mut S
    );
fn process_keyboard_event(
        &mut self,
        event: &KeyboardEvent,
        env: &mut Environment<S>,
        global_state: &mut S
    );
fn process_other_event(
        &mut self,
        event: &WidgetEvent,
        env: &mut Environment<S>,
        global_state: &mut S
    ); fn process_mouse_event_default(
        &mut self,
        event: &MouseEvent,
        consumed: &bool,
        env: &mut Environment<S>,
        global_state: &mut S
    ) { ... }
fn process_keyboard_event_default(
        &mut self,
        event: &KeyboardEvent,
        env: &mut Environment<S>,
        global_state: &mut S
    ) { ... }
fn process_other_event_default(
        &mut self,
        event: &WidgetEvent,
        env: &mut Environment<S>,
        global_state: &mut S
    ) { ... } }

Required methods

fn handle_mouse_event(
    &mut self,
    event: &MouseEvent,
    consumed: &bool,
    env: &mut Environment<S>,
    global_state: &mut S
)
[src]

A function that will be called when a mouse event occurs. It will only get called on the events where the cursor is inside. Return true if the event is consumed, and will thus not be delegated to other widgets.

fn handle_keyboard_event(
    &mut self,
    event: &KeyboardEvent,
    env: &mut Environment<S>,
    global_state: &mut S
)
[src]

A function that will get called when a keyboard event occurs. This event will be given to all widgets, no matter if they are in focus or not. This is because the focus will be decided by the widgets themselves.

fn handle_other_event(&mut self, event: &WidgetEvent)[src]

This will get called if there are event that are not covered by the other functions. This will get delegated to all widgets. It will never get called with mouse or keyboard events. TODO: Separate touch events. And add global state

fn process_mouse_event(
    &mut self,
    event: &MouseEvent,
    consumed: &bool,
    env: &mut Environment<S>,
    global_state: &mut S
)
[src]

fn process_keyboard_event(
    &mut self,
    event: &KeyboardEvent,
    env: &mut Environment<S>,
    global_state: &mut S
)
[src]

fn process_other_event(
    &mut self,
    event: &WidgetEvent,
    env: &mut Environment<S>,
    global_state: &mut S
)
[src]

Loading content...

Provided methods

fn process_mouse_event_default(
    &mut self,
    event: &MouseEvent,
    consumed: &bool,
    env: &mut Environment<S>,
    global_state: &mut S
)
[src]

fn process_keyboard_event_default(
    &mut self,
    event: &KeyboardEvent,
    env: &mut Environment<S>,
    global_state: &mut S
)
[src]

fn process_other_event_default(
    &mut self,
    event: &WidgetEvent,
    env: &mut Environment<S>,
    global_state: &mut S
)
[src]

Loading content...

Implementations on Foreign Types

impl<S: GlobalState> Event<S> for Box<dyn Widget<S>>[src]

Loading content...

Implementors

impl<GS: GlobalState> Event<GS> for SyncTest<GS>[src]

impl<GS: GlobalState> Event<GS> for Border<GS>[src]

impl<GS: GlobalState> Event<GS> for Canvas[src]

impl<GS: GlobalState> Event<GS> for Clip<GS>[src]

impl<GS: GlobalState> Event<GS> for Frame<GS>[src]

impl<GS: GlobalState> Event<GS> for HStack<GS>[src]

impl<GS: GlobalState> Event<GS> for Hidden<GS>[src]

impl<GS: GlobalState> Event<GS> for Image[src]

impl<GS: GlobalState> Event<GS> for Offset<GS>[src]

impl<GS: GlobalState> Event<GS> for OverlaidLayer<GS>[src]

impl<GS: GlobalState> Event<GS> for Padding<GS>[src]

impl<GS: GlobalState> Event<GS> for Scroll<GS>[src]

impl<GS: GlobalState> Event<GS> for Rectangle<GS>[src]

impl<GS: GlobalState> Event<GS> for RoundedRectangle<GS>[src]

impl<GS: GlobalState> Event<GS> for Spacer[src]

impl<GS: GlobalState> Event<GS> for Text<GS>[src]

impl<GS: GlobalState> Event<GS> for VStack<GS>[src]

impl<GS: GlobalState> Event<GS> for ZStack<GS>[src]

impl<S, GS: GlobalState> Event<GS> for Oval<S, GS> where
    S: 'static + Clone
[src]

impl<T, GS: GlobalState> Event<GS> for ForEach<GS, T> where
    T: ForEachDelegate + 'static, 
[src]

Loading content...