OpenMW
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes
MWGui::Console Class Reference

#include <console.hpp>

List of all members.

Public Types

typedef std::list< std::string > StringList

Public Member Functions

void setSelectedObject (const MWWorld::Ptr &object)
 Set the implicit object for script execution.
 Console (int w, int h, bool consoleOnlyScripts)
virtual void open ()
virtual void close ()
void setFont (const std::string &fntName)
void onResChange (int width, int height)
void clearHistory ()
void print (const std::string &msg)
void printOK (const std::string &msg)
 Output from successful console command.
void printError (const std::string &msg)
 Error message.
void execute (const std::string &command)
void executeFile (const std::string &path)

Public Attributes

MyGUI::EditBox * mCommandLine
MyGUI::EditBox * mHistory
StringList mCommandHistory
StringList::iterator mCurrent
std::string mEditString

Protected Member Functions

virtual void onReferenceUnavailable ()
 called when reference has become unavailable

Private Member Functions

bool compile (const std::string &cmd, Compiler::Output &output)
virtual void report (const std::string &message, const Compiler::TokenLoc &loc, Type type)
 Report error to the user.
virtual void report (const std::string &message, Type type)
 Report a file related error.
void listNames ()
void keyPress (MyGUI::Widget *_sender, MyGUI::KeyCode key, MyGUI::Char _char)
void acceptCommand (MyGUI::EditBox *_sender)
std::string complete (std::string input, std::vector< std::string > &matches)

Private Attributes

Compiler::Extensions mExtensions
MWScript::CompilerContext mCompilerContext
std::vector< std::string > mNames
bool mConsoleOnlyScripts

Member Typedef Documentation

typedef std::list<std::string> MWGui::Console::StringList

Constructor & Destructor Documentation

MWGui::Console::Console ( int  w,
int  h,
bool  consoleOnlyScripts 
)

Member Function Documentation

void MWGui::Console::acceptCommand ( MyGUI::EditBox *  _sender) [private]
void MWGui::Console::close ( ) [virtual]

Reimplemented from MWGui::WindowBase.

bool MWGui::Console::compile ( const std::string &  cmd,
Compiler::Output output 
) [private]
std::string MWGui::Console::complete ( std::string  input,
std::vector< std::string > &  matches 
) [private]
void MWGui::Console::execute ( const std::string &  command)
void MWGui::Console::executeFile ( const std::string &  path)
void MWGui::Console::keyPress ( MyGUI::Widget *  _sender,
MyGUI::KeyCode  key,
MyGUI::Char  _char 
) [private]
void MWGui::Console::listNames ( ) [private]

Write all valid identifiers and keywords into mNames and sort them.

Note:
If mNames is not empty, this function is a no-op.
The list may contain duplicates (if a name is a keyword and an identifier at the same time).
void MWGui::Console::onReferenceUnavailable ( ) [protected, virtual]

called when reference has become unavailable

Implements MWGui::ReferenceInterface.

void MWGui::Console::onResChange ( int  width,
int  height 
)
void MWGui::Console::open ( ) [virtual]

Reimplemented from MWGui::WindowBase.

void MWGui::Console::print ( const std::string &  msg)
void MWGui::Console::printError ( const std::string &  msg)

Error message.

void MWGui::Console::printOK ( const std::string &  msg)

Output from successful console command.

void MWGui::Console::report ( const std::string &  message,
const Compiler::TokenLoc loc,
Type  type 
) [private, virtual]

Report error to the user.

Implements Compiler::ErrorHandler.

void MWGui::Console::report ( const std::string &  message,
Type  type 
) [private, virtual]

Report a file related error.

Implements Compiler::ErrorHandler.

void MWGui::Console::setFont ( const std::string &  fntName)

Set the implicit object for script execution.


Member Data Documentation

StringList::iterator MWGui::Console::mCurrent
MyGUI::EditBox* MWGui::Console::mHistory
std::vector<std::string> MWGui::Console::mNames [private]

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