Struct fyrox_ui::tree::TreeRoot

source ·
pub struct TreeRoot {
    pub widget: Widget,
    pub panel: Handle<UiNode>,
    pub items: Vec<Handle<UiNode>>,
    pub selected: Vec<Handle<UiNode>>,
}

Fields§

§widget: Widget§panel: Handle<UiNode>§items: Vec<Handle<UiNode>>§selected: Vec<Handle<UiNode>>

Implementations§

source§

impl TreeRoot

source

pub fn items(&self) -> &[Handle<UiNode>]

Methods from Deref<Target = Widget>§

source

pub fn handle(&self) -> Handle<UiNode>

source

pub fn name(&self) -> &str

source

pub fn set_name<P: AsRef<str>>(&mut self, name: P) -> &mut Self

source

pub fn actual_local_size(&self) -> Vector2<f32>

source

pub fn actual_initial_size(&self) -> Vector2<f32>

Returns size of the widget without any layout or rendering transform applied.

source

pub fn actual_global_size(&self) -> Vector2<f32>

source

pub fn set_min_size(&mut self, value: Vector2<f32>) -> &mut Self

source

pub fn set_min_width(&mut self, value: f32) -> &mut Self

source

pub fn set_min_height(&mut self, value: f32) -> &mut Self

source

pub fn min_size(&self) -> Vector2<f32>

source

pub fn min_width(&self) -> f32

source

pub fn min_height(&self) -> f32

source

pub fn is_drag_allowed(&self) -> bool

source

pub fn is_drop_allowed(&self) -> bool

source

pub fn screen_to_local(&self, point: Vector2<f32>) -> Vector2<f32>

source

pub fn invalidate_layout(&self)

source

pub fn invalidate_measure(&self)

source

pub fn invalidate_arrange(&self)

source

pub fn is_hit_test_visible(&self) -> bool

source

pub fn set_max_size(&mut self, value: Vector2<f32>) -> &mut Self

source

pub fn max_size(&self) -> Vector2<f32>

source

pub fn max_width(&self) -> f32

source

pub fn max_height(&self) -> f32

source

pub fn set_z_index(&mut self, z_index: usize) -> &mut Self

source

pub fn z_index(&self) -> usize

source

pub fn set_background(&mut self, brush: Brush) -> &mut Self

source

pub fn background(&self) -> Brush

source

pub fn set_foreground(&mut self, brush: Brush) -> &mut Self

source

pub fn foreground(&self) -> Brush

source

pub fn set_width(&mut self, width: f32) -> &mut Self

source

pub fn width(&self) -> f32

source

pub fn is_draw_on_top(&self) -> bool

source

pub fn set_height(&mut self, height: f32) -> &mut Self

source

pub fn height(&self) -> f32

source

pub fn set_desired_local_position(&mut self, pos: Vector2<f32>) -> &mut Self

source

pub fn screen_position(&self) -> Vector2<f32>

source

pub fn children(&self) -> &[Handle<UiNode>]

source

pub fn parent(&self) -> Handle<UiNode>

source

pub fn set_parent(&mut self, parent: Handle<UiNode>)

source

pub fn column(&self) -> usize

source

pub fn set_row(&mut self, row: usize) -> &mut Self

source

pub fn row(&self) -> usize

source

pub fn desired_size(&self) -> Vector2<f32>

source

pub fn desired_local_position(&self) -> Vector2<f32>

source

pub fn screen_bounds(&self) -> Rect<f32>

source

pub fn bounding_rect(&self) -> Rect<f32>

source

pub fn visual_transform(&self) -> &Matrix3<f32>

source

pub fn render_transform(&self) -> &Matrix3<f32>

source

pub fn layout_transform(&self) -> &Matrix3<f32>

source

pub fn has_descendant( &self, node_handle: Handle<UiNode>, ui: &UserInterface ) -> bool

source

pub fn find_by_criteria_up<Func: Fn(&UiNode) -> bool>( &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.

source

pub fn handle_routed_message( &mut self, _ui: &mut UserInterface, msg: &mut UiMessage )

source

pub fn set_vertical_alignment( &mut self, vertical_alignment: VerticalAlignment ) -> &mut Self

source

pub fn vertical_alignment(&self) -> VerticalAlignment

source

pub fn set_horizontal_alignment( &mut self, horizontal_alignment: HorizontalAlignment ) -> &mut Self

source

pub fn horizontal_alignment(&self) -> HorizontalAlignment

source

pub fn set_column(&mut self, column: usize) -> &mut Self

source

pub fn set_margin(&mut self, margin: Thickness) -> &mut Self

source

pub fn margin(&self) -> Thickness

source

pub fn measure_override( &self, ui: &UserInterface, available_size: Vector2<f32> ) -> Vector2<f32>

source

pub fn arrange_override( &self, ui: &UserInterface, final_size: Vector2<f32> ) -> Vector2<f32>

source

pub fn is_arrange_valid(&self) -> bool

source

pub fn is_measure_valid(&self) -> bool

source

pub fn actual_local_position(&self) -> Vector2<f32>

source

pub fn center(&self) -> Vector2<f32>

source

pub fn is_globally_visible(&self) -> bool

source

pub fn set_visibility(&mut self, visibility: bool) -> &mut Self

source

pub fn request_update_visibility(&self)

source

pub fn visibility(&self) -> bool

source

pub fn set_enabled(&mut self, enabled: bool) -> &mut Self

source

pub fn enabled(&self) -> bool

source

pub fn set_cursor(&mut self, cursor: Option<CursorIcon>)

source

pub fn cursor(&self) -> Option<CursorIcon>

source

pub fn user_data_ref<T: 'static>(&self) -> Option<&T>

source

pub fn clip_bounds(&self) -> Rect<f32>

source

pub fn set_opacity(&mut self, opacity: Option<f32>) -> &mut Self

source

pub fn opacity(&self) -> Option<f32>

source

pub fn tooltip(&self) -> Option<RcUiNodeHandle>

source

pub fn set_tooltip(&mut self, tooltip: Option<RcUiNodeHandle>) -> &mut Self

source

pub fn tooltip_time(&self) -> f32

source

pub fn set_tooltip_time(&mut self, tooltip_time: f32) -> &mut Self

source

pub fn context_menu(&self) -> Option<RcUiNodeHandle>

source

pub fn set_context_menu( &mut self, context_menu: Option<RcUiNodeHandle> ) -> &mut Self

The context menu receives PopupMessages for being displayed, and so should support those.

Trait Implementations§

source§

impl Clone for TreeRoot

source§

fn clone(&self) -> TreeRoot

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Control for TreeRoot

source§

fn query_component(&self, type_id: TypeId) -> Option<&dyn Any>

Allows a widget to provide access to inner components. For example you can build your custom MyTree widget using engine’s Tree widget as a base. The engine needs to know whether the custom widget is actually extends functionality of some existing widget. Read more
source§

fn resolve(&mut self, node_map: &NodeHandleMapping)

source§

fn handle_routed_message( &mut self, ui: &mut UserInterface, message: &mut UiMessage )

Performs event-specific actions. Must call widget.handle_message()! Read more
source§

fn on_remove(&self, sender: &Sender<UiMessage>)

source§

fn measure_override( &self, ui: &UserInterface, available_size: Vector2<f32> ) -> Vector2<f32>

source§

fn arrange_override( &self, ui: &UserInterface, final_size: Vector2<f32> ) -> Vector2<f32>

source§

fn draw(&self, drawing_context: &mut DrawingContext)

source§

fn update(&mut self, dt: f32, sender: &Sender<UiMessage>)

source§

fn preview_message(&self, ui: &UserInterface, message: &mut UiMessage)

Used to react to a message (by producing another message) that was posted outside of current hierarchy. In other words this method is used when you need to “peek” a message before it’ll be passed into bubbling router. Most common use case is to catch messages from popups: popup in 99.9% cases is a child of root canvas and it won’t receive a message from a its logical parent during bubbling message routing. For example preview_message used in a dropdown list: dropdown list has two separate parts - a field with selected value and a popup for all possible options. Visual parent of the popup in this case is the root canvas, but logical parent is the dropdown list. Because of this fact, the field won’t receive any messages from popup, to solve this we use preview_message. This method is much more restrictive - it does not allow you to modify a node and ui, you can either request changes by sending a message or use internal mutability (Cell, RefCell, etc). Read more
source§

fn handle_os_event( &mut self, self_handle: Handle<UiNode>, ui: &mut UserInterface, event: &OsEvent )

Provides a way to respond to OS specific events. Can be useful to detect if a key or mouse button was pressed. This method significantly differs from handle_message because os events are not dispatched - they’ll be passed to this method in any case. Read more
source§

impl Debug for TreeRoot

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Deref for TreeRoot

§

type Target = Widget

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for TreeRoot

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> BaseControl for Twhere T: Any + Clone + 'static + Control,

source§

fn as_any(&self) -> &(dyn Any + 'static)

source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

source§

fn clone_boxed(&self) -> Box<dyn Control<Target = Widget> + 'static, Global>

source§

fn type_name(&self) -> &'static str

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> FieldValue for Twhere T: 'static,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V