Struct libnotcurses_sys::NcPlaneOptionsBuilder
source · pub struct NcPlaneOptionsBuilder { /* private fields */ }
Expand description
Builder object for NcPlaneOptions
.
Can be constructed by calling NcPlaneOptions::builder()
.
By default it has the Marginalized
flag already set, alongside (0, 0)
margins, so that it automatically fills the parent plane.
Implementations§
source§impl NcPlaneOptionsBuilder
impl NcPlaneOptionsBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
New NcPlaneOptionsBuilder
with the Marginalized
flag set.
sourcepub fn from_options(options: &NcPlaneOptions) -> Self
pub fn from_options(options: &NcPlaneOptions) -> Self
New builder from pre-existing options.
sourcepub fn build(self) -> NcPlaneOptions
pub fn build(self) -> NcPlaneOptions
Finishes the building and returns NcPlaneOptions
.
source§impl NcPlaneOptionsBuilder
impl NcPlaneOptionsBuilder
sourcepub fn y(self, y: i32) -> Self
pub fn y(self, y: i32) -> Self
Sets the vertical placement relative to parent plane.
Default: 0
.
Effect: Sets the y coordinate and unsets the VerAligned
flag.
sourcepub fn x(self, x: i32) -> Self
pub fn x(self, x: i32) -> Self
Sets the horizontal placement relative to parent plane.
Default: 0
.
Effect: Sets the x coordinate and unsets the HorAligned
flag.
sourcepub fn yx(self, y: i32, x: i32) -> Self
pub fn yx(self, y: i32, x: i32) -> Self
Sets the vertical & horizontal placement relative to parent plane.
Effect: Sets the x
& y
coordinates and unsets the VERALIGNED
and HORALIGNED
flags.
Default: (0, 0)
.
sourcepub fn valign(self, v: impl Into<NcAlign>) -> Self
pub fn valign(self, v: impl Into<NcAlign>) -> Self
Sets the vertical alignment.
Default: NcAlign::Top
.
Effect: Sets the v
alignment and the VerAligned
flag.
sourcepub fn halign(self, h: impl Into<NcAlign>) -> Self
pub fn halign(self, h: impl Into<NcAlign>) -> Self
Sets the horizontal alignment.
Default: NcAlign::Left
.
Effect: Sets the h
alignment and the HorAligned
flag.
sourcepub fn align(self, v: impl Into<NcAlign>, h: impl Into<NcAlign>) -> Self
pub fn align(self, v: impl Into<NcAlign>, h: impl Into<NcAlign>) -> Self
Sets the vertical & horizontal alignment.
Default: (
NcAlign::Top
, NcAlign::Left
)
.
Effect: Sets the v
& h
alignments and the VerAligned
& HorAligned
flags.
sourcepub fn rows(self, rows: u32) -> Self
pub fn rows(self, rows: u32) -> Self
Sets the number of rows for the plane.
Must be >0 when not using margins
.
Default: 0
.
Effect: sets the rows field and unsets the Marginalized
flag.
sourcepub fn cols(self, cols: u32) -> Self
pub fn cols(self, cols: u32) -> Self
Sets the number of columns for the plane.
Must be >0 when not using margins
.
Default: 0
.
Effect: sets the cols field and unsets the Marginalized
flag.
sourcepub fn rows_cols(self, rows: u32, cols: u32) -> Self
pub fn rows_cols(self, rows: u32, cols: u32) -> Self
Sets the number of rows & columns for the plane.
Must be >0 when not using margins
.
Default: (0, 0)
.
Effect: sets the rows & cols fields and unsets the Marginalized
flag.
sourcepub fn margins(self, bottom: u32, right: u32) -> Self
pub fn margins(self, bottom: u32, right: u32) -> Self
Sets the bottom & right margins.
Default: (0, 0)
.
Effect: sets the margin_b
& margin_r
fields and the Marginalized
flag.
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)sets the Fixed
flag.
sourcepub fn vscroll(self, vscroll: bool) -> Self
pub fn vscroll(self, vscroll: bool) -> Self
If true
, the plane will scroll vertically to accommodate output.
Setting this flag is equivalent to immediately calling
set_scrolling(true)
following NcPlane
creation.
Default: false.
Effect: (un)sets the VScroll
flag.
See also: AutoGrow
.
sourcepub fn resizecb(self, callback: Option<NcResizeCb>) -> Self
pub fn resizecb(self, callback: Option<NcResizeCb>) -> Self
(Un)Sets the resize callback.
Default: None.
source§impl NcPlaneOptionsBuilder
impl NcPlaneOptionsBuilder
sourcepub fn set_y(&mut self, y: i32)
pub fn set_y(&mut self, y: i32)
Sets the vertical placement relative to parent plane.
Default: 0
.
Effect: Sets the y
coordinate and unsets the VerAligned
flag.
sourcepub fn set_x(&mut self, x: i32)
pub fn set_x(&mut self, x: i32)
Sets the horizontal placement relative to parent plane.
Default: 0
.
Effect: Sets the x
coordinate and unsets the HorAligned
flag.
sourcepub fn set_yx(&mut self, y: i32, x: i32)
pub fn set_yx(&mut self, y: i32, x: i32)
Sets the vertical & horizontal placement relative to parent plane.
Effect: Sets the x
& y
coordinates and unsets the VERALIGNED
and HORALIGNED
flags.
Default: (0, 0)
.
sourcepub fn set_valign(&mut self, v: impl Into<NcAlign>)
pub fn set_valign(&mut self, v: impl Into<NcAlign>)
Sets the vertical alignment.
Default: NcAlign::Top
.
Effect: Sets the y
alignment and the VerAligned
flag.
sourcepub fn set_halign(&mut self, h: impl Into<NcAlign>)
pub fn set_halign(&mut self, h: impl Into<NcAlign>)
Sets the horizontal alignment.
Default: NcAlign::Left
.
Effect: Sets the h
alignment and the HorAligned
flag.
sourcepub fn set_align(&mut self, v: impl Into<NcAlign>, h: impl Into<NcAlign>)
pub fn set_align(&mut self, v: impl Into<NcAlign>, h: impl Into<NcAlign>)
Sets the vertical & horizontal alignment.
Default: (
NcAlign::Top
, NcAlign::Left
)
.
Effect: Sets the v
& h
alignments and the VerAligned
& HorAligned
flags.
sourcepub fn set_rows(&mut self, rows: u32)
pub fn set_rows(&mut self, rows: u32)
Sets the number of rows for the plane.
Must be >0 when not using margins
.
Default: 0
.
Effect: sets the rows field and unsets the Marginalized
flag.
sourcepub fn set_cols(&mut self, cols: u32)
pub fn set_cols(&mut self, cols: u32)
Sets the number of columns for the plane.
Must be >0 when not using margins
.
Default: 0
.
Effect: sets the cols field and unsets the Marginalized
flag.
sourcepub fn set_rows_cols(&mut self, rows: u32, cols: u32)
pub fn set_rows_cols(&mut self, rows: u32, cols: u32)
Sets the number of rows & columns for the plane.
Must be >0 when not using margins
.
Default: (0, 0)
.
Effect: sets the rows & cols fields and unsets the Marginalized
flag.
sourcepub fn set_margins(&mut self, bottom: u32, right: u32)
pub fn set_margins(&mut self, bottom: u32, right: u32)
Sets the bottom & right margins.
Default: (0, 0)
.
Effect: sets the margin_b
& margin_r
fields and the Marginalized
flag.
sourcepub fn set_fixed(&mut self, fixed: bool)
pub fn set_fixed(&mut self, fixed: bool)
If true
, the plane will not scroll with the parent.
Default: false (scrolls with the parent).
Effect: (un)sets the Fixed
flag.
sourcepub fn set_vscroll(&mut self, vscroll: bool)
pub fn set_vscroll(&mut self, vscroll: bool)
If true
, the plane will scroll vertically to accommodate output.
Setting this flag is equivalent to immediately calling
set_scrolling(true)
following NcPlane
creation.
Default: false.
Effect: (un)sets the VScroll
flag.
See also: AutoGrow
.
sourcepub fn set_autogrow(&mut self, autogrow: bool)
pub fn set_autogrow(&mut self, autogrow: bool)
sourcepub fn set_resizecb(&mut self, callback: Option<NcResizeCb>)
pub fn set_resizecb(&mut self, callback: Option<NcResizeCb>)
(Un)Sets the resize callback.
Default: None.
Trait Implementations§
source§impl Clone for NcPlaneOptionsBuilder
impl Clone for NcPlaneOptionsBuilder
source§fn clone(&self) -> NcPlaneOptionsBuilder
fn clone(&self) -> NcPlaneOptionsBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for NcPlaneOptionsBuilder
impl Debug for NcPlaneOptionsBuilder
source§impl Default for NcPlaneOptionsBuilder
impl Default for NcPlaneOptionsBuilder
source§fn default() -> Self
fn default() -> Self
New NcPlaneOptionsBuilder
with the Marginalized
flag set.