Struct conrod::input::widget::Widget
[−]
[src]
pub struct Widget<'a> { /* fields omitted */ }
Provides only events and input state that are relevant to a specific widget.
This type can be produced by calling the UiCell::input
method with the target widget's
widget::Id
. This is particularly useful
Unlike input::Global
, input::Widget
methods are tailored to the widget for which they are
produced.
Methods
impl<'a> Widget<'a>
[src]
pub fn for_widget(idx: Id, rect: Rect, global: &'a Global) -> Self
[src]
Returns a Widget
with events specifically for the given widget.
Filters out only the events that directly pertain to the widget.
All events will also be made relative to the widget's own (0, 0) origin.
pub fn mouse(&self) -> Option<Mouse<'a>>
[src]
If the widget is currently capturing the mouse, this returns the state of the mouse.
Returns None
if the widget is not capturing the mouse.
ⓘImportant traits for Events<'a>pub fn events(&self) -> Events<'a>
[src]
Produces an iterator yielding all events that are relevant to a specific widget.
All events provided by this Iterator will be filtered in accordance with input capturing. For example: If the widget does not capture the mouse, it will not receive any mouse-related events. If the widget captures the keyboard it will receive all keyboard events.
All mouse events will have their coordinates relative to the middle of the widget's Rect
.
ⓘImportant traits for Presses<'a>pub fn presses(&self) -> Presses<'a>
[src]
Filters all events yielded by Self::events
other than event::Press
es.
ⓘImportant traits for Releases<'a>pub fn releases(&self) -> Releases<'a>
[src]
Filters all events yielded by Self::events
other than event::Release
es.
ⓘImportant traits for Clicks<'a>pub fn clicks(&self) -> Clicks<'a>
[src]
Filters all events yielded by Self::events
for all event::Click
s.
A click is determined to have occured if a pointing device button was both pressed and released over the widget.
ⓘImportant traits for Taps<'a>pub fn taps(&self) -> Taps<'a>
[src]
Filters all events yielded by Self::events
for all event::Tap
s.
A tap is determined to have occured if a touch interaction both started and ended over the widget.
ⓘImportant traits for Drags<'a>pub fn drags(&self) -> Drags<'a>
[src]
Produces an iterator that yields all event::Drag
events yielded by the Events
iterator.
Only events that occurred while the widget was capturing the device that did the dragging will be yielded.
ⓘImportant traits for Texts<'a>pub fn texts(&self) -> Texts<'a>
[src]
Produces an iterator that yields all Input::Text
events that have occurred as &str
s
since the last time Ui::set_widgets
was called.
Only events that occurred while the widget was capturing the keyboard will be yielded.
ⓘImportant traits for Scrolls<'a>pub fn scrolls(&self) -> Scrolls<'a>
[src]
Produce an iterator that yields only the Scroll
events yielded by the Events
iterator.