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
§Constructors
impl NcPlaneOptionsBuilder
§Constructors
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
§Methods (chainable)
impl NcPlaneOptionsBuilder
§Methods (chainable)
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
§Methods (setable)
impl NcPlaneOptionsBuilder
§Methods (setable)
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.