Public Member Functions | Protected Attributes

NWidgetContainer Class Reference
[Hierarchical widgets]

Baseclass for container widgets. More...

#include <widget_type.h>

Inheritance diagram for NWidgetContainer:
NWidgetBase ZeroedMemoryAllocator NWidgetNewGRFDisplay NWidgetPIPContainer NWidgetServerListHeader NWidgetSmallmapDisplay NWidgetStacked NWidgetToolbarContainer NWidgetHorizontal NWidgetMatrix 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.
NWidgetBaseGetWidgetOfType (WidgetType tp)
 Retrieve a widget by its type.

Protected Attributes

NWidgetBasehead
 Pointer to first widget in container.
NWidgetBasetail
 Pointer to last widget in container.

Detailed Description

Baseclass for container widgets.

Definition at line 332 of file widget_type.h.


Constructor & Destructor Documentation

NWidgetContainer::NWidgetContainer ( WidgetType  tp  ) 

Constructor container baseclass.

Parameters:
tp Type of the container.

Definition at line 824 of file widget.cpp.

References head, and tail.


Member Function Documentation

void NWidgetContainer::Add ( NWidgetBase wid  ) 
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 840 of file widget.cpp.

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

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

bool NWidgetContainer::IsEmpty (  )  [inline]

Return whether the container is empty.

Definition at line 341 of file widget_type.h.

References head.

Referenced by AddKey().


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