FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<SelectableTextBlock>
    

    Returns a strong reference to this object.

    Source

    selection_start_property

    fn selection_start_property() -> &'static StyledProperty<i32>
    

    Defines the SelectionStart property.

    Source

    selection_end_property

    fn selection_end_property() -> &'static StyledProperty<i32>
    

    Defines the SelectionEnd property.

    Source

    selected_text_property

    fn selected_text_property() -> &'static DirectProperty<SelectableTextBlock, String>
    

    Defines the SelectedText property.

    Source

    selection_brush_property

    fn selection_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the SelectionBrush property.

    Source

    selection_foreground_brush_property

    fn selection_foreground_brush_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the SelectionForegroundBrush property.

    Source

    can_copy_property

    fn can_copy_property() -> &'static DirectProperty<SelectableTextBlock, bool>
    

    Defines the CanCopy property.

    Source

    copying_to_clipboard_event

    fn copying_to_clipboard_event() -> &'static RoutedEvent<RoutedEventArgs>
    

    Defines the CopyingToClipboard event.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Initializes a new instance of the SelectableTextBlock class.

    Source

    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.

    Source

    selection_brush

    fn selection_brush(self: &Self) -> Option<Rc<dyn IBrush>>
    

    The brush that highlights selected text.

    Source

    set_selection_brush

    fn set_selection_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    selection_foreground_brush

    fn selection_foreground_brush(self: &Self) -> Option<Rc<dyn IBrush>>
    

    The brush that is used for the foreground of selected text.

    Source

    set_selection_foreground_brush

    fn set_selection_foreground_brush(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    selection_start

    fn selection_start(self: &Self) -> i32
    

    The character index of the beginning of the current selection.

    Source

    set_selection_start

    fn set_selection_start(self: &Self, value: i32)
    

    Source

    selection_end

    fn selection_end(self: &Self) -> i32
    

    The character index of the end of the current selection.

    Source

    set_selection_end

    fn set_selection_end(self: &Self, value: i32)
    

    Source

    selected_text

    fn selected_text(self: &Self) -> String
    

    The content of the current selection.

    Source

    can_copy

    fn can_copy(self: &Self) -> bool
    

    Whether the copy command can be executed.

    Source

    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.

    Source

    select_all

    fn select_all(self: &Self)
    

    Selects all text of the text block.

    Source

    clear_selection

    fn clear_selection(self: &Self)
    

    Clears the current selection.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.