Struct zng::text::cmd::TextSelectOp
source · pub struct TextSelectOp { /* private fields */ }
Expand description
Represents a text selection operation that can be send to an editable text using SELECT_CMD
.
Implementations§
source§impl TextSelectOp
impl TextSelectOp
sourcepub fn new(op: impl FnMut() + Send + 'static) -> TextSelectOp
pub fn new(op: impl FnMut() + Send + 'static) -> TextSelectOp
New text select operation.
The editable text widget that handles SELECT_CMD
will call op
during event handling in
the node::layout_text
context. You can position the caret using ResolvedText::caret
,
the text widget will detect changes to it and react accordingly (updating caret position and animation),
the caret index is also snapped to the nearest grapheme start.
sourcepub fn next() -> TextSelectOp
pub fn next() -> TextSelectOp
Clear selection and move the caret to the next insert index.
This is the Right
key operation.
sourcepub fn select_next() -> TextSelectOp
pub fn select_next() -> TextSelectOp
Extend or shrink selection by moving the caret to the next insert index.
This is the SHIFT+Right
key operation.
sourcepub fn prev() -> TextSelectOp
pub fn prev() -> TextSelectOp
Clear selection and move the caret to the previous insert index.
This is the Left
key operation.
sourcepub fn select_prev() -> TextSelectOp
pub fn select_prev() -> TextSelectOp
Extend or shrink selection by moving the caret to the previous insert index.
This is the SHIFT+Left
key operation.
sourcepub fn next_word() -> TextSelectOp
pub fn next_word() -> TextSelectOp
Clear selection and move the caret to the next word insert index.
This is the CTRL+Right
shortcut operation.
sourcepub fn select_next_word() -> TextSelectOp
pub fn select_next_word() -> TextSelectOp
Extend or shrink selection by moving the caret to the next word insert index.
This is the CTRL+SHIFT+Right
shortcut operation.
sourcepub fn prev_word() -> TextSelectOp
pub fn prev_word() -> TextSelectOp
Clear selection and move the caret to the previous word insert index.
This is the CTRL+Left
shortcut operation.
sourcepub fn select_prev_word() -> TextSelectOp
pub fn select_prev_word() -> TextSelectOp
Extend or shrink selection by moving the caret to the previous word insert index.
This is the CTRL+SHIFT+Left
shortcut operation.
sourcepub fn line_up() -> TextSelectOp
pub fn line_up() -> TextSelectOp
Clear selection and move the caret to the nearest insert index on the previous line.
This is the Up
key operation.
sourcepub fn select_line_up() -> TextSelectOp
pub fn select_line_up() -> TextSelectOp
Extend or shrink selection by moving the caret to the nearest insert index on the previous line.
This is the SHIFT+Up
key operation.
sourcepub fn line_down() -> TextSelectOp
pub fn line_down() -> TextSelectOp
Clear selection and move the caret to the nearest insert index on the next line.
This is the Down
key operation.
sourcepub fn select_line_down() -> TextSelectOp
pub fn select_line_down() -> TextSelectOp
Extend or shrink selection by moving the caret to the nearest insert index on the next line.
This is the SHIFT+Down
key operation.
sourcepub fn page_up() -> TextSelectOp
pub fn page_up() -> TextSelectOp
Clear selection and move the caret one viewport up.
This is the PageUp
key operation.
sourcepub fn select_page_up() -> TextSelectOp
pub fn select_page_up() -> TextSelectOp
Extend or shrink selection by moving the caret one viewport up.
This is the SHIFT+PageUp
key operation.
sourcepub fn page_down() -> TextSelectOp
pub fn page_down() -> TextSelectOp
Clear selection and move the caret one viewport down.
This is the PageDown
key operation.
sourcepub fn select_page_down() -> TextSelectOp
pub fn select_page_down() -> TextSelectOp
Extend or shrink selection by moving the caret one viewport down.
This is the SHIFT+PageDown
key operation.
sourcepub fn line_start() -> TextSelectOp
pub fn line_start() -> TextSelectOp
Clear selection and move the caret to the start of the line.
This is the Home
key operation.
sourcepub fn select_line_start() -> TextSelectOp
pub fn select_line_start() -> TextSelectOp
Extend or shrink selection by moving the caret to the start of the line.
This is the SHIFT+Home
key operation.
sourcepub fn line_end() -> TextSelectOp
pub fn line_end() -> TextSelectOp
Clear selection and move the caret to the end of the line (before the line-break if any).
This is the End
key operation.
sourcepub fn select_line_end() -> TextSelectOp
pub fn select_line_end() -> TextSelectOp
Extend or shrink selection by moving the caret to the end of the line (before the line-break if any).
This is the SHIFT+End
key operation.
sourcepub fn text_start() -> TextSelectOp
pub fn text_start() -> TextSelectOp
Clear selection and move the caret to the text start.
This is the CTRL+Home
shortcut operation.
sourcepub fn select_text_start() -> TextSelectOp
pub fn select_text_start() -> TextSelectOp
Extend or shrink selection by moving the caret to the text start.
This is the CTRL+SHIFT+Home
shortcut operation.
sourcepub fn text_end() -> TextSelectOp
pub fn text_end() -> TextSelectOp
Clear selection and move the caret to the text end.
This is the CTRL+End
shortcut operation.
sourcepub fn select_text_end() -> TextSelectOp
pub fn select_text_end() -> TextSelectOp
Extend or shrink selection by moving the caret to the text end.
This is the CTRL+SHIFT+End
shortcut operation.
sourcepub fn nearest_to(window_point: Point2D<Dip, Dip>) -> TextSelectOp
pub fn nearest_to(window_point: Point2D<Dip, Dip>) -> TextSelectOp
Clear selection and move the caret to the insert point nearest to the window_point
.
This is the mouse primary button down operation.
sourcepub fn select_nearest_to(window_point: Point2D<Dip, Dip>) -> TextSelectOp
pub fn select_nearest_to(window_point: Point2D<Dip, Dip>) -> TextSelectOp
Extend or shrink selection by moving the caret to the insert point nearest to the window_point
.
This is the mouse primary button down when holding SHIFT operation.
sourcepub fn select_index_nearest_to(
window_point: Point2D<Dip, Dip>,
move_selection_index: bool,
) -> TextSelectOp
pub fn select_index_nearest_to( window_point: Point2D<Dip, Dip>, move_selection_index: bool, ) -> TextSelectOp
Extend or shrink selection by moving the caret index or caret selection index to the insert point nearest to window_point
.
This is the touch selection caret drag operation.
sourcepub fn select_word_nearest_to(
replace_selection: bool,
window_point: Point2D<Dip, Dip>,
) -> TextSelectOp
pub fn select_word_nearest_to( replace_selection: bool, window_point: Point2D<Dip, Dip>, ) -> TextSelectOp
Replace or extend selection with the word nearest to the window_point
This is the mouse primary button double click.
sourcepub fn select_line_nearest_to(
replace_selection: bool,
window_point: Point2D<Dip, Dip>,
) -> TextSelectOp
pub fn select_line_nearest_to( replace_selection: bool, window_point: Point2D<Dip, Dip>, ) -> TextSelectOp
Replace or extend selection with the line nearest to the window_point
This is the mouse primary button triple click.
sourcepub fn select_all() -> TextSelectOp
pub fn select_all() -> TextSelectOp
Select the full text.
Trait Implementations§
source§impl Clone for TextSelectOp
impl Clone for TextSelectOp
source§fn clone(&self) -> TextSelectOp
fn clone(&self) -> TextSelectOp
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for TextSelectOp
impl !RefUnwindSafe for TextSelectOp
impl Send for TextSelectOp
impl Sync for TextSelectOp
impl Unpin for TextSelectOp
impl !UnwindSafe for TextSelectOp
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more