Private Member Functions | Private Attributes

# NWidgetScenarioToolbarContainer Class Reference

Container for the scenario editor's toolbar. More...

Inheritance diagram for NWidgetScenarioToolbarContainer:

## Private Member Functions
void | SetupSmallestSize (Window *w, bool init_array)
| Compute smallest size needed by the widget.
const byte * | GetButtonArrangement (uint &width, uint &arrangable_count, uint &button_count, uint &spacer_count) const
| Get the arrangement of the buttons for the toolbar.
## Private Attributes
uint | panel_widths [2]
| The width of the two panels (the text panel and date panel).

## Detailed Description

Container for the scenario editor's toolbar.

Definition at line 1414 of file toolbar_gui.cpp.

## Member Function Documentation

const byte* NWidgetScenarioToolbarContainer::GetButtonArrangement | ( | uint & | width,
|  | uint & | arrangable_count,
|  | uint & | button_count,
|  | uint & | spacer_count |
| ) |  |  | const`[inline, private, virtual]`

Get the arrangement of the buttons for the toolbar.

Parameters:

  | width | the new width of the toolbar.
  | arrangable_count | output of the number of visible items.
  | button_count | output of the number of visible buttons.
  | spacer_count | output of the number of spacers.

Returns:
  the button configuration.

Implements NWidgetToolbarContainer.

Definition at line 1432 of file toolbar_gui.cpp.

References lengthof, panel_widths, NWidgetBase::smallest_x, and NWidgetToolbarContainer::spacers.

void NWidgetScenarioToolbarContainer::SetupSmallestSize | ( | Window * | w,
|  | bool | init_array |
| ) |  |  | `[inline, private, 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.

Parameters:

  | w | Window owning the widget.
  | init_array | Initialize the `w->nested_array`.

Note:
  After the computation, the results can be queried by accessing the smallest_x and smallest_y data members of the widget.

Reimplemented from NWidgetToolbarContainer.

Definition at line 1417 of file toolbar_gui.cpp.

References NWidgetContainer::head, lengthof, NWidgetBase::next, NWID_SPACER, and panel_widths.

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

- src/toolbar_gui.cpp