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

Gewi::GContainer Class Reference

#include <GewiContainer.h>

Inherits Gewi::GWidget.

Inherited by Gewi::GWindow.

List of all members.

Detailed Description

GContainer widget which is a standard GWidget that can serve as a parent, contain and manage other widgets.

Public Member Functions

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

virtual void Move (float x, float y)
 Move container and children.

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

virtual void Show ()
 Show children.

Protected Member Functions

void AddChild (GWidget *widget)
 Adds a child to the child list.

void ReleaseChild (GWidget *widget)
 Removes a child from the child list.

void InsertWidget (WidgetNode *node)
 Inserts a child to the child list.

Protected Attributes

WidgetList rChildList
 List of child widgets assigned to this container.


class Gewi::GWidget

Constructor & Destructor Documentation

Gewi::GContainer::GContainer GContainer *  parent = NULL  ) 

Constructor for GContainer, can take a parent (to be contained on a GContainer derived class, allowing nested containers).

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

Member Function Documentation

void Gewi::GContainer::AddChild GWidget widget  )  [protected]

Registers the widget as a child of this container, private because GWidget is a friend.

widget Widget to register as a child of this container.

void Gewi::GContainer::ReleaseChild GWidget widget  )  [protected]

Releases the widget which is a child of this container, private because GWidget is a friend.

widget Widget to release from this container.

void Gewi::GContainer::InsertWidget WidgetNode node  )  [protected]

Calls needed function of WidgetList class to put widget into the linked list.

node WidgetNode to insert into rChildList.

void Gewi::GContainer::Move float  x,
float  y

Same as GWidget::Move but overloaded to move children.

x New x position for container.
y New y position for container.

Reimplemented from Gewi::GWidget.

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

Recieves and processes a message, required overload for all widgets, overloaded to also account for children.

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.

Reimplemented in Gewi::GWindow.

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

Draws all children in appropriate back-to-front order.

Implements Gewi::GWidget.

Reimplemented in Gewi::GWindow.

Friends And Related Function Documentation

friend class Gewi::GWidget [friend]

The usage of friend here is used simply to allow GWidget proper access to what used to belong to it before the class split GWidget needs access to Add/ReleaseChild but to make them public would reduce encapsulation. (For those keeping score, this is to many people the only effective use of friend.)

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