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

Gewi::GTextButton Class Reference

#include <GewiTextButton.h>

Inherits Gewi::GButton.

List of all members.


Detailed Description

GTextButton text label button widget, derived from GButton.


Public Member Functions

 GTextButton (GContainer *parent=NULL)
 Simple constructor for GButton.

virtual void Create (float x, float y, float width, float height, ResourceID normalImg, ResourceID pressImg, ResourceID font, std::string text="", GButtonType type=GBT_PRESS)
 GButton's create function, must be called to set up actual button.

virtual void Show ()
 Draws static label to the screen.

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

std::string GetText ()
 Get current text of button label.


Protected Attributes

std::string rText
 Text label for button.

ZE::ZImage rTextBuf
 Text Buffer, used internally.

int rXOff
 X offset of text.

int rYOff
 Y offset of text.

ResourceID rFont
 Font ID for text label.


Constructor & Destructor Documentation

Gewi::GTextButton::GTextButton GContainer parent = NULL  ) 
 

Constructor for GButton, 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::GTextButton::Create float  x,
float  y,
float  width,
float  height,
ResourceID  normalImg,
ResourceID  pressImg,
ResourceID  font,
std::string  text = "",
GButtonType  type = GBT_PRESS
[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.
normalImg Image for button when not pressed.
pressImg Image for button when pressed (or hovered if type is GBT_HOVER).
font Font to draw label with.
text Text for button. (default is blank)
type GButtonType, either the default, GBT_PRESS (normal button), or GBT_HOVER (a button which responds to the hovering mouse).

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

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

Reimplemented from Gewi::GButton.

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

Sets the current text of the button.

Parameters:
text New text for button.

std::string Gewi::GTextButton::GetText  ) 
 

Return text on button label.

Returns:
text currently on button 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