#include <text_box.hpp>
Public Member Functions | |
ttext_history () | |
void | push (const std::string &text) |
Push string into the history if it is non-empty and is not the same as the last item updates position to end of history. | |
std::string | up (const std::string &text="") |
One step up/down in history. Pushes text to the history if at the end. | |
std::string | down (const std::string &text="") |
std::string | get_value () const |
Returns the value at the current history position. | |
void | set_enabled (bool enabled=true) |
bool | get_enabled () const |
Static Public Member Functions | |
static ttext_history | get_history (const std::string &id, const bool enabled) |
Gets history that matches id and enables or disables it. | |
Private Member Functions | |
ttext_history (std::vector< std::string > *history, const bool enabled) | |
Private Attributes | |
std::vector< std::string > * | history_ |
unsigned | pos_ |
bool | enabled_ |
Definition at line 24 of file text_box.hpp.
gui2::ttext_history::ttext_history | ( | ) | [inline] |
gui2::ttext_history::ttext_history | ( | std::vector< std::string > * | history, | |
const bool | enabled | |||
) | [inline, private] |
Definition at line 54 of file text_box.hpp.
ttext_history gui2::ttext_history::get_history | ( | const std::string & | id, | |
const bool | enabled | |||
) | [static] |
Gets history that matches id and enables or disables it.
Definition at line 337 of file text_box.cpp.
References preferences::get_history(), and ttext_history().
void gui2::ttext_history::push | ( | const std::string & | text | ) |
Push string into the history if it is non-empty and is not the same as the last item updates position to end of history.
Definition at line 343 of file text_box.cpp.
References enabled_, history_, and pos_.
Referenced by down(), gui2::ttext_box::save_to_history(), and up().
std::string gui2::ttext_history::up | ( | const std::string & | text = "" |
) |
One step up/down in history. Pushes text to the history if at the end.
Definition at line 356 of file text_box.cpp.
References enabled_, get_value(), history_, pos_, and push().
Referenced by gui2::ttext_box::handle_key_up_arrow().
std::string gui2::ttext_history::down | ( | const std::string & | text = "" |
) |
Definition at line 375 of file text_box.cpp.
References enabled_, get_value(), history_, pos_, and push().
Referenced by gui2::ttext_box::handle_key_down_arrow().
std::string gui2::ttext_history::get_value | ( | ) | const |
void gui2::ttext_history::set_enabled | ( | bool | enabled = true |
) | [inline] |
bool gui2::ttext_history::get_enabled | ( | ) | const [inline] |
Definition at line 51 of file text_box.hpp.
References enabled_.
Referenced by gui2::ttext_box::handle_key_down_arrow(), and gui2::ttext_box::handle_key_up_arrow().
std::vector<std::string>* gui2::ttext_history::history_ [private] |
unsigned gui2::ttext_history::pos_ [private] |
bool gui2::ttext_history::enabled_ [private] |
Definition at line 63 of file text_box.hpp.
Referenced by down(), get_enabled(), get_value(), push(), set_enabled(), and up().
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |