FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::CommandLine Class Reference

A Command line widget. More...

#include <commandline.h>

Inherits TextField.

+ Collaboration diagram for FIFE::CommandLine:

Public Types

typedef boost::function1< void, std::string > type_callback
 

Public Member Functions

 CommandLine ()
 Constructor. More...
 
 ~CommandLine ()
 Destructor. More...
 
void keyPressed (fcn::KeyEvent &keyEvent)
 
virtual void drawCaret (fcn::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...
 

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
 

Detailed Description

A Command line widget.

Definition at line 43 of file commandline.h.

Member Typedef Documentation

typedef boost::function1<void,std::string> FIFE::CommandLine::type_callback

Definition at line 45 of file commandline.h.

Constructor & Destructor Documentation

FIFE::CommandLine::CommandLine ( )
FIFE::CommandLine::~CommandLine ( )

Destructor.

Definition at line 52 of file commandline.cpp.

Member Function Documentation

void FIFE::CommandLine::drawCaret ( fcn::Graphics *  graphics,
int32_t  x 
)
virtual

Definition at line 138 of file commandline.cpp.

References m_caretVisible.

void FIFE::CommandLine::keyPressed ( fcn::KeyEvent &  keyEvent)

Definition at line 70 of file commandline.cpp.

References m_callback, m_cmdline, m_history, m_history_position, and stopBlinking().

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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

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().

+ Here is the caller graph for this function:

void FIFE::CommandLine::toggleCaretVisible ( )

Toggle the caret visibility.

Definition at line 55 of file commandline.cpp.

References m_caretVisible.

Referenced by CommandLine().

+ Here is the caller graph for this function:

Member Data Documentation

Timer FIFE::CommandLine::m_blinkTimer
private

Definition at line 79 of file commandline.h.

Referenced by CommandLine(), startBlinking(), and stopBlinking().

type_callback FIFE::CommandLine::m_callback
private

Definition at line 74 of file commandline.h.

Referenced by keyPressed(), and setCallback().

bool FIFE::CommandLine::m_caretVisible
private

Definition at line 78 of file commandline.h.

Referenced by drawCaret(), stopBlinking(), and toggleCaretVisible().

std::string FIFE::CommandLine::m_cmdline
private

Definition at line 77 of file commandline.h.

Referenced by keyPressed().

std::vector<std::string> FIFE::CommandLine::m_history
private

Definition at line 75 of file commandline.h.

Referenced by keyPressed().

size_t FIFE::CommandLine::m_history_position
private

Definition at line 76 of file commandline.h.

Referenced by keyPressed().

Timer FIFE::CommandLine::m_suppressBlinkTimer
private

Definition at line 80 of file commandline.h.

Referenced by CommandLine(), startBlinking(), and stopBlinking().


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