Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

SDLLineEdit Class Reference

An editable text box. More...

#include <sdllineedit.h>

Inheritance diagram for SDLLineEdit

Inheritance graph
[legend]
Collaboration diagram for SDLLineEdit:

Collaboration graph
[legend]
List of all members.

Public Methods

 SDLLineEdit (SDLWidget* parent, SDL_Rect& r)
 ~SDLLineEdit ()
void LoadThemeStyle (const char* widgettype)
 Load a style from the theme definition. More...

void LoadThemeStyle (const char* widgettype, const char* objectname)
 Load a style from the theme definition. More...

void EditBegin ()
 start edit. More...

void EditEnd ()
void SetCursorPos (int p)
int GetCursorPos ()
char* GetText ()
void SetText (char* new_text)
void SetTextFormat (char* text, ...)
 Sets formated text (like printf). More...

bool IsCursorVisible ()
void SendChar (char c)
 Send a char into the LineEdit widget. More...

void SendDel ()
 Send a 'del' keystroke into the LineEdit widget. More...

void SendBackspace ()
 Send a 'BKSPC' keystroke into the LineEdit widget. More...

void SetValidKeys (char* keys)
 Define a set of valid keys. More...


Protected Methods

virtual void eventEditBegin (int id, SDLWidget* widget, unsigned long data, void *clientdata)
virtual void eventEditEnd (int id, SDLWidget* widget, unsigned long data, void *clientdata)
void eventDraw (SDL_Surface* surface, SDL_Rect* rect)
bool eventKeyDown (const SDL_KeyboardEvent* key)
 Overridable Eventhandler for a SDL_KeyboardEvent message. More...

bool eventMouseButtonDown (const SDL_MouseButtonEvent* button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message. More...

void eventInputFocusLost (SDLMessageObject* newfocus)
bool eventFilterKey (const SDL_KeyboardEvent* key)

Detailed Description

An editable text box.

Author(s):
Alexander Pipelka

This really should be renamed to SDLTextBox or something similar, because SDLLineEdit really makes no sense :). Also the 'Edit' part implies that it will always be modifiable, but having a modifyable attribute would probably be better than creating a whole new widget for an unmodifiable text box.

Definition at line 53 of file sdllineedit.h.


Constructor & Destructor Documentation

SDLLineEdit::SDLLineEdit ( SDLWidget * parent,
SDL_Rect & r )
 

SDLLineEdit::~SDLLineEdit ( )
 


Member Function Documentation

void SDLLineEdit::EditBegin ( )
 

start edit.

void SDLLineEdit::EditEnd ( )
 

int SDLLineEdit::GetCursorPos ( )
 

char * SDLLineEdit::GetText ( )
 

bool SDLLineEdit::IsCursorVisible ( )
 

void SDLLineEdit::LoadThemeStyle ( const char * widgettype,
const char * objectname ) [virtual]
 

Load a style from the theme definition.

Parameters:
widgettype   name of the widgettype
objectname   name of the object

Loads the defined style of a given widgettype and objectname.

Reimplemented from SDLGradientWidget.

void SDLLineEdit::LoadThemeStyle ( const char * widgettype ) [virtual]
 

Load a style from the theme definition.

Parameters:
widgettype   name of the widgettype
objectname   name of the object

Loads the defined style for a given widgettype

Reimplemented from SDLGradientWidget.

void SDLLineEdit::SendBackspace ( )
 

Send a 'BKSPC' keystroke into the LineEdit widget.

void SDLLineEdit::SendChar ( char c )
 

Send a char into the LineEdit widget.

Parameters:
c   the character to insert

void SDLLineEdit::SendDel ( )
 

Send a 'del' keystroke into the LineEdit widget.

void SDLLineEdit::SetCursorPos ( int p )
 

void SDLLineEdit::SetText ( char * new_text )
 

void SDLLineEdit::SetTextFormat ( char * text,
... )
 

Sets formated text (like printf).

void SDLLineEdit::SetValidKeys ( char * keys )
 

Define a set of valid keys.

Parameters:
keys   a string which contains all valid chars

void SDLLineEdit::eventDraw ( SDL_Surface * surface,
SDL_Rect * rect ) [protected, virtual]
 

Reimplemented from SDLGradientWidget.

void SDLLineEdit::eventEditBegin ( int id,
SDLWidget * widget,
unsigned long data,
void * clientdata ) [protected, virtual]
 

void SDLLineEdit::eventEditEnd ( int id,
SDLWidget * widget,
unsigned long data,
void * clientdata ) [protected, virtual]
 

bool SDLLineEdit::eventFilterKey ( const SDL_KeyboardEvent * key ) [protected]
 

void SDLLineEdit::eventInputFocusLost ( SDLMessageObject * newfocus ) [protected, virtual]
 

Reimplemented from SDLMessageObject.

bool SDLLineEdit::eventKeyDown ( const SDL_KeyboardEvent * key ) [protected, virtual]
 

Overridable Eventhandler for a SDL_KeyboardEvent message.

This handler is called when a key changed it's state from unpressed to pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
key   SDL_KeyboardEvent message

Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from SDLMessageObject.

bool SDLLineEdit::eventMouseButtonDown ( const SDL_MouseButtonEvent * button ) [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button   SDL_MouseButtonEvent message

Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from SDLWidgetDnD.


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