Baseclass for container widgets. More...
#include <widget_type.h>
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. |
Baseclass for container widgets.
Definition at line 332 of file widget_type.h.
NWidgetContainer::NWidgetContainer | ( | WidgetType | tp | ) |
Constructor container baseclass.
tp | Type of the container. |
Definition at line 824 of file widget.cpp.
void NWidgetContainer::Add | ( | NWidgetBase * | wid | ) |
Append widget wid to container.
wid | Widget to append. |
Definition at line 854 of file widget.cpp.
References head, NWidgetBase::next, NWidgetBase::prev, and tail.
Referenced by NWidgetBackground::Add(), AddKey(), CargoWidgets(), MakeButtonsColumn(), MakeCargoButtons(), MakeCompanyButtonRows(), MakeCompanyButtons(), MakeDescriptionColumn(), MakeMainToolbar(), MakeNWidgetCompanyLines(), MakePerformanceDetailPanels(), MakeWidgetTree(), and MakeWindowNWidgetTree().
NWidgetBase * NWidgetContainer::GetWidgetOfType | ( | WidgetType | tp | ) | [virtual] |
Retrieve a widget by its type.
tp | Widget type to search for. |
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().