Skip to main content

ObjectTreePanel

Struct ObjectTreePanel 

Source
pub struct ObjectTreePanel { /* private fields */ }
Expand description

Object Tree panel widget

Complete object management panel with:

  • Data Window (OHLCV at cursor)
  • Hierarchical source tree (indicators, drawings)
  • Full object management (visibility, lock, delete, etc.)
  • Multi-selection and keyboard shortcuts
  • Context menu with all options

§Example

use egui_charts::ui::widget_bar::panels::object_tree::{ObjectTreePanel, SourceItem};

let mut panel = ObjectTreePanel::new();
let mut sources = vec![
    SourceItem::indicator(1, "SMA(20)", egui::Color32::YELLOW),
];

let action = panel.show(ui, None, &mut sources);

Implementations§

Source§

impl ObjectTreePanel

Source

pub fn apply_to_chart( &mut self, chart: &mut Chart, action: &ObjectTreeAction, sources: &[SourceItem], ) -> bool

Apply a tree action to a chart. Drawing rows use drawing ids; study rows bind their chart series through SourceItem::with_series_id. Call this after Self::show.

Bind the main data source with with_series_id(SeriesId::MAIN) to control its visibility. Returns false for host-owned property dialogs, colour gestures, templates, main-series removal and renaming non-drawing rows. Drawing names are saved and undone with the drawing. Bulk actions apply to every selected drawing and study, and visibility includes the main series.

Source§

impl ObjectTreePanel

Source

pub fn new() -> Self

Create a new Object Tree panel

Source

pub fn with_config(config: ObjectTreeConfig) -> Self

Create with custom configuration

Source

pub fn state_mut(&mut self) -> &mut ObjectTreeState

Get mutable reference to state (for external manipulation)

Source

pub fn state(&self) -> &ObjectTreeState

Get reference to state

Source

pub fn config(&self) -> &ObjectTreeConfig

Get reference to config

Source

pub fn set_config(&mut self, config: ObjectTreeConfig)

Set configuration

Source

pub fn show( &mut self, ui: &mut Ui, data_window: Option<&DataWindowInfo>, sources: &mut [SourceItem], ) -> ObjectTreeAction

Main show method

Renders the complete Object Tree panel and returns any action.

Source

pub fn selected_ids(&self) -> Vec<usize>

Get selected item IDs

Source

pub fn reset(&mut self)

Clear all state

Trait Implementations§

Source§

impl Default for ObjectTreePanel

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> MaybeSend for T
where T: Send + Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

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

Source§

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>,

Source§

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.