InputTextSurface Class Reference
[C++ Wrapper for SDL]

Implements a TextBox, to let user type text.

This is implemented on top of TextSurface, and isn't really nice to render custom text, ie a cursor. Moreover, some problems may exists when user mix special keys and text, especially when the framerate is low (because special keys are not treated in the order they were typed). More...

#include <InputTextSurface.hh>

Inheritance diagram for InputTextSurface:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 InputTextSurface (const std::string &font_name, int surf_width)
void acquireInput (const std::string &lock_id)
 Get exclusive usage of the keyboard, and begin to grab text.
bool isAcquireFinished () const
 User has finished to type text.
void resetAcquire ()
 Reset the IsAcquireFinished function.
virtual void update ()
 Method called each frame, to perfom user custom code.

Protected Member Functions

virtual void customTextRender (SDL_Surface *surf, int line)
 Called when a new text surface is generated.

Detailed Description

Implements a TextBox, to let user type text.

This is implemented on top of TextSurface, and isn't really nice to render custom text, ie a cursor. Moreover, some problems may exists when user mix special keys and text, especially when the framerate is low (because special keys are not treated in the order they were typed).


Member Function Documentation

void InputTextSurface::update (  )  [virtual]

Method called each frame, to perfom user custom code.

You should override it.

Since a parent is assigned to the surface (and this parent is itself attached by other means to the root screen), this method is called at each frame. It is not called if this surface or one of its parent is disabled. In this method you can do what you want with your object, like processing input, updating other programs attributes, changing surface property, ...

Note:
Don't forget to call update for the base class at the end of your function , otherwise strange things will happen.

Reimplemented from TextSurface.


The documentation for this class was generated from the following files:
Generated on Sat Jun 23 16:11:00 2007 for Stechec/TBT by  doxygen 1.4.7