The controller is responsible to hold all the input widgets, and a pointer to the model and view. More...
Public Member Functions | |
controller (lua_kernel_base &lk) | |
void | bind (window &window) |
Bind my pointers to the widgets found in the window. More... | |
void | handle_copy_button_clicked (window &window) |
Copy text to the clipboard. More... | |
void | handle_clear_button_clicked (window &window) |
Clear the text. More... | |
void | input_keypress_callback (bool &handled, bool &halt, const SDL_Keycode key, window &window) |
Handle return key (execute) or tab key (tab completion) More... | |
void | update_view () |
Update the view based on the model. More... | |
Private Member Functions | |
void | execute () |
void | tab () |
void | search (int direction) |
Private Attributes | |
button * | copy_button |
button * | clear_button |
text_box * | text_entry |
std::string | text_entry_ |
const std::unique_ptr< lua_interpreter::lua_model > | lua_model_ |
const std::unique_ptr< lua_interpreter::input_model > | input_model_ |
const std::unique_ptr< lua_interpreter::view > | view_ |
Friends | |
class | lua_interpreter |
The controller is responsible to hold all the input widgets, and a pointer to the model and view.
It is responsible to bind the input signals to appropriate handler methods, which it holds. It is also responsible to ask the view to update based on the output of the model, typically in response to some input.
Definition at line 355 of file lua_interpreter.cpp.
|
inline |
Definition at line 371 of file lua_interpreter.cpp.
void gui2::dialogs::lua_interpreter::controller::bind | ( | window & | window | ) |
Bind my pointers to the widgets found in the window.
Find all the widgets managed by the controller and connect them to handler methods.
Definition at line 437 of file lua_interpreter.cpp.
References _(), desktop::clipboard::available(), gui2::event::connect_signal_mouse_left_click(), gui2::event::connect_signal_pre_key_press(), handle_clear_button_clicked(), handle_copy_button_clicked(), input_keypress_callback(), gui2::window::keyboard_capture(), LOG_LUA, gui2::window::set_click_dismiss(), and gui2::window::set_enter_disabled().
|
private |
Definition at line 541 of file lua_interpreter.cpp.
References LOG_LUA.
void gui2::dialogs::lua_interpreter::controller::handle_clear_button_clicked | ( | window & | window | ) |
void gui2::dialogs::lua_interpreter::controller::handle_copy_button_clicked | ( | window & | window | ) |
Copy text to the clipboard.
Definition at line 482 of file lua_interpreter.cpp.
References desktop::clipboard::copy_to_clipboard().
Referenced by bind().
void gui2::dialogs::lua_interpreter::controller::input_keypress_callback | ( | bool & | handled, |
bool & | halt, | ||
const SDL_Keycode | key, | ||
window & | window | ||
) |
Handle return key (execute) or tab key (tab completion)
Definition at line 498 of file lua_interpreter.cpp.
References LOG_LUA, and gui2::widget::queue_redraw().
Referenced by bind().
|
private |
Definition at line 654 of file lua_interpreter.cpp.
|
private |
Definition at line 577 of file lua_interpreter.cpp.
References utils::word_completion().
void gui2::dialogs::lua_interpreter::controller::update_view | ( | ) |
Update the view based on the model.
Definition at line 425 of file lua_interpreter.cpp.
References LOG_LUA.
|
friend |
Definition at line 395 of file lua_interpreter.cpp.
|
private |
Definition at line 358 of file lua_interpreter.cpp.
|
private |
Definition at line 357 of file lua_interpreter.cpp.
|
private |
Definition at line 364 of file lua_interpreter.cpp.
|
private |
Definition at line 363 of file lua_interpreter.cpp.
|
private |
Definition at line 360 of file lua_interpreter.cpp.
|
private |
Definition at line 361 of file lua_interpreter.cpp.
|
private |
Definition at line 365 of file lua_interpreter.cpp.