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

Gewi::GStaticText Class Reference

#include <GewiStaticText.h>

Inherits Gewi::GWidget.

List of all members.

Detailed Description

GStaticText, stationary label class, derived from GWidget.

Public Member Functions

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

virtual void Create (float x, float y, float width, float height, ResourceID font, std::string text="", GewiJustify just=GJ_CENTER, ResourceID backgroundImg=GewiEngine::InvalidID)
 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 static label to the screen.

void SetText (std::string text)
 Set text of label.

std::string GetText ()
 Get current text in label.

Protected Attributes

ResourceID rBackgroundImage
 Image for background of label (often no image).

ResourceID rFont
 Font to use for label.

std::string rText
 Current text of label.

ZE::ZImage rTextBuf
 Text buffer ZImage, used internally.

int rXOff
 Calculated X Offset for text, calculated from justification.

int rYOff
 Calculated Y Offset for text, calculated from justification.

GewiJustify rJustify
 Justification, can be or'ed together enums from _GewiJustify, see documentation of that enum for details.

Constructor & Destructor Documentation

Gewi::GStaticText::GStaticText GContainer parent = NULL  ) 

Constructor for GStaticText, can take a parent.

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

Member Function Documentation

void Gewi::GStaticText::Create float  x,
float  y,
float  width,
float  height,
ResourceID  font,
std::string  text = "",
GewiJustify  just = GJ_CENTER,
ResourceID  backgroundImg = GewiEngine::InvalidID

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

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 ID for text.
text Text for static label. (Defaults to a blank space.)
just Justification, see documented _GewiJustify for details. Defaults to GJ_CENTER.
backgroundImg Image for background, defaults to GewiEngine::InvalidID.

void Gewi::GStaticText::Message SDL_Event *  rawEvent,
GewiEvent  event,
Uint16  mouseX,
Uint16  mouseY,
char  ch

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

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::GStaticText::Show  )  [virtual]

Draws static label to the screen, required overload for all widgets.

Implements Gewi::GWidget.

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

Sets the current text of the label.

text New text for label.

std::string Gewi::GStaticText::GetText  ) 

Return text in label.

text currently in label.

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