SelectableTextBlock
struct · ferroui-controls · v0.5.0
struct SelectableTextBlock
A control that displays a block of formatted text whose content can be selected and copied.
Members
TYPEto_refselection_start_propertyselection_end_propertyselected_text_propertyselection_brush_propertyselection_foreground_brush_propertycan_copy_propertycopying_to_clipboard_eventconstructnewcopying_to_clipboardselection_brushset_selection_brushselection_foreground_brushset_selection_foreground_brushselection_startset_selection_startselection_endset_selection_endselected_textcan_copycopyselect_allclear_selection
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<SelectableTextBlock>
Returns a strong reference to this object.
selection_start_property
fn selection_start_property() -> &'static StyledProperty<i32>
Defines the SelectionStart property.
selection_end_property
fn selection_end_property() -> &'static StyledProperty<i32>
Defines the SelectionEnd property.
selected_text_property
fn selected_text_property() -> &'static DirectProperty<SelectableTextBlock, String>
Defines the SelectedText property.
selection_brush_property
fn selection_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the SelectionBrush property.
selection_foreground_brush_property
fn selection_foreground_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the SelectionForegroundBrush property.
can_copy_property
fn can_copy_property() -> &'static DirectProperty<SelectableTextBlock, bool>
Defines the CanCopy property.
copying_to_clipboard_event
fn copying_to_clipboard_event() -> &'static RoutedEvent<RoutedEventArgs>
Defines the CopyingToClipboard event.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Initializes a new instance of the SelectableTextBlock class.
copying_to_clipboard
fn copying_to_clipboard(self: &Self, handler: impl Fn(&Interactive, &RoutedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
Raised when the selection is about to be copied to the clipboard; marking the event handled cancels the copy.
selection_brush
fn selection_brush(self: &Self) -> Option<Rc<dyn IBrush>>
The brush that highlights selected text.
set_selection_brush
fn set_selection_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
selection_foreground_brush
fn selection_foreground_brush(self: &Self) -> Option<Rc<dyn IBrush>>
The brush that is used for the foreground of selected text.
set_selection_foreground_brush
fn set_selection_foreground_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
selection_start
fn selection_start(self: &Self) -> i32
The character index of the beginning of the current selection.
set_selection_start
fn set_selection_start(self: &Self, value: i32)
selection_end
fn selection_end(self: &Self) -> i32
The character index of the end of the current selection.
set_selection_end
fn set_selection_end(self: &Self, value: i32)
selected_text
fn selected_text(self: &Self) -> String
The content of the current selection.
can_copy
fn can_copy(self: &Self) -> bool
Whether the copy command can be executed.
copy
fn copy(self: &Self)
Copies the current selection to the clipboard.
Like the asynchronous method of the reference, everything up to the
clipboard call runs before this returns. A failure platform
clipboards are known for (see
ClipboardHelper::is_expected_clipboard_exception) is logged; any
other failure, and a panic of the clipboard, is raised on the
dispatcher.
select_all
fn select_all(self: &Self)
Selects all text of the text block.
clear_selection
fn clear_selection(self: &Self)
Clears the current selection.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeControlImplExtTextBlockImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<SelectableTextBlock>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplVisualImplLayoutableImplInteractiveImplControlImplFerroObjectImplInputElementImplTextBlockImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.