FIFE
|
A Command line widget. More...
#include <commandline.h>
Public Types | |
typedef boost::function1< void, std::string > | type_callback |
Public Member Functions | |
CommandLine () | |
Constructor. More... | |
~CommandLine () | |
Destructor. More... | |
void | keyPressed (gcn::KeyEvent &keyEvent) |
virtual void | drawCaret (gcn::Graphics *graphics, int32_t x) |
void | setCallback (const type_callback &cb) |
Set callback on pressing the ENTER key. More... | |
void | toggleCaretVisible () |
Toggle the caret visibility. More... | |
void | startBlinking () |
Start blinking the caret. More... | |
void | stopBlinking () |
Stop blinking the caret for a few seconds. More... | |
![]() | |
UTF8TextField (const std::string &text="") | |
UTF8TextField constructor. More... | |
virtual | ~UTF8TextField () |
Destructor. More... | |
virtual void | keyPressed (KeyEvent &keyEvent) |
Key pressed handler. More... | |
Private Attributes | |
type_callback | m_callback |
std::vector< std::string > | m_history |
size_t | m_history_position |
std::string | m_cmdline |
bool | m_caretVisible |
Timer | m_blinkTimer |
Timer | m_suppressBlinkTimer |
Additional Inherited Members | |
![]() | |
UTF8StringEditor * | mStringEditor |
UTF-8 string editor suppor. More... | |
A Command line widget.
Definition at line 44 of file commandline.h.
typedef boost::function1<void,std::string> FIFE::CommandLine::type_callback |
Definition at line 46 of file commandline.h.
FIFE::CommandLine::CommandLine | ( | ) |
Constructor.
Definition at line 41 of file commandline.cpp.
References m_blinkTimer, m_suppressBlinkTimer, FIFE::Timer::setCallback(), FIFE::Timer::setInterval(), FIFE::Timer::start(), startBlinking(), and toggleCaretVisible().
FIFE::CommandLine::~CommandLine | ( | ) |
Destructor.
Definition at line 52 of file commandline.cpp.
|
virtual |
Definition at line 138 of file commandline.cpp.
References m_caretVisible.
void FIFE::CommandLine::keyPressed | ( | gcn::KeyEvent & | keyEvent | ) |
Definition at line 70 of file commandline.cpp.
References FIFE::Key::BACKSPACE, FIFE::Key::DELETE, FIFE::Key::DOWN, FIFE::Key::END, FIFE::Key::ENTER, FIFE::Key::HOME, gcn::UTF8TextField::keyPressed(), FIFE::Key::LEFT, m_callback, m_cmdline, m_history, m_history_position, FIFE::Key::RIGHT, stopBlinking(), and FIFE::Key::UP.
void FIFE::CommandLine::setCallback | ( | const type_callback & | cb | ) |
Set callback on pressing the ENTER key.
Definition at line 148 of file commandline.cpp.
References m_callback.
Referenced by FIFE::Console::Console().
void FIFE::CommandLine::startBlinking | ( | ) |
Start blinking the caret.
Definition at line 65 of file commandline.cpp.
References m_blinkTimer, m_suppressBlinkTimer, FIFE::Timer::start(), and FIFE::Timer::stop().
Referenced by CommandLine().
void FIFE::CommandLine::stopBlinking | ( | ) |
Stop blinking the caret for a few seconds.
Definition at line 59 of file commandline.cpp.
References m_blinkTimer, m_caretVisible, m_suppressBlinkTimer, FIFE::Timer::start(), and FIFE::Timer::stop().
Referenced by keyPressed().
void FIFE::CommandLine::toggleCaretVisible | ( | ) |
Toggle the caret visibility.
Definition at line 55 of file commandline.cpp.
References m_caretVisible.
Referenced by CommandLine().
|
private |
Definition at line 80 of file commandline.h.
Referenced by CommandLine(), startBlinking(), and stopBlinking().
|
private |
Definition at line 75 of file commandline.h.
Referenced by keyPressed(), and setCallback().
|
private |
Definition at line 79 of file commandline.h.
Referenced by drawCaret(), stopBlinking(), and toggleCaretVisible().
|
private |
Definition at line 78 of file commandline.h.
Referenced by keyPressed().
|
private |
Definition at line 76 of file commandline.h.
Referenced by keyPressed().
|
private |
Definition at line 77 of file commandline.h.
Referenced by keyPressed().
|
private |
Definition at line 81 of file commandline.h.
Referenced by CommandLine(), startBlinking(), and stopBlinking().