pub struct PlaneBuilder { /* private fields */ }Expand description
A Plane builder.
Implementations§
Source§impl PlaneBuilder
§Constructors
impl PlaneBuilder
§Constructors
Source§impl PlaneBuilder
§Methods (chainable)
impl PlaneBuilder
§Methods (chainable)
Sourcepub fn y(self, y: i32) -> Self
pub fn y(self, y: i32) -> Self
Sets the vertical position relative to the parent plane.
Default: 0.
Effect: Sets the y coordinate and unsets vertical alignment.
Sourcepub fn x(self, x: i32) -> Self
pub fn x(self, x: i32) -> Self
Sets the horizontal position relative to the parent plane.
Default: 0.
Effect: Sets the x coordinate and unsets vertical alignment.
Sourcepub fn position(self, position: impl Into<Position>) -> Self
pub fn position(self, position: impl Into<Position>) -> Self
Sets the position relative to parent plane.
Default: 0, 0.
Effect: Sets both x & y coordinates and unsets both horizontal and
vertical alignment.
Sourcepub fn align(self, vertical: Align, horizontal: Align) -> Self
pub fn align(self, vertical: Align, horizontal: Align) -> Self
Sets the vertical & horizontal placement relative to parent plane.
Default: 0, 0.
Effect: Sets both horizontal and vertical alignment.
Sourcepub fn height(self, height: u32) -> Self
pub fn height(self, height: u32) -> Self
Sets the height of the plane (rows).
Default: 0.
Effect: Sets the height of the plane and unmaximizes it.
Sourcepub fn width(self, width: u32) -> Self
pub fn width(self, width: u32) -> Self
Sets the width for the plane (columns).
Default: 0.
Effect: Sets the width of the plane and unmaximizes it.
Sourcepub fn size(self, size: impl Into<Size>) -> Self
pub fn size(self, size: impl Into<Size>) -> Self
Sets the size of the plane (rows, columns).
Default: 0.
Effect: Sets the height and width of the plane and unmaximizes it.
Sourcepub fn maximize(self, right_bottom: impl Into<Size>) -> Self
pub fn maximize(self, right_bottom: impl Into<Size>) -> Self
Maximizes the plane, with optional right & bottom margins.
Default: (0, 0).
Effect: maximizes the plane relative to the parent plane, minus the provided margins.
See also: sys::NcPlaneFlag::Marginalized.
Sourcepub fn fixed(self, fixed: bool) -> Self
pub fn fixed(self, fixed: bool) -> Self
If true, the plane will not scroll with the parent.
Default: false (scrolls with the parent).
Effect: (un)fixes the plane.
See also: sys::NcPlaneFlag::Fixed.
Sourcepub fn scroll(self, scroll: bool) -> Self
pub fn scroll(self, scroll: bool) -> Self
If true, the plane will scroll vertically to accommodate output.
This is equivalent to immediately calling set_scrolling(true)
following Plane creation.
Default: false.
Effect: (un)sets vertical scrolling.
Sourcepub fn autogrow(self, autogrow: bool) -> Self
pub fn autogrow(self, autogrow: bool) -> Self
If true, the plane will grow automatically.
Default: false.
Effect: (un)sets the plane to automatically grow to accomodate output.
Note that just setting autogrow makes the plane grow to the right,
and setting autogrow and scroll makes the plane grow downwards.