The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
gui2::tlua_interpreter::controller Class Reference

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 (twindow &window)
 Bind my pointers to the widgets found in the window. More...
 
void handle_copy_button_clicked (twindow &window)
 Copy text to the clipboard. More...
 
void input_keypress_callback (bool &handled, bool &halt, const SDLKey key, twindow &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

tbuttoncopy_button
 
ttext_boxtext_entry
 
std::string text_entry_
 
boost::scoped_ptr
< tlua_interpreter::lua_model
lua_model_
 
boost::scoped_ptr
< tlua_interpreter::input_model
input_model_
 
boost::scoped_ptr
< tlua_interpreter::view
view_
 

Friends

class tlua_interpreter
 

Detailed Description

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 352 of file lua_interpreter.cpp.

Constructor & Destructor Documentation

gui2::tlua_interpreter::controller::controller ( lua_kernel_base lk)
inline

Definition at line 367 of file lua_interpreter.cpp.

Member Function Documentation

void gui2::tlua_interpreter::controller::bind ( twindow 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 429 of file lua_interpreter.cpp.

References _(), desktop::clipboard::available(), gui2::event::connect_signal_mouse_left_click(), gui2::event::connect_signal_pre_key_press(), handle_copy_button_clicked(), input_keypress_callback(), and LOG_LUA.

void gui2::tlua_interpreter::controller::execute ( )
private

Definition at line 514 of file lua_interpreter.cpp.

References LOG_LUA.

void gui2::tlua_interpreter::controller::handle_copy_button_clicked ( twindow window)

Copy text to the clipboard.

Definition at line 468 of file lua_interpreter.cpp.

References desktop::clipboard::copy_to_clipboard().

Referenced by bind().

void gui2::tlua_interpreter::controller::input_keypress_callback ( bool &  handled,
bool &  halt,
const SDLKey  key,
twindow window 
)

Handle return key (execute) or tab key (tab completion)

Definition at line 475 of file lua_interpreter.cpp.

References LOG_LUA.

Referenced by bind().

void gui2::tlua_interpreter::controller::search ( int  direction)
private

Definition at line 623 of file lua_interpreter.cpp.

void gui2::tlua_interpreter::controller::tab ( )
private

Definition at line 550 of file lua_interpreter.cpp.

References utils::word_completion().

void gui2::tlua_interpreter::controller::update_view ( )

Update the view based on the model.

Definition at line 417 of file lua_interpreter.cpp.

References LOG_LUA.

Friends And Related Function Documentation

friend class tlua_interpreter
friend

Definition at line 388 of file lua_interpreter.cpp.

Member Data Documentation

tbutton* gui2::tlua_interpreter::controller::copy_button
private

Definition at line 354 of file lua_interpreter.cpp.

boost::scoped_ptr<tlua_interpreter::input_model> gui2::tlua_interpreter::controller::input_model_
private

Definition at line 360 of file lua_interpreter.cpp.

boost::scoped_ptr<tlua_interpreter::lua_model> gui2::tlua_interpreter::controller::lua_model_
private

Definition at line 359 of file lua_interpreter.cpp.

ttext_box* gui2::tlua_interpreter::controller::text_entry
private

Definition at line 356 of file lua_interpreter.cpp.

std::string gui2::tlua_interpreter::controller::text_entry_
private

Definition at line 357 of file lua_interpreter.cpp.

boost::scoped_ptr<tlua_interpreter::view> gui2::tlua_interpreter::controller::view_
private

Definition at line 361 of file lua_interpreter.cpp.


The documentation for this class was generated from the following file: