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
impl ObjectTreePanel
Sourcepub fn apply_to_chart(
&mut self,
chart: &mut Chart,
action: &ObjectTreeAction,
sources: &[SourceItem],
) -> bool
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
impl ObjectTreePanel
Sourcepub fn with_config(config: ObjectTreeConfig) -> Self
pub fn with_config(config: ObjectTreeConfig) -> Self
Create with custom configuration
Sourcepub fn state_mut(&mut self) -> &mut ObjectTreeState
pub fn state_mut(&mut self) -> &mut ObjectTreeState
Get mutable reference to state (for external manipulation)
Sourcepub fn state(&self) -> &ObjectTreeState
pub fn state(&self) -> &ObjectTreeState
Get reference to state
Sourcepub fn config(&self) -> &ObjectTreeConfig
pub fn config(&self) -> &ObjectTreeConfig
Get reference to config
Sourcepub fn set_config(&mut self, config: ObjectTreeConfig)
pub fn set_config(&mut self, config: ObjectTreeConfig)
Set configuration
Sourcepub fn show(
&mut self,
ui: &mut Ui,
data_window: Option<&DataWindowInfo>,
sources: &mut [SourceItem],
) -> ObjectTreeAction
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.
Sourcepub fn selected_ids(&self) -> Vec<usize>
pub fn selected_ids(&self) -> Vec<usize>
Get selected item IDs
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ObjectTreePanel
impl RefUnwindSafe for ObjectTreePanel
impl Send for ObjectTreePanel
impl Sync for ObjectTreePanel
impl Unpin for ObjectTreePanel
impl UnsafeUnpin for ObjectTreePanel
impl UnwindSafe for ObjectTreePanel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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