Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

Gewi::GTextField Class Reference

#include <GewiTextField.h>

Inherits Gewi::GWidget.

List of all members.


Detailed Description

GTextField simple text input area widget, derived from GWidget.


Public Member Functions

 GTextField (GContainer *parent=NULL)
 Simple constructor for GTextField.

virtual void Create (float x, float y, float width, float height, ResourceID font, ResourceID backgroundImg, int maxChars=256, int leftPad=0)
 GButton's create function, must be called to set up actual button.

virtual void Message (SDL_Event *rawEvent, GewiEvent event, Uint16 mouseX, Uint16 mouseY, char ch)
 Overload of Message, used to recieve messages.

virtual void Show ()
 Draws the text input area & text to the screen.

void SetText (std::string text)
 Set text in input area.

std::string GetText ()
 Get current text of the input box.


Protected Attributes

std::string rText
 Text currently entered.

ZE::ZImage rBuffer
 Text buffer, used internally.

ResourceID rFont
 Font for text.

ResourceID rBackground
 Background for text input area.

int rMaxChars
 Maximum number of characters allowed to be entered.

int rLeftPadding
 Amount of padding on left hand side.


Constructor & Destructor Documentation

Gewi::GTextField::GTextField GContainer parent = NULL  ) 
 

Constructor for GTextField, can take a parent.

Parameters:
parent Pointer to GContainer derived class to be the parent. Default value is NULL which means no parent.


Member Function Documentation

void Gewi::GTextField::Create float  x,
float  y,
float  width,
float  height,
ResourceID  font,
ResourceID  backgroundImg,
int  maxChars = 256,
int  leftPad = 0
[virtual]
 

Every widget has a create function which must be called to define the button's appearance and settings.

Parameters:
x X position of widget within it's container (entire screen if no parent)
y Y position of widget within it's container (entire screen if no parent)
width Width of widget.
height Height of widget.
font Font for text.
backgroundImg Image for text input box.
maxChars Maximum number of characters to be entered, defaults to 256.
leftPad padding on left side, defaults to zero.

void Gewi::GTextField::Message SDL_Event *  rawEvent,
GewiEvent  event,
Uint16  mouseX,
Uint16  mouseY,
char  ch
[virtual]
 

Recieves and processes a message, required overload for all widgets.

Parameters:
rawEvent SDL_Event of original message, may be needed if more information is available on event. (May be NULL).
event GewiEvent enum, description of event recieved.
mouseX Mouse x position in event, if not mouse event may be incorrect.
mouseY Mouse y position in event, if not mouse event may be incorrect.
ch Character pressed in event, may be 0 if not a keypress event.

Implements Gewi::GWidget.

void Gewi::GTextField::Show  )  [virtual]
 

Draws widget to the screen, required overload for all widgets.

Implements Gewi::GWidget.

void Gewi::GTextField::SetText std::string  text  ) 
 

Sets the current text of the buffer for input area.

Parameters:
text New text for button.

std::string Gewi::GTextField::GetText  ) 
 

Return text in the input buffer.

Returns:
text currently in input buffer.


The documentation for this class was generated from the following files:
Generated on Fri Aug 1 17:17:30 2003 for Gewi by doxygen1.3