Container with pre/inter/post child space. More...
#include <widget_type.h>
Public Member Functions | |
NWidgetPIPContainer (WidgetType tp, NWidContainerFlags flags=NC_NONE) | |
void | SetPIP (uint8 pip_pre, uint8 pip_inter, uint8 pip_post) |
Set additional pre/inter/post space for the container. | |
void | Draw (const Window *w) |
Draw the widgets of the tree. | |
NWidgetCore * | GetWidgetFromPos (int x, int y) |
Retrieve a widget by its position. | |
Protected Attributes | |
NWidContainerFlags | flags |
Flags of the container. | |
uint8 | pip_pre |
Amount of space before first widget. | |
uint8 | pip_inter |
Amount of space between widgets. | |
uint8 | pip_post |
Amount of space after last widget. |
Container with pre/inter/post child space.
Definition at line 434 of file widget_type.h.
void NWidgetPIPContainer::Draw | ( | const Window * | w | ) | [virtual] |
Draw the widgets of the tree.
The function calls Window::DrawWidget for each widget with a non-negative index, after the widget itself is painted.
w | Window that owns the tree. |
Implements NWidgetBase.
Reimplemented in NWidgetMatrix.
Definition at line 1079 of file widget.cpp.
References NWidgetContainer::head, and NWidgetBase::next.
Referenced by NWidgetBackground::Draw().
NWidgetCore * NWidgetPIPContainer::GetWidgetFromPos | ( | int | x, | |
int | y | |||
) | [virtual] |
Retrieve a widget by its position.
x | Horizontal position relative to the left edge of the window. | |
y | Vertical position relative to the top edge of the window. |
NULL
if no widget can be found. Implements NWidgetBase.
Reimplemented in NWidgetMatrix.
Definition at line 1086 of file widget.cpp.
References NWidgetBase::current_x, NWidgetBase::current_y, NWidgetCore::GetWidgetFromPos(), NWidgetContainer::head, IsInsideBS(), NWidgetBase::next, NWidgetBase::pos_x, and NWidgetBase::pos_y.
Referenced by NWidgetBackground::GetWidgetFromPos().
void NWidgetPIPContainer::SetPIP | ( | uint8 | pip_pre, | |
uint8 | pip_inter, | |||
uint8 | pip_post | |||
) |
Set additional pre/inter/post space for the container.
pip_pre | Additional space in front of the first child widget (above for the vertical container, at the left for the horizontal container). | |
pip_inter | Additional space between two child widgets. | |
pip_post | Additional space after the last child widget (below for the vertical container, at the right for the horizontal container). |
Definition at line 1072 of file widget.cpp.
Referenced by MakeNWidget(), and NWidgetBackground::SetPIP().