Struct conrod::PositionMatrix
[−]
[src]
pub struct PositionMatrix { // some fields omitted }
A type to simplify placement of various widgets in a matrix or grid layout.
Methods
impl Matrix
[src]
fn new(cols: usize, rows: usize) -> Matrix
Start building a new position Matrix.
fn cell_padding(self, w: Scalar, h: Scalar) -> Matrix
Produce the matrix with the given cell padding.
fn each_widget<C, F>(self, ui: &mut Ui<C>, f: F) where C: CharacterCache, F: FnMut(&mut Ui<C>, WidgetNum, ColNum, RowNum, Point, Dimensions)
Call the given function for every element in the Matrix.
Trait Implementations
impl Debug for Matrix
[src]
impl Clone for Matrix
[src]
fn clone(&self) -> Matrix
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Matrix
[src]
impl Positionable for Matrix
[src]
fn x_position(self, pos: Position) -> Self
Build with the given Position along the x axis.
fn y_position(self, pos: Position) -> Self
Build with the given Position along the y axis.
fn get_x_position<C: CharacterCache>(&self, ui: &Ui<C>) -> Position
Get the Position along the x axis.
fn get_y_position<C: CharacterCache>(&self, ui: &Ui<C>) -> Position
Get the Position along the y axis.
fn depth(self, _: Depth) -> Self
The depth at which the widget should be rendered relatively to its sibling widgets.
fn get_depth(&self) -> Depth
Return the depth.
fn x(self, x: Scalar) -> Self
Build with the given Absolute Position along the x axis.
fn y(self, y: Scalar) -> Self
Build with the given Absolute Position along the y axis.
fn xy(self, point: Point) -> Self
Set the Position with some Point.
fn x_y(self, x: Scalar, y: Scalar) -> Self
Set the Position with x y coordinates.
fn x_relative(self, x: Scalar) -> Self
Set the Position along the x axis Relative to the previous widget.
fn y_relative(self, y: Scalar) -> Self
Set the Position along the y axis Relative to the previous widget.
fn xy_relative(self, point: Point) -> Self
Set the Position Relative to the previous widget.
fn x_y_relative(self, x: Scalar, y: Scalar) -> Self
Set the Position Relative to the previous widget.
fn x_relative_to<I: Into<Index>>(self, other: I, x: Scalar) -> Self
Set the position relative to the widget with the given widget::Index.
fn y_relative_to<I: Into<Index>>(self, other: I, y: Scalar) -> Self
Set the position relative to the widget with the given widget::Index.
fn xy_relative_to<I: Into<Index> + Copy>(self, other: I, xy: Point) -> Self
Set the position relative to the widget with the given widget::Index.
fn x_y_relative_to<I: Into<Index> + Copy>(self, other: I, x: Scalar, y: Scalar) -> Self
Set the position relative to the widget with the given widget::Index.
fn x_direction(self, direction: Direction, x: Scalar) -> Self
Build with the Position along the x axis as some distance from another widget.
fn y_direction(self, direction: Direction, y: Scalar) -> Self
Build with the Position along the y axis as some distance from another widget.
fn down(self, y: Scalar) -> Self
Build with the Position as some distance below another widget.
fn up(self, y: Scalar) -> Self
Build with the Position as some distance above another widget.
fn left(self, x: Scalar) -> Self
Build with the Position as some distance to the left of another widget.
fn right(self, x: Scalar) -> Self
Build with the Position as some distance to the right of another widget.
fn x_direction_from<I>(self, other: I, direction: Direction, x: Scalar) -> Self where I: Into<Index> + Copy
Build with the Position along the x axis as some distance from the given widget.
fn y_direction_from<I>(self, other: I, direction: Direction, y: Scalar) -> Self where I: Into<Index> + Copy
Build with the Position along the y axis as some distance from the given widget.
fn down_from<I: Into<Index> + Copy>(self, other: I, y: Scalar) -> Self
Build with the Position as some distance below the given widget.
fn up_from<I: Into<Index> + Copy>(self, other: I, y: Scalar) -> Self
Build with the Position as some distance above the given widget.
fn left_from<I: Into<Index> + Copy>(self, other: I, x: Scalar) -> Self
Build with the Position as some distance to the left of the given widget.
fn right_from<I: Into<Index> + Copy>(self, other: I, x: Scalar) -> Self
Build with the Position as some distance to the right of the given widget.
fn x_align(self, align: Align) -> Self
Align the Position of the widget along the x axis.
fn y_align(self, align: Align) -> Self
Align the Position of the widget along the y axis.
fn align_left(self) -> Self
Align the position to the left (only effective for Up or Down Direction
s).
fn align_middle_x(self) -> Self
Align the position to the middle (only effective for Up or Down Direction
s).
fn align_right(self) -> Self
Align the position to the right (only effective for Up or Down Direction
s).
fn align_top(self) -> Self
Align the position to the top (only effective for Left or Right Direction
s).
fn align_middle_y(self) -> Self
Align the position to the middle (only effective for Left or Right Direction
s).
fn align_bottom(self) -> Self
Align the position to the bottom (only effective for Left or Right Direction
s).
fn x_align_to<I: Into<Index>>(self, other: I, align: Align) -> Self
Align the Position of the widget with the given widget along the x axis.
fn y_align_to<I: Into<Index>>(self, other: I, align: Align) -> Self
Align the Position of the widget with the given widget along the y axis.
fn align_left_of<I: Into<Index>>(self, other: I) -> Self
Align the position to the left (only effective for Up or Down Direction
s).
fn align_middle_x_of<I: Into<Index>>(self, other: I) -> Self
Align the position to the middle (only effective for Up or Down Direction
s).
fn align_right_of<I: Into<Index>>(self, other: I) -> Self
Align the position to the right (only effective for Up or Down Direction
s).
fn align_top_of<I: Into<Index>>(self, other: I) -> Self
Align the position to the top (only effective for Left or Right Direction
s).
fn align_middle_y_of<I: Into<Index>>(self, other: I) -> Self
Align the position to the middle (only effective for Left or Right Direction
s).
fn align_bottom_of<I: Into<Index>>(self, other: I) -> Self
Align the position to the bottom (only effective for Left or Right Direction
s).
fn x_place_on<I: Into<Index>>(self, other: I, place: Place) -> Self
Place the widget at some position on the other
Widget along the x axis.
fn y_place_on<I: Into<Index>>(self, other: I, place: Place) -> Self
Place the widget at some position on the other
Widget along the y axis.
fn middle_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the middle of the given Widget.
fn top_left_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the top left corner of the given Widget.
fn top_left_with_margin_on<I>(self, other: I, mgn: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the top left corner of the given Widget with the given margin between both edges. Read more
fn top_left_with_margins_on<I>(self, other: I, top: Scalar, left: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the top left corner of the given Widget with the given margins between each respective edge. Read more
fn top_right_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the top right corner of the given Widget.
fn top_right_with_margin_on<I>(self, other: I, mgn: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the top right corner of the given Widget with the given margin between both edges. Read more
fn top_right_with_margins_on<I>(self, other: I, top: Scalar, right: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the top right corner of the given Widget with the given margins between each respective edge. Read more
fn bottom_left_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the bottom left corner of the given Widget.
fn bottom_left_with_margin_on<I>(self, other: I, mgn: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the bottom left corner of the given Widget with the given margin between both edges. Read more
fn bottom_left_with_margins_on<I>(self, other: I, bottom: Scalar, left: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the bottom left corner of the given Widget with the given margins between each respective edge. Read more
fn bottom_right_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the bottom right corner of the given Widget.
fn bottom_right_with_margin_on<I>(self, other: I, mgn: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the bottom right corner of the given Widget with the given margin between both edges. Read more
fn bottom_right_with_margins_on<I>(self, other: I, bottom: Scalar, right: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the bottom right corner of the given Widget with the given margins between each respective edge. Read more
fn mid_top_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the middle of the top edge of the given Widget.
fn mid_top_with_margin_on<I>(self, other: I, mgn: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the middle of the top edge of the given Widget with the given margin between the edges. Read more
fn mid_bottom_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the middle of the bottom edge of the given Widget.
fn mid_bottom_with_margin_on<I>(self, other: I, mgn: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the middle of the bottom edge of the given Widget with the given margin between the edges. Read more
fn mid_left_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the middle of the left edge of the given Widget.
fn mid_left_with_margin_on<I>(self, other: I, mgn: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the middle of the left edge of the given Widget with the given margin between the edges. Read more
fn mid_right_of<I: Into<Index> + Copy>(self, other: I) -> Self
Place the widget in the middle of the right edge of the given Widget.
fn mid_right_with_margin_on<I>(self, other: I, mgn: Scalar) -> Self where I: Into<Index> + Copy
Place the widget in the middle of the right edge of the given Widget with the given margin between the edges. Read more
fn x_place(self, place: Place) -> Self
Place the widget at some position on the Widget along the x axis.
fn y_place(self, place: Place) -> Self
Place the widget at some position on the Widget along the y axis.
fn middle(self) -> Self
Place the widget in the middle of the current parent Widget.
fn top_left(self) -> Self
Place the widget in the top left corner of the current parent Widget.
fn top_left_with_margin(self, mgn: Scalar) -> Self
Place the widget in the top left corner of the current parent Widget with the given margin between both edges. Read more
fn top_left_with_margins(self, top: Scalar, left: Scalar) -> Self
Place the widget in the top left corner of the current parent Widget with the given margins between each respective edge. Read more
fn top_right(self) -> Self
Place the widget in the top right corner of the current parent Widget.
fn top_right_with_margin(self, mgn: Scalar) -> Self
Place the widget in the top right corner of the current parent Widget with the given margin between both edges. Read more
fn top_right_with_margins(self, top: Scalar, right: Scalar) -> Self
Place the widget in the top right corner of the current parent Widget with the given margins between each respective edge. Read more
fn bottom_left(self) -> Self
Place the widget in the bottom left corner of the current parent Widget.
fn bottom_left_with_margin(self, mgn: Scalar) -> Self
Place the widget in the bottom left corner of the current parent Widget with the given margin between both edges. Read more
fn bottom_left_with_margins(self, bottom: Scalar, left: Scalar) -> Self
Place the widget in the bottom left corner of the current parent Widget with the given margins between each respective edge. Read more
fn bottom_right(self) -> Self
Place the widget in the bottom right corner of the current parent Widget.
fn bottom_right_with_margin(self, mgn: Scalar) -> Self
Place the widget in the bottom right corner of the current parent Widget with the given margin between both edges. Read more
fn bottom_right_with_margins(self, bottom: Scalar, right: Scalar) -> Self
Place the widget in the bottom right corner of the current parent Widget with the given margins between each respective edge. Read more
fn mid_top(self) -> Self
Place the widget in the middle of the top edge of the current parent Widget.
fn mid_top_with_margin(self, mgn: Scalar) -> Self
Place the widget in the middle of the top edge of the current parent Widget with the given margin from the edge. Read more
fn mid_bottom(self) -> Self
Place the widget in the middle of the bottom edge of the current parent Widget.
fn mid_bottom_with_margin(self, mgn: Scalar) -> Self
Place the widget in the middle of the bottom edge of the current parent Widget with the given margin from the edge. Read more
fn mid_left(self) -> Self
Place the widget in the middle of the left edge of the current parent Widget.
fn mid_left_with_margin(self, mgn: Scalar) -> Self
Place the widget in the middle of the left edge of the current parent Widget with the given margin from the edge. Read more
fn mid_right(self) -> Self
Place the widget in the middle of the right edge of the current parent Widget.
fn mid_right_with_margin(self, mgn: Scalar) -> Self
Place the widget in the middle of the right edge of the current parent Widget with the given margin from the edge. Read more
impl Sizeable for Matrix
[src]
fn x_dimension(self, w: Dimension) -> Self
Set the length along the x axis.
fn y_dimension(self, h: Dimension) -> Self
Set the length along the y axis.
fn get_x_dimension<C: CharacterCache>(&self, ui: &Ui<C>) -> Dimension
The widget's length along the x axis as a Dimension.
fn get_y_dimension<C: CharacterCache>(&self, ui: &Ui<C>) -> Dimension
The widget's length along the y axis as a Dimension.
fn w(self, w: Scalar) -> Self
Set the absolute width for the widget.
fn h(self, h: Scalar) -> Self
Set the absolute height for the widget.
fn wh(self, wh: Dimensions) -> Self
Set the dimensions for the widget.
fn w_h(self, width: Scalar, height: Scalar) -> Self
Set the width and height for the widget.
fn w_of<I: Into<Index>>(self, idx: I) -> Self
Set the width as the width of the widget at the given index.
fn padded_w_of<I: Into<Index>>(self, idx: I, pad: Scalar) -> Self
Set the width as the width of the widget at the given index padded at both ends by the given Scalar. Read more
fn h_of<I: Into<Index>>(self, idx: I) -> Self
Set the height as the height of the widget at the given index.
fn padded_h_of<I: Into<Index>>(self, idx: I, pad: Scalar) -> Self
Set the height as the height of the widget at the given index padded at both ends by the given Scalar. Read more
fn wh_of<I: Into<Index> + Copy>(self, idx: I) -> Self
Set the dimensions as the dimensions of the widget at the given index.
fn padded_wh_of<I: Into<Index> + Copy>(self, idx: I, pad: Scalar) -> Self
Set the dimensions as the dimensions of the widget at the given index with all four edges padded by the given scalar. Read more
fn kid_area_w_of<I: Into<Index>>(self, idx: I) -> Self
Set the width as the width of the padded area of the widget at the given index.
fn padded_kid_area_w_of<I: Into<Index>>(self, idx: I, pad: Scalar) -> Self
Set the width as the KidArea
width for the widget at the given index, padded at both ends by the given scalar. Read more
fn kid_area_h_of<I: Into<Index>>(self, idx: I) -> Self
Set the height as the KidArea
height of the widget at the given index.
fn padded_kid_area_h_of<I: Into<Index>>(self, idx: I, pad: Scalar) -> Self
Set the height as the KidArea
height of the widget at the given index, padded at both ends by the given scalar. Read more
fn kid_area_wh_of<I: Into<Index> + Copy>(self, idx: I) -> Self
Set the dimensions as the KidArea
dimensions of the widget at the given index.
fn padded_kid_area_wh_of<I: Into<Index> + Copy>(self, idx: I, pad: Scalar) -> Self
Set the dimensions as the KidArea
dimensions of the widget at the given index, padded at all four edges by the given scalar. Read more
fn get_w<C: CharacterCache>(&self, ui: &Ui<C>) -> Option<Scalar>
Get the absolute width of the widget as a Scalar value.
fn get_h<C: CharacterCache>(&self, ui: &Ui<C>) -> Option<Scalar>
Get the height of the widget.
fn get_wh<C: CharacterCache>(&self, ui: &Ui<C>) -> Option<Dimensions>
The dimensions for the widget.