Horizontal container. More...
#include <widget_type.h>
Public Member Functions | |
NWidgetHorizontal (NWidContainerFlags flags=NC_NONE) | |
Horizontal 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. |
Horizontal container.
Definition at line 418 of file widget_type.h.
NWidgetHorizontal::NWidgetHorizontal | ( | NWidContainerFlags | flags = NC_NONE |
) |
Horizontal container widget.
Definition at line 1060 of file widget.cpp.
void NWidgetHorizontal::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). |
Afterwards, pos_x and pos_y contain the top-left position of the widget, smallest_x and smallest_y contain the smallest size such that all widgets of the window are consistent, and current_x and current_y contain the current size.
Implements NWidgetBase.
Reimplemented in NWidgetHorizontalLTR.
Definition at line 1131 of file widget.cpp.
References NWidgetBase::AssignSizePosition(), ComputeMaxSize(), NWidgetBase::current_x, NWidgetBase::current_y, NWidgetContainer::head, max(), NWidgetBase::next, NWidgetBase::padding_left, NWidgetBase::padding_right, NWidgetBase::padding_top, NWidgetBase::prev, NWidgetBase::smallest_x, NWidgetBase::smallest_y, NWidgetBase::StoreSizePosition(), and NWidgetContainer::tail.
void NWidgetHorizontal::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 1064 of file widget.cpp.
References NWidgetBase::fill_x, NWidgetBase::fill_y, NWidgetPIPContainer::flags, NWidgetContainer::head, LeastCommonMultiple(), max(), NC_EQUALSIZE, NWidgetBase::next, NWidgetBase::padding_left, NWidgetPIPContainer::pip_inter, NWidgetPIPContainer::pip_post, NWidgetPIPContainer::pip_pre, NWidgetBase::resize_x, NWidgetBase::resize_y, NWidgetBase::smallest_x, NWidgetBase::smallest_y, and ST_SMALLEST.