NWidgetContainer Class Reference
[Hierarchical widgets]

Baseclass for container widgets. More...

#include <widget_type.h>

Inheritance diagram for NWidgetContainer:

NWidgetBase ZeroedMemoryAllocator NWidgetPIPContainer NWidgetSmallmapDisplay NWidgetStacked NWidgetToolbarContainer NWidgetHorizontal NWidgetVertical NWidgetMainToolbarContainer NWidgetScenarioToolbarContainer NWidgetHorizontalLTR

Public Member Functions

 NWidgetContainer (WidgetType tp)
 Constructor container baseclass.
void Add (NWidgetBase *wid)
 Append widget wid to container.
void FillNestedArray (NWidgetBase **array, uint length)
bool IsEmpty ()
 Return whether the container is empty.
NWidgetBase * GetWidgetOfType (WidgetType tp)
 Retrieve a widget by its type.

Protected Attributes

NWidgetBase * head
 Pointer to first widget in container.
NWidgetBase * tail
 Pointer to last widget in container.

Detailed Description

Baseclass for container widgets.

Definition at line 299 of file widget_type.h.


Constructor & Destructor Documentation

NWidgetContainer::NWidgetContainer ( WidgetType  tp  ) 

Constructor container baseclass.

Parameters:
tp Type of the container.

Definition at line 877 of file widget.cpp.

References head, and tail.


Member Function Documentation

void NWidgetContainer::Add ( NWidgetBase *  wid  ) 

bool NWidgetContainer::IsEmpty (  )  [inline]

Return whether the container is empty.

Definition at line 308 of file widget_type.h.

Referenced by AddKey().

NWidgetBase * NWidgetContainer::GetWidgetOfType ( WidgetType  tp  )  [virtual]

Retrieve a widget by its type.

Parameters:
tp Widget type to search for.
Returns:
Returns the first widget of the specified type, or NULL if no widget can be found.

Reimplemented from NWidgetBase.

Definition at line 893 of file widget.cpp.

References NWidgetBase::GetWidgetOfType(), head, NWidgetBase::next, and NWidgetBase::type.

Referenced by NWidgetBackground::GetWidgetOfType(), and MakeWindowNWidgetTree().


The documentation for this class was generated from the following files:

Generated on Wed Jan 20 23:39:08 2010 for OpenTTD by  doxygen 1.5.6