Trait conrod::Positionable [] [src]

pub trait Positionable: Sized {
    fn x_position(self, Position) -> Self;
    fn y_position(self, Position) -> Self;
    fn get_x_position<C: CharacterCache>(&self, ui: &Ui<C>) -> Position;
    fn get_y_position<C: CharacterCache>(&self, ui: &Ui<C>) -> Position;
    fn depth(self, depth: Depth) -> Self;
    fn get_depth(&self) -> Depth;

    fn x(self, x: Scalar) -> Self { ... }
    fn y(self, y: Scalar) -> Self { ... }
    fn xy(self, point: Point) -> Self { ... }
    fn x_y(self, x: Scalar, y: Scalar) -> Self { ... }
    fn x_relative(self, x: Scalar) -> Self { ... }
    fn y_relative(self, y: Scalar) -> Self { ... }
    fn xy_relative(self, point: Point) -> Self { ... }
    fn x_y_relative(self, x: Scalar, y: Scalar) -> Self { ... }
    fn x_relative_to<I: Into<Index>>(self, other: I, x: Scalar) -> Self { ... }
    fn y_relative_to<I: Into<Index>>(self, other: I, y: Scalar) -> Self { ... }
    fn xy_relative_to<I: Into<Index> + Copy>(self, other: I, xy: Point) -> Self { ... }
    fn x_y_relative_to<I: Into<Index> + Copy>(self, other: I, x: Scalar, y: Scalar) -> Self { ... }
    fn x_direction(self, direction: Direction, x: Scalar) -> Self { ... }
    fn y_direction(self, direction: Direction, y: Scalar) -> Self { ... }
    fn down(self, y: Scalar) -> Self { ... }
    fn up(self, y: Scalar) -> Self { ... }
    fn left(self, x: Scalar) -> Self { ... }
    fn right(self, x: Scalar) -> Self { ... }
    fn x_direction_from<I>(self, other: I, direction: Direction, x: Scalar) -> Self where I: Into<Index> + Copy { ... }
    fn y_direction_from<I>(self, other: I, direction: Direction, y: Scalar) -> Self where I: Into<Index> + Copy { ... }
    fn down_from<I: Into<Index> + Copy>(self, other: I, y: Scalar) -> Self { ... }
    fn up_from<I: Into<Index> + Copy>(self, other: I, y: Scalar) -> Self { ... }
    fn left_from<I: Into<Index> + Copy>(self, other: I, x: Scalar) -> Self { ... }
    fn right_from<I: Into<Index> + Copy>(self, other: I, x: Scalar) -> Self { ... }
    fn x_align(self, align: Align) -> Self { ... }
    fn y_align(self, align: Align) -> Self { ... }
    fn align_left(self) -> Self { ... }
    fn align_middle_x(self) -> Self { ... }
    fn align_right(self) -> Self { ... }
    fn align_top(self) -> Self { ... }
    fn align_middle_y(self) -> Self { ... }
    fn align_bottom(self) -> Self { ... }
    fn x_align_to<I: Into<Index>>(self, other: I, align: Align) -> Self { ... }
    fn y_align_to<I: Into<Index>>(self, other: I, align: Align) -> Self { ... }
    fn align_left_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_middle_x_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_right_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_top_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_middle_y_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn align_bottom_of<I: Into<Index>>(self, other: I) -> Self { ... }
    fn x_place_on<I: Into<Index>>(self, other: I, place: Place) -> Self { ... }
    fn y_place_on<I: Into<Index>>(self, other: I, place: Place) -> Self { ... }
    fn middle_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn top_left_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn top_right_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn bottom_left_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn bottom_right_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn mid_top_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn mid_bottom_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn mid_left_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn mid_right_of<I: Into<Index> + Copy>(self, other: I) -> Self { ... }
    fn x_place(self, place: Place) -> Self { ... }
    fn y_place(self, place: Place) -> Self { ... }
    fn middle(self) -> Self { ... }
    fn top_left(self) -> Self { ... }
    fn top_right(self) -> Self { ... }
    fn bottom_left(self) -> Self { ... }
    fn bottom_right(self) -> Self { ... }
    fn mid_top(self) -> Self { ... }
    fn mid_bottom(self) -> Self { ... }
    fn mid_left(self) -> Self { ... }
    fn mid_right(self) -> Self { ... }
}

Widgets that are positionable.

A Position is stored internally within the widget::CommonBuilder type, allowing all widgets to be positioned in a variety of different ways.

Thus, Positionable can be implemented for all types that implement Widget.

Required Methods

fn x_position(self, Position) -> Self

Build with the given Position along the x axis.

fn y_position(self, 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: Depth) -> Self

The depth at which the widget should be rendered relatively to its sibling widgets.

fn get_depth(&self) -> Depth

Return the depth.

Provided Methods

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 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 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 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 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_right_of<I: Into<Index> + Copy>(self, other: I) -> Self

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

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_right_of<I: Into<Index> + Copy>(self, other: I) -> Self

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

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_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_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_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 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_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.

Implementors