pub struct DrawingProps {Show 15 fields
pub symbol: Option<String>,
pub tool_settings: Option<Box<DrawingTemplate>>,
pub tick_size: Option<f64>,
pub coordinates: CoordinatesState,
pub save_as_default: bool,
pub color: Color32,
pub line_width: f32,
pub line_style: LineStyle,
pub fill_color: Option<Color32>,
pub fill_enabled: bool,
pub extend_left: bool,
pub extend_right: bool,
pub label: String,
pub font_size: f32,
pub timeframe_visibility: TimeframeVisibility,
}Expand description
Drawing properties that can be edited
Fields§
§symbol: Option<String>Symbol whose drawing was opened; absent for manually assembled properties.
tool_settings: Option<Box<DrawingTemplate>>Tool-specific settings, edited by the Inputs page.
tick_size: Option<f64>Instrument tick size for position level inputs; absent disables editing by ticks.
coordinates: CoordinatesStateStaged anchor edits, applied only to the drawing whose dialog was opened.
save_as_default: boolSave these properties as the default for new drawings of this tool.
color: Color32Primary color
line_width: f32Line width (1-10)
line_style: LineStyleLine style
fill_color: Option<Color32>Fill color (for shapes)
fill_enabled: boolFill enabled
extend_left: boolExtend line left
extend_right: boolExtend line right
label: StringText label
font_size: f32Font size
timeframe_visibility: TimeframeVisibilityThe intervals the drawing shows on
Implementations§
Source§impl DrawingProps
impl DrawingProps
Sourcepub fn from_drawing(drawing: &Drawing, chart: &Chart) -> Self
pub fn from_drawing(drawing: &Drawing, chart: &Chart) -> Self
Read every editable property without changing the drawing or its selection.
Sourcepub fn apply_to_chart(
&self,
id: DrawingId,
chart: &mut Chart,
) -> Result<(), &'static str>
pub fn apply_to_chart( &self, id: DrawingId, chart: &mut Chart, ) -> Result<(), &'static str>
Validate and apply one undoable edit to the unlocked selection. A value that differs from
drawing id’s, which these properties were read from, was edited, and only edited values
change the drawings: text only those that show text, tool inputs only drawings of the same
tool, coordinates only id. Errors leave all live drawings unchanged.
Trait Implementations§
Source§impl Clone for DrawingProps
impl Clone for DrawingProps
Source§fn clone(&self) -> DrawingProps
fn clone(&self) -> DrawingProps
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DrawingProps
impl Debug for DrawingProps
Auto Trait Implementations§
impl Freeze for DrawingProps
impl RefUnwindSafe for DrawingProps
impl Send for DrawingProps
impl Sync for DrawingProps
impl Unpin for DrawingProps
impl UnsafeUnpin for DrawingProps
impl UnwindSafe for DrawingProps
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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