pub struct TimeframeToolbar {
pub state: TimeframeToolbarState,
pub config: TimeframeToolbarConfig,
/* private fields */
}Expand description
Bottom panel component
Fields§
§state: TimeframeToolbarStateState
config: TimeframeToolbarConfigConfiguration
Implementations§
Source§impl TimeframeToolbar
impl TimeframeToolbar
Sourcepub fn with_config(config: TimeframeToolbarConfig) -> Self
pub fn with_config(config: TimeframeToolbarConfig) -> Self
Create with custom config
Sourcepub fn set_control_visible(&mut self, control: Control, visible: bool)
pub fn set_control_visible(&mut self, control: Control, visible: bool)
Shows or hides control: TimeZone, Session and DividendAdjustment. The toolbar
ignores the other controls.
Sourcepub fn set_time_zones(&mut self, zones: Vec<TimezoneId>)
pub fn set_time_zones(&mut self, zones: Vec<TimezoneId>)
Offers zones in the time zone menu after UTC, exchange time and local time, in place of
default_time_zones.
Shows the time zone menu beside the clock while
timezone_menu_open is set, as a host does on
TimeframeToolbarAction::OpenTimezoneMenu. Call it after show on each
frame. The menu offers UTC, exchange time, local time and the zones of
set_time_zones, as the chart settings do, and marks current,
the chart’s chosen TimezoneMode. It returns the mode the user picks for the host to
apply, and closes on a choice, Escape or a click elsewhere.
Shows the session menu beside the control while
session_menu_open is set, as a host does on
TimeframeToolbarAction::OpenSessionMenu. Call after show each frame.
Offers regular and extended hours, plus overnight hours when the instrument has overnight
windows or they are already chosen, as in the time axis menu. Instruments without session
windows or date-specific hours keep the menu closed.
A choice applies to chart as one undo step, reloads history on the next chart frame when
the hours change, updates the control and closes the menu. Escape and a click elsewhere
also close it. Returns whether the chart’s hours changed.
Sourcepub fn update_time(&mut self)
pub fn update_time(&mut self)
Update the current time display
Sourcepub fn show(&mut self, ui: &mut Ui) -> TimeframeToolbarAction
pub fn show(&mut self, ui: &mut Ui) -> TimeframeToolbarAction
Show bottom panel and return action
Sourcepub fn state(&self) -> &TimeframeToolbarState
pub fn state(&self) -> &TimeframeToolbarState
Get the current state
Sourcepub fn state_mut(&mut self) -> &mut TimeframeToolbarState
pub fn state_mut(&mut self) -> &mut TimeframeToolbarState
Get mutable state
Sourcepub fn set_date_range(&mut self, range: DateRange)
pub fn set_date_range(&mut self, range: DateRange)
Set the selected date range
Sourcepub fn set_timezone(&mut self, timezone: String)
pub fn set_timezone(&mut self, timezone: String)
Set the timezone
Sourcepub fn set_session(&mut self, session: SessionType)
pub fn set_session(&mut self, session: SessionType)
Set the session type, such as SessionType::from_chart of the chart the toolbar serves
Sourcepub fn toggle_dividends(&mut self)
pub fn toggle_dividends(&mut self)
Toggle dividend adjustment
Sourcepub fn sync_from_app_state(&mut self, app_state: &dyn ChartAppState)
pub fn sync_from_app_state(&mut self, app_state: &dyn ChartAppState)
Sync from application state.
Trait Implementations§
Source§impl Debug for TimeframeToolbar
impl Debug for TimeframeToolbar
Auto Trait Implementations§
impl Freeze for TimeframeToolbar
impl RefUnwindSafe for TimeframeToolbar
impl Send for TimeframeToolbar
impl Sync for TimeframeToolbar
impl Unpin for TimeframeToolbar
impl UnsafeUnpin for TimeframeToolbar
impl UnwindSafe for TimeframeToolbar
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