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]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

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 position(self, pos: Position) -> Self

Set the Position.

fn get_position(&self, theme: &Theme) -> Position

Get the Position.

fn horizontal_align(self, h_align: HorizontalAlign) -> Self

Align the position horizontally (only effective for Up or Down Directions).

fn vertical_align(self, v_align: VerticalAlign) -> Self

Align the position vertically (only effective for Left or Right Directions).

fn get_horizontal_align(&self, theme: &Theme) -> HorizontalAlign

Return the horizontal alignment.

fn get_vertical_align(&self, theme: &Theme) -> VerticalAlign

Return the vertical alignment.

fn depth(self, _: Depth) -> Self

The depth at which the widget should be rendered.

fn get_depth(&self) -> Depth

Return the depth.

fn point(self, point: Point) -> Self

Set the position with some Point.

fn xy(self, x: Scalar, y: Scalar) -> Self

Set the position with XY co-ords.

fn relative(self, point: Point) -> Self

Set the point relative to the previous widget.

fn relative_xy(self, x: Scalar, y: Scalar) -> Self

Set the xy relative to the previous widget.

fn relative_to<I: Into<Index>>(self, other: I, point: Point) -> Self

Set the position relative to the widget with the given widget::Index.

fn relative_xy_to<I: Into<Index>>(self, other: I, x: Scalar, y: Scalar) -> Self

Set the position relative to the widget with the given widget::Index.

fn down(self, pixels: Scalar) -> Self

Set the position as below the previous widget.

fn up(self, pixels: Scalar) -> Self

Set the position as above the previous widget.

fn left(self, pixels: Scalar) -> Self

Set the position to the left of the previous widget.

fn right(self, pixels: Scalar) -> Self

Set the position to the right of the previous widget.

fn down_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self

Set the position as below the widget with the given widget::Index.

fn up_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self

Set the position as above the widget with the given widget::Index.

fn left_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self

Set the position to the left of the widget with the given widget::Index.

fn right_from<I: Into<Index>>(self, other: I, pixels: Scalar) -> Self

Set the position to the right of the widget with the given widget::Index.

fn get_alignment(&self, theme: &Theme) -> (HorizontalAlign, VerticalAlign)

Return the alignment of both axis.

fn align_left(self) -> Self

Align the position to the left (only effective for Up or Down Directions).

fn align_middle_x(self) -> Self

Align the position to the middle (only effective for Up or Down Directions).

fn align_right(self) -> Self

Align the position to the right (only effective for Up or Down Directions).

fn align_top(self) -> Self

Align the position to the top (only effective for Left or Right Directions).

fn align_middle_y(self) -> Self

Align the position to the middle (only effective for Left or Right Directions).

fn align_bottom(self) -> Self

Align the position to the bottom (only effective for Left or Right Directions).

fn align_left_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the left (only effective for Up or Down Directions).

fn align_middle_x_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the middle (only effective for Up or Down Directions).

fn align_right_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the right (only effective for Up or Down Directions).

fn align_top_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the top (only effective for Left or Right Directions).

fn align_middle_y_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the middle (only effective for Left or Right Directions).

fn align_bottom_of<I: Into<Index>>(self, other: I) -> Self

Align the position to the bottom (only effective for Left or Right Directions).

fn place(self, place: Place, maybe_idx: Option<Index>) -> Self

Place the widget at some position on the Widget.

fn middle_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the given Widget.

fn top_left_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the top left corner of the given Widget.

fn top_right_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the top right corner of the given Widget.

fn bottom_left_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the bottom left corner of the given Widget.

fn bottom_right_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the bottom right corner of the given Widget.

fn mid_top_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the top edge of the given Widget.

fn mid_bottom_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the bottom edge of the given Widget.

fn mid_left_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the left edge of the given Widget.

fn mid_right_of<I: Into<Index>>(self, other: I) -> Self

Place the widget in the middle of the right edge of the given Widget.

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_right(self) -> Self

Place the widget in the top right corner of the current parent Widget.

fn bottom_left(self) -> Self

Place the widget in the bottom left corner of the current parent Widget.

fn bottom_right(self) -> Self

Place the widget in the bottom right corner of the current parent Widget.

fn mid_top(self) -> Self

Place the widget in the middle of the top edge of the current parent Widget.

fn mid_bottom(self) -> Self

Place the widget in the middle of the bottom edge of the current parent Widget.

fn mid_left(self) -> Self

Place the widget in the middle of the left edge of the current parent Widget.

fn mid_right(self) -> Self

Place the widget in the middle of the right edge of the current parent Widget.

impl Sizeable for Matrix
[src]

fn width(self, w: f64) -> Self

Set the width for the widget.

fn height(self, h: f64) -> Self

Set the height for the widget.

fn get_width<C: CharacterCache>(&self, theme: &Theme, _: &GlyphCache<C>) -> f64

Get the width of the widget.

fn get_height(&self, theme: &Theme) -> f64

Get the height of the widget.

fn dim(self, dim: Dimensions) -> Self

Set the dimensions for the widget.

fn dimensions(self, width: Scalar, height: Scalar) -> Self

Set the width and height for the widget.

fn get_dimensions<C: CharacterCache>(&self, theme: &Theme, glyph_cache: &GlyphCache<C>) -> Dimensions

The dimensions for the widget.