Struct broot::command::PanelInput
source · pub struct PanelInput {
pub input_field: InputField,
/* private fields */
}
Expand description
Wrap the input of a panel, receive events and make commands
Fields§
§input_field: InputField
Implementations§
source§impl PanelInput
impl PanelInput
pub fn new(area: Area) -> Self
pub fn set_content(&mut self, content: &str)
pub fn get_content(&self) -> String
pub fn display( &mut self, w: &mut W, active: bool, mode: Mode, area: Area, panel_skin: &PanelSkin ) -> Result<(), ProgramError>
sourcepub fn on_event(
&mut self,
w: &mut W,
timed_event: TimedEvent,
con: &AppContext,
sel_info: SelInfo<'_>,
app_state: &AppState,
mode: Mode,
panel_state_type: PanelStateType
) -> Result<Command, ProgramError>
pub fn on_event( &mut self, w: &mut W, timed_event: TimedEvent, con: &AppContext, sel_info: SelInfo<'_>, app_state: &AppState, mode: Mode, panel_state_type: PanelStateType ) -> Result<Command, ProgramError>
consume the event to
- maybe change the input
- build a command then redraw the input field
sourcepub fn escape(&mut self, con: &AppContext, mode: Mode) -> Command
pub fn escape(&mut self, con: &AppContext, mode: Mode) -> Command
escape (bound to the ‘esc’ key)
This function is better called from the on_key method of panel input, when a key triggers it, because then it can also properly deal with completion sequence. When ‘:escape’ is called from a verb’s cmd sequence, then it’s not called on on_key but by the app.
Auto Trait Implementations§
impl RefUnwindSafe for PanelInput
impl Send for PanelInput
impl Sync for PanelInput
impl Unpin for PanelInput
impl UnwindSafe for PanelInput
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