[−][src]Struct pushrod::widgets::tab_bar_widget::TabBarWidget
This is the storage object for the TabBarWidget
. It stores the config, properties, callback registry, tab
items, and other storage values for internal rendering.
Methods
impl TabBarWidget
[src]
This is the implementation of the TabBarWidget
, which displays a series of tabs specified by the
tab items in the constructor. Tab bar items are automatically sized and rendered depending on the
number of items specified.
pub fn new(points: Points, size: Size, tab_items: Vec<String>) -> Self
[src]
Creates a new TabBarWidget
, given the x, y, w, h
coordinates, and the tab items to be shown
in the tab bar area.
pub fn on_tab_selected<F>(&mut self, callback: F) where
F: FnMut(&mut TabBarWidget, &[WidgetContainer], &[LayoutContainer], u16) + 'static,
[src]
F: FnMut(&mut TabBarWidget, &[WidgetContainer], &[LayoutContainer], u16) + 'static,
Assigns the callback closure that will be used when a tab is selected.
Trait Implementations
impl Widget for TabBarWidget
[src]
This is the Widget
implementation of the TabBarWidget
.
fn draw(
&mut self,
c: &mut Canvas<Window>,
t: &mut TextureCache
) -> Option<&Texture>
[src]
&mut self,
c: &mut Canvas<Window>,
t: &mut TextureCache
) -> Option<&Texture>
fn mouse_entered(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
When a mouse enters the bounds of the Widget
, this function is triggered. Overridden by
this Widget
.
fn mouse_exited(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
When a mouse exits the bounds of the Widget
, this function is triggered. Overidden by
this Widget
.
fn mouse_moved(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
points: Points
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
points: Points
)
Overrides the mouse_moved
function, used to determine the position of the tab bar that is
currently under the mouse coordinates.
fn button_clicked(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
button: u8,
_clicks: u8,
state: bool
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
button: u8,
_clicks: u8,
state: bool
)
Overrides the button_clicked
function, used to determine when a mouse clicks inside the bounds
of a tab, triggering the on_tab_selected
callback where appropriate.
fn as_any(&mut self) -> &mut dyn Any
[src]
This function is a macro-created getter function that returns the Widget
as an Any
type. This allows the Widget
trait to be downcast into a struct
that implements
the Widget
trait.
fn get_config(&mut self) -> &mut WidgetConfig
[src]
This function is a macro-created getter function that returns the Widget
's configuration
object as a borrowed mutable reference. This code is auto-generated using the
default_widget_properties!()
macro.
fn get_system_properties(&mut self) -> &mut HashMap<i32, String>
[src]
This function is a macro-created getter function that returns the Widget
's system
properties as a borrowed mutable reference. This code is auto-generated using the
default_widget_properties!()
macro.
fn get_callbacks(&mut self) -> &mut CallbackRegistry
[src]
This function is a macro-created getter function that returns the Widget
's
CallbackRegistry
object as a borrowed mutable reference. This code is auto-generated
using the default_widget_properties!()
macro.
fn tick_callback(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
This function is a macro-created tick callback override, created by the
default_widget_callbacks!()
macro.
fn mouse_entered_callback(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
This function is a macro-created mouse entered callback override, created by the
default_widget_callbacks!()
macro.
fn mouse_exited_callback(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer]
)
This function is a macro-created mouse exited callback override, created by the
default_widget_callbacks!()
macro.
fn mouse_moved_callback(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_points: Points
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_points: Points
)
This function is a macro-created mouse moved callback override, created by the
default_widget_callbacks!()
macro.
fn mouse_scrolled_callback(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_points: Points
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_points: Points
)
This function is a macro-created mouse scrolled callback override, created by the
default_widget_callbacks!()
macro.
fn button_clicked_callback(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_button: u8,
_clicks: u8,
_state: bool
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_button: u8,
_clicks: u8,
_state: bool
)
This function is a macro-created mouse scrolled callback override, created by the
default_widget_callbacks!()
macro.
fn mouse_scrolled(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_points: Points
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_points: Points
)
fn tick(&mut self, _widgets: &[WidgetContainer], _layouts: &[LayoutContainer])
[src]
fn other_event(
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_event: Event
)
[src]
&mut self,
_widgets: &[WidgetContainer],
_layouts: &[LayoutContainer],
_event: Event
)
fn on_config_changed(&mut self, _k: u8, _v: Config)
[src]
fn set_point(&mut self, config: u8, x: i32, y: i32)
[src]
fn set_color(&mut self, config: u8, color: Color)
[src]
fn set_numeric(&mut self, config: u8, value: i32)
[src]
fn set_text(&mut self, config: u8, text: String)
[src]
fn set_toggle(&mut self, config: u8, flag: bool)
[src]
fn set_compass(&mut self, config: u8, value: CompassPosition)
[src]
fn get_point(&mut self, k: u8) -> Points
[src]
fn get_size(&mut self, k: u8) -> Size
[src]
fn get_color(&mut self, k: u8) -> Color
[src]
fn get_numeric(&mut self, k: u8) -> i32
[src]
fn get_text(&mut self, k: u8) -> String
[src]
fn get_toggle(&mut self, k: u8) -> bool
[src]
fn get_compass(&mut self, k: u8) -> CompassPosition
[src]
fn set_origin(&mut self, _origin: Points)
[src]
fn set_size(&mut self, _size: Vec<u32>)
[src]
fn get_drawing_area(&mut self) -> Rect
[src]
fn is_invalidated(&mut self) -> bool
[src]
fn set_invalidated(&mut self, flag: bool)
[src]
Auto Trait Implementations
impl !RefUnwindSafe for TabBarWidget
impl !Send for TabBarWidget
impl !Sync for TabBarWidget
impl Unpin for TabBarWidget
impl !UnwindSafe for TabBarWidget
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,