#include <widget_type.h>
Public Member Functions | |
NWidgetVertical (NWidContainerFlags flags=NC_NONE) | |
Vertical container widget. | |
void | SetupSmallestSize (Window *w, bool init_array) |
Compute smallest size needed by the widget. | |
void | AssignSizePosition (SizingType sizing, uint x, uint y, uint given_width, uint given_height, bool rtl) |
Assign size and position to the widget. |
Definition at line 399 of file widget_type.h.
NWidgetVertical::NWidgetVertical | ( | NWidContainerFlags | flags = NC_NONE |
) |
void NWidgetVertical::SetupSmallestSize | ( | Window * | w, | |
bool | init_array | |||
) | [virtual] |
Compute smallest size needed by the widget.
The smallest size of a widget is the smallest size that a widget needs to display itself properly. In addition, filling and resizing of the widget are computed. The function calls Window::UpdateWidgetSize for each leaf widget and background widget without child with a non-negative index.
w | Window owning the widget. | |
init_array | Initialize the w->nested_array . |
Implements NWidgetBase.
Definition at line 1263 of file widget.cpp.
References NWidgetBase::fill_x, NWidgetBase::fill_y, NWidgetPIPContainer::flags, NWidgetContainer::head, LeastCommonMultiple(), max(), NC_EQUALSIZE, NWidgetBase::next, NWidgetBase::padding_top, NWidgetPIPContainer::pip_inter, NWidgetPIPContainer::pip_post, NWidgetPIPContainer::pip_pre, NWidgetBase::resize_x, NWidgetBase::resize_y, NWidgetBase::smallest_x, NWidgetBase::smallest_y, and ST_SMALLEST.
void NWidgetVertical::AssignSizePosition | ( | SizingType | sizing, | |
uint | x, | |||
uint | y, | |||
uint | given_width, | |||
uint | given_height, | |||
bool | rtl | |||
) | [virtual] |
Assign size and position to the widget.
sizing | Type of resizing to perform. | |
x | Horizontal offset of the widget relative to the left edge of the window. | |
y | Vertical offset of the widget relative to the top edge of the window. | |
given_width | Width allocated to the widget. | |
given_height | Height allocated to the widget. | |
rtl | Adapt for right-to-left languages (position contents of horizontal containers backwards). |
Implements NWidgetBase.
Definition at line 1330 of file widget.cpp.
References ComputeMaxSize(), NWidgetContainer::head, max(), NWidgetBase::next, NWidgetBase::smallest_x, NWidgetBase::smallest_y, ST_SMALLEST, and NWidgetBase::StoreSizePosition().