Struct rat_widget::list::edit::EditListState
source · pub struct EditListState<EditorState> {
pub list: ListState<RowSelection>,
pub mouse: MouseFlags,
/* private fields */
}Expand description
State & even-handling.
Fields§
§list: ListState<RowSelection>List state
mouse: MouseFlagsImplementations§
source§impl<EditorState> EditListState<EditorState>where
EditorState: Default,
impl<EditorState> EditListState<EditorState>where
EditorState: Default,
source§impl<EditorState> EditListState<EditorState>where
EditorState: HasFocusFlag,
impl<EditorState> EditListState<EditorState>where
EditorState: HasFocusFlag,
sourcepub fn is_editing(&self) -> bool
pub fn is_editing(&self) -> bool
Editing is active?
sourcepub fn editor(&self) -> &EditorState
pub fn editor(&self) -> &EditorState
Editor widget.
Panic Panics if not editing.
sourcepub fn try_editor(&self) -> Option<&EditorState>
pub fn try_editor(&self) -> Option<&EditorState>
Editor widget.
sourcepub fn editor_mut(&mut self) -> &mut EditorState
pub fn editor_mut(&mut self) -> &mut EditorState
Editor widget.
Panic Panics if not editing.
sourcepub fn try_editor_mut(&mut self) -> Option<&mut EditorState>
pub fn try_editor_mut(&mut self) -> Option<&mut EditorState>
Editor widget.
sourcepub fn start_edit(&mut self, pos: usize, edit: EditorState)
pub fn start_edit(&mut self, pos: usize, edit: EditorState)
Start editing at the position.
The editor state must be initialized to an appropriate state.
sourcepub fn cancel_edit(&mut self)
pub fn cancel_edit(&mut self)
Cancel editing.
Updates the state to remove the edited row.
Trait Implementations§
source§impl<EditorState: Debug> Debug for EditListState<EditorState>
impl<EditorState: Debug> Debug for EditListState<EditorState>
source§impl<EditorState: Default> Default for EditListState<EditorState>
impl<EditorState: Default> Default for EditListState<EditorState>
source§fn default() -> EditListState<EditorState>
fn default() -> EditListState<EditorState>
Returns the “default value” for a type. Read more
source§impl<EditorState, EQualifier> HandleEvent<Event, EQualifier, EditOutcome> for EditListState<EditorState>where
EditorState: HandleEvent<Event, EQualifier, EditOutcome> + HandleEvent<Event, MouseOnly, EditOutcome> + HasFocusFlag,
impl<EditorState, EQualifier> HandleEvent<Event, EQualifier, EditOutcome> for EditListState<EditorState>where
EditorState: HandleEvent<Event, EQualifier, EditOutcome> + HandleEvent<Event, MouseOnly, EditOutcome> + HasFocusFlag,
source§impl<EditorState> HasFocusFlag for EditListState<EditorState>where
EditorState: HasFocusFlag,
impl<EditorState> HasFocusFlag for EditListState<EditorState>where
EditorState: HasFocusFlag,
source§fn z_areas(&self) -> &[ZRect]
fn z_areas(&self) -> &[ZRect]
The widget might have several disjointed areas.
This is the case if it is showing a popup, but there
might be other causes. Read more
Declares how the widget interacts with focus. Read more
source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Focused?
source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Just lost focus.
source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Just gained focus.
source§impl<EditorState> HasScreenCursor for EditListState<EditorState>where
EditorState: HasScreenCursor,
impl<EditorState> HasScreenCursor for EditListState<EditorState>where
EditorState: HasScreenCursor,
Auto Trait Implementations§
impl<EditorState> !Freeze for EditListState<EditorState>
impl<EditorState> !RefUnwindSafe for EditListState<EditorState>
impl<EditorState> !Send for EditListState<EditorState>
impl<EditorState> !Sync for EditListState<EditorState>
impl<EditorState> Unpin for EditListState<EditorState>where
EditorState: Unpin,
impl<EditorState> !UnwindSafe for EditListState<EditorState>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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