FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
gcn::UTF8TextField Class Reference

UTF-8 aware version of the TextField class. More...

#include <utf8textfield.h>

+ Inheritance diagram for gcn::UTF8TextField:
+ Collaboration diagram for gcn::UTF8TextField:

Public Member Functions

 UTF8TextField (const std::string &text="")
 UTF8TextField constructor. More...
 
virtual ~UTF8TextField ()
 Destructor. More...
 
virtual void keyPressed (KeyEvent &keyEvent)
 Key pressed handler. More...
 

Protected Attributes

UTF8StringEditormStringEditor
 UTF-8 string editor suppor. More...
 

Detailed Description

UTF-8 aware version of the TextField class.

Using UTF8StringEditor, it is able to correctly edit UTF-8 text line.

You will also need an UTF-8 aware font to be able to correctly display such text (so gcn::ImageFont can not be used).

Author
Przemyslaw Grzywacz

Definition at line 48 of file utf8textfield.h.

Constructor & Destructor Documentation

gcn::UTF8TextField::UTF8TextField ( const std::string &  text = "")

UTF8TextField constructor.

Parameters
textInitial text.

Definition at line 35 of file utf8textfield.cpp.

References mStringEditor.

gcn::UTF8TextField::~UTF8TextField ( )
virtual

Destructor.

Definition at line 41 of file utf8textfield.cpp.

References mStringEditor.

Member Function Documentation

void gcn::UTF8TextField::keyPressed ( KeyEvent &  keyEvent)
virtual

Key pressed handler.

Overides gcn::TextField to handle UTF-8 character codes.

Parameters
keyEventKeyboard event.

Definition at line 46 of file utf8textfield.cpp.

References gcn::UTF8StringEditor::eraseChar(), gcn::UTF8StringEditor::insertChar(), mStringEditor, gcn::UTF8StringEditor::nextChar(), and gcn::UTF8StringEditor::prevChar().

Referenced by FIFE::CommandLine::keyPressed().

+ Here is the caller graph for this function:

Member Data Documentation

UTF8StringEditor* gcn::UTF8TextField::mStringEditor
protected

UTF-8 string editor suppor.

It allows the UTF8TextField to easly traverse UTF-8 strings as well as inserting and deleting characters.

Definition at line 78 of file utf8textfield.h.

Referenced by keyPressed(), UTF8TextField(), and ~UTF8TextField().


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