Struct arcdps_imgui::TreeNode

source ·
pub struct TreeNode<T, L = &'static str> { /* private fields */ }
Expand description

Builder for a tree node widget

Implementations§

source§

impl<T: AsRef<str>> TreeNode<T, &'static str>

source

pub fn new<I: Into<TreeNodeId<T>>>(id: I) -> TreeNode<T, &'static str>

Constructs a new tree node builder

source§

impl<T: AsRef<str>, L: AsRef<str>> TreeNode<T, L>

source

pub fn label<I: Into<TreeNodeId<L2>>, L2: AsRef<str>>( self, label: L2 ) -> TreeNode<T, L2>

Sets the tree node label

source

pub fn opened(self, opened: bool, cond: Condition) -> Self

Sets the opened state of the tree node, which is applied based on the given condition value

source

pub fn flags(self, flags: TreeNodeFlags) -> Self

Replaces all current settings with the given flags.

source

pub fn selected(self, value: bool) -> Self

Enables/disables drawing the tree node in selected state.

Disabled by default.

source

pub fn framed(self, value: bool) -> Self

Enables/disables full-colored frame.

Disabled by default.

source

pub fn allow_item_overlap(self, value: bool) -> Self

Enables/disables allowing the tree node to overlap subsequent widgets.

Disabled by default.

source

pub fn tree_push_on_open(self, value: bool) -> Self

Enables/disables automatic tree push when the tree node is open (= adds extra indentation and pushes to the ID stack).

Enabled by default.

source

pub fn auto_open_on_log(self, value: bool) -> Self

Enables/disables automatic opening of the tree node when logging is active.

By default, logging will automatically open all tree nodes.

Enabled by default.

source

pub fn default_open(self, value: bool) -> Self

Sets the default open state for the tree node.

Tree nodes are closed by default.

source

pub fn open_on_double_click(self, value: bool) -> Self

Only open when the tree node is double-clicked.

Disabled by default.

source

pub fn open_on_arrow(self, value: bool) -> Self

Only open when clicking the arrow part of the tree node.

Disabled by default.

source

pub fn leaf(self, value: bool) -> Self

Enable/disables leaf mode (no collapsing, no arrow).

Disabled by default.

source

pub fn bullet(self, value: bool) -> Self

Display a bullet instead of arrow.

Disabled by default.

source

pub fn frame_padding(self, value: bool) -> Self

Use frame_padding to vertically align text baseline to regular widget height.

Disabled by default.

source

pub fn nav_left_jumps_back_here(self, value: bool) -> Self

Left direction may move to this tree node from any of its child.

Disabled by default.

source

pub fn push<'ui>(self, ui: &Ui<'ui>) -> Option<TreeNodeToken<'ui>>

Pushes a tree node and starts appending to it.

Returns Some(TreeNodeToken) if the tree node is open. After content has been rendered, the token can be popped by calling .pop().

Returns None if the tree node is not open and no content should be rendered.

source

pub fn build<R, F: FnOnce() -> R>(self, ui: &Ui<'_>, f: F) -> Option<R>

Creates a tree node and runs a closure to construct the contents. Returns the result of the closure, if it is called.

Note: the closure is not called if the tree node is not open.

Trait Implementations§

source§

impl<T: Clone, L: Clone> Clone for TreeNode<T, L>

source§

fn clone(&self) -> TreeNode<T, L>

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<T: Debug, L: Debug> Debug for TreeNode<T, L>

source§

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

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

impl<T: Copy, L: Copy> Copy for TreeNode<T, L>

Auto Trait Implementations§

§

impl<T, L> Freeze for TreeNode<T, L>
where L: Freeze, T: Freeze,

§

impl<T, L> RefUnwindSafe for TreeNode<T, L>

§

impl<T, L = &'static str> !Send for TreeNode<T, L>

§

impl<T, L = &'static str> !Sync for TreeNode<T, L>

§

impl<T, L> Unpin for TreeNode<T, L>
where L: Unpin, T: Unpin,

§

impl<T, L> UnwindSafe for TreeNode<T, L>
where L: UnwindSafe, T: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where 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.

source§

impl<T> ToOwned for T
where 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 T
where 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 T
where 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.