Struct mg::Mg
[−]
[src]
pub struct Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static, { /* fields omitted */ }
Methods
impl<COMM, SETT> Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
fn default_completers() -> Completers
[src]
Get the default completers. One to complete the commands, the other to complete the settings.
fn delete_current_completion_item(&self)
[src]
Delete the current completion item.
fn show_completion(&self)
[src]
Show the completion view.
fn update_completions(&self)
[src]
Update the items of the completion view.
impl<COMM, SETT> Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
fn get_foreground_color(&self) -> RGBA
[src]
Get the color of the text.
fn reset_colors(&self)
[src]
Reset the background and foreground colors of the status bar.
fn set_dark_theme(&mut self, use_dark: bool)
[src]
Use the dark variant of the theme if available.
impl<COMM, SETT> Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
fn action_to_command(&self, action: &str) -> ShortcutCommand
[src]
Convert an action String to a command String.
fn command_activate(&mut self, input: Option<String>)
[src]
Handle the command entry activate event.
fn execute_commands(&mut self, parse_result: ParseResult<COMM>, activated: bool)
[src]
Execute the commands and show the errors contained in the parse result.
fn handle_command(
&mut self,
command: Option<String>,
activated: bool,
prefix: Option<u32>
) -> Option<Msg<COMM, SETT>>
[src]
&mut self,
command: Option<String>,
activated: bool,
prefix: Option<u32>
) -> Option<Msg<COMM, SETT>>
Handle the command activate event.
fn handle_special_command(
&mut self,
activation_type: ActivationType,
command: &str
) -> Option<Msg<COMM, SETT>>
[src]
&mut self,
activation_type: ActivationType,
command: &str
) -> Option<Msg<COMM, SETT>>
Handle a special command activate or key press event.
impl<COMM, SETT> Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
fn blocking_custom_dialog(
&mut self,
responder: Box<Responder>,
builder: DialogBuilder
)
[src]
&mut self,
responder: Box<Responder>,
builder: DialogBuilder
)
Ask a question to the user and block until the user provides it (or cancel).
fn blocking_input(
&mut self,
responder: Box<Responder>,
message: String,
default_answer: String
)
[src]
&mut self,
responder: Box<Responder>,
message: String,
default_answer: String
)
Ask a question to the user and block until the user provides it (or cancel).
fn blocking_question(
&mut self,
responder: Box<Responder>,
message: String,
choices: Vec<char>
)
[src]
&mut self,
responder: Box<Responder>,
message: String,
choices: Vec<char>
)
Ask a multiple-choice question to the user and block until the user provides it (or cancel).
fn blocking_yes_no_question(
&mut self,
responder: Box<Responder>,
message: String
)
[src]
&mut self,
responder: Box<Responder>,
message: String
)
Show a blocking yes/no question.
fn input(
&mut self,
responder: Box<Responder>,
message: String,
default_answer: String
)
[src]
&mut self,
responder: Box<Responder>,
message: String,
default_answer: String
)
Ask a question to the user.
fn question(
&mut self,
responder: Box<Responder>,
message: String,
choices: &[char]
)
[src]
&mut self,
responder: Box<Responder>,
message: String,
choices: &[char]
)
Ask a multiple-choice question to the user.
fn set_dialog_answer(&mut self, answer: &str)
[src]
Set the answer to return to the caller of the dialog.
fn show_dialog(&mut self, dialog_builder: DialogBuilder)
[src]
Show a dialog created with a DialogBuilder
.
fn show_dialog_without_shortcuts(&mut self, dialog_builder: DialogBuilder)
[src]
Show a dialog created with a DialogBuilder
which does not contain shortcut.
fn yes_no_question(&mut self, responder: Box<Responder>, message: String)
[src]
Show a yes/no question.
impl<COMM, SETT> Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
fn inhibit_key_press(current_mode: &Rc<Cell<Mode>>, key: &EventKey) -> Inhibit
[src]
Check if the key should be inhibitted.
fn key_press(&mut self, key: &EventKey)
[src]
Handle the key press event.
fn key_release(&mut self, key: &EventKey)
[src]
Handle the key release event.
impl<COMM, SETT> Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
fn add_to_shortcut(&mut self, key: Key)
[src]
Add the key to the current shortcut.
fn clear_shortcut(&mut self)
[src]
Clear the current shortcut buffer.
fn handle_input_shortcut(&mut self, key: &EventKey) -> bool
[src]
Handle a shortcut in input mode.
fn inhibit_handle_shortcut(
current_mode: &Rc<Cell<Mode>>,
key: &EventKey
) -> Inhibit
[src]
current_mode: &Rc<Cell<Mode>>,
key: &EventKey
) -> Inhibit
Check if the key should be inhibitted for the shortcut.
fn handle_shortcut(&mut self, key: &EventKey) -> Option<Msg<COMM, SETT>>
[src]
Handle a possible input of a shortcut.
impl<COMM, SETT> Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
fn set_completer(&mut self, completer: &str)
[src]
Set the current status bar input completer.
Trait Implementations
impl<COMM, SETT> Widget for Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
An Mg application window contains a status bar where the user can type a command and a central widget.
fn init_view(&mut self)
[src]
Update the view after it is initially created. This method is only useful when using the #[widget]
attribute, because when not using it, you can use the view()
method instead. Read more
fn view(relm: &Relm<Self>, __relm_model: Self::Model) -> Self
[src]
Create the initial view.
type Root = Window
The type of the root widget.
fn root(&self) -> Self::Root
[src]
Get the root widget of the view.e. the root widget of the view.
fn on_add<W>(&self, _parent: W) where
W: IsA<Widget> + IsA<Object>,
[src]
W: IsA<Widget> + IsA<Object>,
Method called when the widget is added to its parent.
fn parent_id() -> Option<&'static str>
[src]
Get the parent ID. This is useful for custom Container implementation: when you implement the Container::add_widget()
, you might want to insert widgets elsewhere depending of this id. Read more
fn run(model_param: Self::ModelParam) -> Result<(), ()> where
Self: 'static,
[src]
Self: 'static,
Create the window from this widget and start the main loop.
impl<COMM, SETT> Container for Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
type Container = Box
The type of the containing widget, i.e. where the child widgets will be added.
type Containers = MgContainers
Type to contain the additional container widgets.
fn container(&self) -> &Self::Container
[src]
Get the containing widget, i.e. the widget where the children will be added.
fn other_containers(&self) -> Self::Containers
[src]
Get additional container widgets. This is useful to create a multi-container. Read more
fn add_widget<WIDGET: Widget>(
container: &ContainerComponent<Self>,
widget: &Component<WIDGET>
) -> Container
[src]
container: &ContainerComponent<Self>,
widget: &Component<WIDGET>
) -> Container
Add a relm widget to this container. Return the widget that will be send to Widget::on_add(). Read more
impl<COMM, SETT> Update for Mg<COMM, SETT> where
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
[src]
COMM: Clone + EnumFromStr + EnumMetaData + SpecialCommand + 'static,
SETT: Default + EnumMetaData + Settings + SettingCompletion + 'static,
type Msg = Msg<COMM, SETT>
The type of the messages sent to the update()
method.
type Model = Model<COMM, SETT>
The type of the model.
type ModelParam = (Modes, Result<PathBuf>, Option<PathBuf>, Vec<DefaultConfig>)
The type of the parameter of the model() function used to initialize the model.
fn update(&mut self, event: Msg<COMM, SETT>)
[src]
Method called when a message is received from an event.
fn model(
relm: &Relm<Self>,
(user_modes, settings_filename, include_path, default_config): (Modes, Result<PathBuf>, Option<PathBuf>, Vec<DefaultConfig>)
) -> Model<COMM, SETT>
[src]
relm: &Relm<Self>,
(user_modes, settings_filename, include_path, default_config): (Modes, Result<PathBuf>, Option<PathBuf>, Vec<DefaultConfig>)
) -> Model<COMM, SETT>
Create the initial model.
fn subscriptions(&mut self, _relm: &Relm<Self>)
Connect the subscriptions. Subscriptions are Future
/Stream
that are spawn when the object is created. Read more