Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

PG_LineEdit Class Reference

Inheritance diagram for PG_LineEdit:

Inheritance graph
[legend]
Collaboration diagram for PG_LineEdit:

Collaboration graph
[legend]
List of all members.

Detailed Description

An editable text box.

Author:
Alexander Pipelka

This really should be renamed to PG_TextBox or something similar, because PG_LineEdit 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.

Examples:

paratest.cpp.


Public Member Functions

 PG_LineEdit (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, const char *style="LineEdit", int maximumLength=1000000)
 ~PG_LineEdit ()
void LoadThemeStyle (const char *widgettype)
 Load a specific themestyle.

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

void EditBegin ()
 start edit

void EditEnd ()
void SetCursorPos (int p)
int GetCursorPos ()
virtual void SetText (const char *new_text)
 Set the current text string.

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

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

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

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

void SetEditable (bool edit)
 Set if the widget is editable by the user.

bool GetEditable ()
 Check if the widget is editable by the user.

void SetPassHidden (char passchar)
 Set password character (witch will be displayed in place of letter).

char GetPassHidden (void)
 Return setted passchar.

bool Action (KeyAction action)

Public Attributes

SignalEditBegin sigEditBegin
SignalEditEnd sigEditEnd
SignalEditReturn sigEditReturn

Protected Member Functions

virtual void InsertChar (const char *c)
virtual void DeleteChar (Uint16 pos)
void CopyText (bool del=false)
void PasteText (Uint16 pos)
void StartMark (Uint16 pos)
void EndMark (Uint16 pos)
virtual bool eventFilterKey (const SDL_KeyboardEvent *key)
virtual void eventEditBegin (int id, PG_Widget *widget, unsigned long data, void *clientdata)
virtual void eventEditEnd (int id, PG_Widget *widget, unsigned long data, void *clientdata)
void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst)
 overridable eventhandler to blit the widget contents to the screen

bool eventKeyDown (const SDL_KeyboardEvent *key)
 Overridable Eventhandler for a SDL_KeyboardEvent message.

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

void eventInputFocusLost (PG_MessageObject *newfocus)
void eventHide ()
 overridable eventhandler called whenever the widget gets hidden.


Protected Attributes

int my_cursorPosition


Constructor & Destructor Documentation

PG_LineEdit::PG_LineEdit PG_Widget parent,
const PG_Rect r = PG_Rect::null,
const char *  style = "LineEdit",
int  maximumLength = 1000000
 

PG_LineEdit::~PG_LineEdit  ) 
 


Member Function Documentation

bool PG_LineEdit::Action KeyAction  action  )  [virtual]
 

Reimplemented from PG_Widget.

void PG_LineEdit::CopyText bool  del = false  )  [protected]
 

virtual void PG_LineEdit::DeleteChar Uint16  pos  )  [protected, virtual]
 

Reimplemented in PG_MaskEdit.

void PG_LineEdit::EditBegin  ) 
 

start edit

void PG_LineEdit::EditEnd  ) 
 

void PG_LineEdit::EndMark Uint16  pos  )  [protected]
 

void PG_LineEdit::eventBlit SDL_Surface *  surface,
const PG_Rect src,
const PG_Rect dst
[protected, virtual]
 

overridable eventhandler to blit the widget contents to the screen

Parameters:
surface pointer to SDL_Surface to be blitted
src source rectangle (client coordinates)
dst destination rectangle (screen coordinates) Override this eventhandler to perform custom blitting behaviour (without drawing onto the widget surface).

Reimplemented from PG_ThemeWidget.

virtual void PG_LineEdit::eventEditBegin int  id,
PG_Widget widget,
unsigned long  data,
void *  clientdata
[protected, virtual]
 

virtual void PG_LineEdit::eventEditEnd int  id,
PG_Widget widget,
unsigned long  data,
void *  clientdata
[protected, virtual]
 

virtual bool PG_LineEdit::eventFilterKey const SDL_KeyboardEvent *  key  )  [protected, virtual]
 

void PG_LineEdit::eventHide  )  [protected, virtual]
 

overridable eventhandler called whenever the widget gets hidden.

Reimplemented from PG_Widget.

void PG_LineEdit::eventInputFocusLost PG_MessageObject newfocus  )  [protected, virtual]
 

Reimplemented from PG_MessageObject.

bool PG_LineEdit::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 PG_MessageObject.

bool PG_LineEdit::eventMouseButtonUp const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is released. 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 PG_MessageObject.

int PG_LineEdit::GetCursorPos  ) 
 

bool PG_LineEdit::GetEditable  ) 
 

Check if the widget is editable by the user.

Returns:
true - widget is editable / false - widget is read only

char PG_LineEdit::GetPassHidden void   ) 
 

Return setted passchar.

Returns:
Returns character, witch is displayed in place on letters

virtual void PG_LineEdit::InsertChar const char *  c  )  [protected, virtual]
 

Reimplemented in PG_MaskEdit.

bool PG_LineEdit::IsCursorVisible  ) 
 

void PG_LineEdit::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 PG_ThemeWidget.

void PG_LineEdit::LoadThemeStyle const char *  widgettype  ) 
 

Load a specific themestyle.

Parameters:
widgettype name of widget type to load

Reimplemented from PG_ThemeWidget.

void PG_LineEdit::PasteText Uint16  pos  )  [protected]
 

void PG_LineEdit::SendBackspace  ) 
 

Send a 'BKSPC' keystroke into the LineEdit widget.

void PG_LineEdit::SendChar char  c  ) 
 

Send a char into the LineEdit widget.

Parameters:
c the character to insert

void PG_LineEdit::SendDel  ) 
 

Send a 'del' keystroke into the LineEdit widget.

void PG_LineEdit::SetCursorPos int  p  ) 
 

void PG_LineEdit::SetEditable bool  edit  ) 
 

Set if the widget is editable by the user.

Parameters:
edit true - widget is editable / false - widget is read only

void PG_LineEdit::SetPassHidden char  passchar  ) 
 

Set password character (witch will be displayed in place of letter).

Parameters:
passchar character (if = 0 do not any replacement)

virtual void PG_LineEdit::SetText const char *  new_text  )  [virtual]
 

Set the current text string.

Parameters:
new_text pointer to text string

Reimplemented from PG_Widget.

Reimplemented in PG_MaskEdit.

void PG_LineEdit::SetValidKeys const char *  keys  ) 
 

Define a set of valid keys.

Parameters:
keys a string which contains all valid chars
Examples:
paratest.cpp.

void PG_LineEdit::StartMark Uint16  pos  )  [protected]
 


Member Data Documentation

int PG_LineEdit::my_cursorPosition [protected]
 

SignalEditBegin PG_LineEdit::sigEditBegin
 

SignalEditEnd PG_LineEdit::sigEditEnd
 

SignalEditReturn PG_LineEdit::sigEditReturn
 



The ParaGUI Project - Alexander Pipelka