pub struct Widget {
pub user_data: Option<Rc<dyn Any>>,
/* private fields */
}Fields§
§user_data: Option<Rc<dyn Any>>Implementations§
Source§impl Widget
impl Widget
pub fn handle(&self) -> Handle<UiNode>
pub fn name(&self) -> &str
pub fn set_name<P>(&mut self, name: P) -> &mut Widget
pub fn actual_size( &self, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn set_min_size( &mut self, value: Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> &mut Widget
pub fn set_min_width(&mut self, value: f32) -> &mut Widget
pub fn set_min_height(&mut self, value: f32) -> &mut Widget
pub fn min_size( &self, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn min_width(&self) -> f32
pub fn min_height(&self) -> f32
pub fn is_drag_allowed(&self) -> bool
pub fn is_drop_allowed(&self) -> bool
pub fn invalidate_layout(&self)
pub fn invalidate_measure(&self)
pub fn invalidate_arrange(&self)
pub fn is_hit_test_visible(&self) -> bool
pub fn set_max_size( &mut self, value: Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> &mut Widget
pub fn max_size( &self, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn max_width(&self) -> f32
pub fn max_height(&self) -> f32
pub fn set_z_index(&mut self, z_index: usize) -> &mut Widget
pub fn z_index(&self) -> usize
pub fn set_background(&mut self, brush: Brush) -> &mut Widget
pub fn background(&self) -> Brush
pub fn set_foreground(&mut self, brush: Brush) -> &mut Widget
pub fn foreground(&self) -> Brush
pub fn set_width(&mut self, width: f32) -> &mut Widget
pub fn width(&self) -> f32
pub fn is_draw_on_top(&self) -> bool
pub fn set_height(&mut self, height: f32) -> &mut Widget
pub fn height(&self) -> f32
pub fn set_desired_local_position( &mut self, pos: Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> &mut Widget
pub fn screen_position( &self, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn children(&self) -> &[Handle<UiNode>]
pub fn parent(&self) -> Handle<UiNode>
pub fn set_parent(&mut self, parent: Handle<UiNode>)
pub fn column(&self) -> usize
pub fn set_row(&mut self, row: usize) -> &mut Widget
pub fn row(&self) -> usize
pub fn desired_size( &self, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn desired_local_position( &self, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn screen_bounds(&self) -> Rect<f32>
pub fn has_descendant( &self, node_handle: Handle<UiNode>, ui: &UserInterface, ) -> bool
Sourcepub fn find_by_criteria_up<Func>(
&self,
ui: &UserInterface,
func: Func,
) -> Handle<UiNode>
pub fn find_by_criteria_up<Func>( &self, ui: &UserInterface, func: Func, ) -> Handle<UiNode>
Searches a node up on tree starting from given root that matches a criteria defined by a given func.
pub fn handle_routed_message( &mut self, _ui: &mut UserInterface, msg: &mut UiMessage, )
pub fn set_vertical_alignment( &mut self, vertical_alignment: VerticalAlignment, ) -> &mut Widget
pub fn vertical_alignment(&self) -> VerticalAlignment
pub fn set_horizontal_alignment( &mut self, horizontal_alignment: HorizontalAlignment, ) -> &mut Widget
pub fn horizontal_alignment(&self) -> HorizontalAlignment
pub fn set_column(&mut self, column: usize) -> &mut Widget
pub fn set_margin(&mut self, margin: Thickness) -> &mut Widget
pub fn margin(&self) -> Thickness
pub fn measure_override( &self, ui: &UserInterface, available_size: Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn arrange_override( &self, ui: &UserInterface, final_size: Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn is_arrange_valid(&self) -> bool
pub fn is_measure_valid(&self) -> bool
pub fn actual_local_position( &self, ) -> Matrix<f32, Const<nalgebra::::base::dimension::U2::{constant#0}>, Const<1>, ArrayStorage<f32, 2, 1>>
pub fn is_globally_visible(&self) -> bool
pub fn set_visibility(&mut self, visibility: bool) -> &mut Widget
pub fn visibility(&self) -> bool
pub fn set_enabled(&mut self, enabled: bool) -> &mut Widget
pub fn enabled(&self) -> bool
pub fn set_cursor(&mut self, cursor: Option<CursorIcon>)
pub fn cursor(&self) -> Option<CursorIcon>
pub fn user_data_ref<T>(&self) -> Option<&T>where
T: 'static,
pub fn clip_bounds(&self) -> Rect<f32>
pub fn set_opacity(&mut self, opacity: Option<f32>) -> &mut Widget
pub fn opacity(&self) -> Option<f32>
pub fn tooltip(&self) -> Handle<UiNode>
pub fn set_tooltip(&mut self, tooltip: Handle<UiNode>) -> &mut Widget
pub fn tooltip_time(&self) -> f32
pub fn set_tooltip_time(&mut self, tooltip_time: f32) -> &mut Widget
The context menu receives PopupMessages for being displayed, and so should support those.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Widget
impl !RefUnwindSafe for Widget
impl !Send for Widget
impl !Sync for Widget
impl Unpin for Widget
impl !UnwindSafe for Widget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PropertyValue for Twhere
T: Debug + 'static,
impl<T> PropertyValue for Twhere
T: Debug + 'static,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.