# GenerateLandscapeWindow Struct Reference

Inheritance diagram for GenerateLandscapeWindow:

## Public Member Functions

| GenerateLandscapeWindow (const WindowDesc *desc, WindowNumber number=0)
virtual void | SetStringParameters (int widget) const
| Initialize string parameters for a widget.
virtual void | UpdateWidgetSize (int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
| Update size and resize step of a widget in the window.
virtual void | DrawWidget (const Rect &r, int widget) const
| Draw the contents of a nested widget.
virtual void | OnPaint ()
| The window must be repainted.
virtual void | OnClick (Point pt, int widget, int click_count)
| A click with the left mouse button has been made on the window.
virtual void | OnTimeout ()
| Called when this window's timeout has been reached.
virtual void | OnMouseLoop ()
| Called for every mouse loop run, which is at least once per (game) tick.
virtual EventState | OnKeyPress (uint16 key, uint16 keycode)
| A key has been pressed.
virtual void | OnDropdownSelect (int widget, int index)
| A dropdown option associated to this window has been selected.
virtual void | OnQueryTextFinished (char *str)
| The query window opened from this window has closed.

## Data Fields

uint | widget_id
uint | x
uint | y
char | name [64]
GenenerateLandscapeWindowMode | mode

## Detailed Description

Definition at line 345 of file genworld_gui.cpp.

## Member Function Documentation

virtual void GenerateLandscapeWindow::DrawWidget | ( | const Rect & | r,
|  | int | widget |
| ) |  |  | const`[inline, virtual]`

Draw the contents of a nested widget.

Parameters:

  | r | Rectangle occupied by the widget.
  | widget | Number of the widget to draw.

Note:
  This method may not change any state, it may only use drawing functions.

Reimplemented from Window.

Definition at line 466 of file genworld_gui.cpp.

References NWidgetBase::current_x, DrawString(), GLAND_HEIGHTMAP_NAME_SPACER, GLAND_HEIGHTMAP_NAME_TEXT, min(), and NWidgetBase::pos_x.

virtual void GenerateLandscapeWindow::OnClick | ( | Point | pt,
|  | int | widget,
|  | int | click_count |
| ) |  |  | `[inline, virtual]`

A click with the left mouse button has been made on the window.

Parameters:

  | pt | the point inside the window that has been clicked.
  | widget | the clicked widget.
  | click_count | Number of fast consecutive clicks at same position

Reimplemented from Window.

Definition at line 522 of file genworld_gui.cpp.

References _left_button_clicked, _settings_newgame, Clamp(), CS_NUMERAL, GameSettings::difficulty, QueryStringBaseWindow::edit_str_size, Window::flags4, GameSettings::game_creation, GameCreationSettings::generation_seed, GLAND_ARCTIC, GLAND_BORDERS_RANDOM, GLAND_GENERATE_BUTTON, GLAND_HEIGHTMAP_ROTATION_PULLDOWN, GLAND_INDUSTRY_PULLDOWN, GLAND_LANDSCAPE_PULLDOWN, GLAND_MAPSIZE_X_PULLDOWN, GLAND_MAPSIZE_Y_PULLDOWN, GLAND_RANDOM_BUTTON, GLAND_SMOOTHNESS_PULLDOWN, GLAND_SNOW_LEVEL_DOWN, GLAND_SNOW_LEVEL_TEXT, GLAND_SNOW_LEVEL_UP, GLAND_START_DATE_DOWN, GLAND_START_DATE_TEXT, GLAND_START_DATE_UP, GLAND_TEMPERATE, GLAND_TERRAIN_PULLDOWN, GLAND_TOWN_PULLDOWN, GLAND_TOYLAND, GLAND_TREE_PULLDOWN, GLAND_TROPICAL, GLAND_VARIETY_PULLDOWN, GLAND_WATER_NE, GLAND_WATER_NW, GLAND_WATER_PULLDOWN, GLAND_WATER_SE, GLAND_WATER_SW, GLWM_HEIGHTMAP, Window::HandleButtonClick(), GameCreationSettings::heightmap_rotation, GameCreationSettings::land_generator, GameCreationSettings::landscape, GameCreationSettings::map_x, GameCreationSettings::map_y, MAX_SNOWLINE_HEIGHT, MAX_YEAR, MIN_SNOWLINE_HEIGHT, MIN_YEAR, DifficultySettings::number_industries, DifficultySettings::number_towns, QSF_ENABLE_DEFAULT, DifficultySettings::quantity_sea_lakes, Window::RaiseWidget(), Window::SetDirty(), SetDParam(), SetNewLandscapeType(), ShowDropDownList(), ShowDropDownMenu(), ShowQuery(), ShowQueryString(), GameCreationSettings::snow_line_height, GameCreationSettings::starting_year, DifficultySettings::terrain_type, GameCreationSettings::tgen_smoothness, ToggleBit(), GameCreationSettings::tree_placer, UpdateTextBufferSize(), GameCreationSettings::variety, GameCreationSettings::water_borders, WF_TIMEOUT_MASK, and WF_TIMEOUT_TRIGGER.

virtual void GenerateLandscapeWindow::OnDropdownSelect | ( | int | widget,
|  | int | index |
| ) |  |  | `[inline, virtual]`

A dropdown option associated to this window has been selected.

Parameters:

  | widget | the widget (button) that the dropdown is associated with.
  | index | the element in the dropdown that is selected.

Reimplemented from Window.

Definition at line 690 of file genworld_gui.cpp.

References _settings_newgame, CS_NUMERAL, GameCreationSettings::custom_town_number, CUSTOM_TOWN_NUMBER_DIFFICULTY, GameSettings::game_creation, GLAND_HEIGHTMAP_ROTATION_PULLDOWN, GLAND_INDUSTRY_PULLDOWN, GLAND_LANDSCAPE_PULLDOWN, GLAND_MAPSIZE_X_PULLDOWN, GLAND_MAPSIZE_Y_PULLDOWN, GLAND_SMOOTHNESS_PULLDOWN, GLAND_TERRAIN_PULLDOWN, GLAND_TOWN_PULLDOWN, GLAND_TREE_PULLDOWN, GLAND_VARIETY_PULLDOWN, GLAND_WATER_PULLDOWN, GameCreationSettings::heightmap_rotation, GameCreationSettings::land_generator, GameCreationSettings::map_x, GameCreationSettings::map_y, Window::SetDirty(), SetDParam(), ShowQueryString(), GameCreationSettings::tgen_smoothness, GameCreationSettings::tree_placer, and GameCreationSettings::variety.

virtual EventState GenerateLandscapeWindow::OnKeyPress | ( | uint16 | key,
|  | uint16 | keycode |
| ) |  |  | `[inline, virtual]`

A key has been pressed.

Parameters:

  | key | the Unicode value of the key.
  | keycode | the untranslated key code including shift state.

Returns:
  ES_HANDLED if the key press has been handled and no other window should receive the event.

Reimplemented from Window.

Definition at line 678 of file genworld_gui.cpp.

References _settings_newgame, GameSettings::game_creation, GameCreationSettings::generation_seed, GLAND_RANDOM_EDITBOX, and minu().

virtual void GenerateLandscapeWindow::OnPaint | ( |  | ) | `[inline, virtual]`

The window must be repainted.

Note:
  This method should not change any state, it should only use drawing functions.

Reimplemented from Window.

Definition at line 480 of file genworld_gui.cpp.

References _settings_newgame, GameSettings::construction, Window::DrawWidgets(), ConstructionSettings::freeform_edges, GameSettings::game_creation, GLAND_ARCTIC, GLAND_BORDERS_RANDOM, GLAND_INDUSTRY_PULLDOWN, GLAND_RANDOM_EDITBOX, GLAND_SMOOTHNESS_PULLDOWN, GLAND_SNOW_LEVEL_DOWN, GLAND_SNOW_LEVEL_TEXT, GLAND_SNOW_LEVEL_UP, GLAND_START_DATE_DOWN, GLAND_START_DATE_UP, GLAND_TEMPERATE, GLAND_TERRAIN_PULLDOWN, GLAND_TOWN_PULLDOWN, GLAND_TOYLAND, GLAND_TREE_PULLDOWN, GLAND_TROPICAL, GLAND_VARIETY_PULLDOWN, GLAND_WATER_NE, GLAND_WATER_NW, GLAND_WATER_PULLDOWN, GLAND_WATER_SE, GLAND_WATER_SW, GLWM_GENERATE, HasBit(), GameCreationSettings::land_generator, GameCreationSettings::landscape, MAX_SNOWLINE_HEIGHT, MAX_YEAR, MIN_SNOWLINE_HEIGHT, MIN_YEAR, Window::SetWidgetDisabledState(), Window::SetWidgetLoweredState(), Window::SetWidgetsDisabledState(), GameCreationSettings::snow_line_height, GameCreationSettings::starting_year, GameCreationSettings::water_borders, and WIDGET_LIST_END.

virtual void GenerateLandscapeWindow::OnQueryTextFinished | ( | char * | str | ) | `[inline, virtual]`

The query window opened from this window has closed.

Parameters:

  | str | the new value of the string, NULL if the window was cancelled or an empty string when the default button was pressed, i.e. StrEmpty(str).

Reimplemented from Window.

Definition at line 733 of file genworld_gui.cpp.

References _settings_newgame, Clamp(), CUSTOM_TOWN_MAX_NUMBER, GameCreationSettings::custom_town_number, DEF_SNOWLINE_HEIGHT, DEF_START_YEAR, GameSettings::game_creation, GLAND_SNOW_LEVEL_TEXT, GLAND_START_DATE_TEXT, GLAND_TOWN_PULLDOWN, MAX_SNOWLINE_HEIGHT, MAX_YEAR, MIN_SNOWLINE_HEIGHT, MIN_YEAR, Window::SetDirty(), Window::SetWidgetDirty(), GameCreationSettings::snow_line_height, GameCreationSettings::starting_year, and StrEmpty().

virtual void GenerateLandscapeWindow::SetStringParameters | ( | int | widget | ) | const`[inline, virtual]`

Initialize string parameters for a widget.

Calls to this function are made during initialization to measure the size (that is as part of InitNested()), during drawing, and while re-initializing the window. Only for widgets that render text initializing is requested.

Parameters:

  | widget | Widget number.

Reimplemented from Window.

Definition at line 369 of file genworld_gui.cpp.

References _settings_newgame, ConvertYMDToDate(), GameSettings::difficulty, GameSettings::game_creation, GLAND_BORDERS_RANDOM, GLAND_HEIGHTMAP_ROTATION_PULLDOWN, GLAND_HEIGHTMAP_SIZE_TEXT, GLAND_INDUSTRY_PULLDOWN, GLAND_LANDSCAPE_PULLDOWN, GLAND_MAPSIZE_X_PULLDOWN, GLAND_MAPSIZE_Y_PULLDOWN, GLAND_SMOOTHNESS_PULLDOWN, GLAND_SNOW_LEVEL_TEXT, GLAND_START_DATE_TEXT, GLAND_TERRAIN_PULLDOWN, GLAND_TOWN_PULLDOWN, GLAND_TREE_PULLDOWN, GLAND_VARIETY_PULLDOWN, GLAND_WATER_NE, GLAND_WATER_NW, GLAND_WATER_PULLDOWN, GLAND_WATER_SE, GLAND_WATER_SW, HasBit(), GameCreationSettings::heightmap_rotation, HM_CLOCKWISE, GameCreationSettings::land_generator, GameCreationSettings::map_x, GameCreationSettings::map_y, DifficultySettings::number_industries, DifficultySettings::number_towns, DifficultySettings::quantity_sea_lakes, SetDParam(), GameCreationSettings::snow_line_height, GameCreationSettings::starting_year, DifficultySettings::terrain_type, GameCreationSettings::tgen_smoothness, GameCreationSettings::tree_placer, GameCreationSettings::variety, and GameCreationSettings::water_borders.

virtual void GenerateLandscapeWindow::UpdateWidgetSize | ( | int | widget,
|  | Dimension * | size,
|  | const Dimension & | padding,
|  | Dimension * | fill,
|  | Dimension * | resize |
| ) |  |  | `[inline, virtual]`

Update size and resize step of a widget in the window.

After retrieval of the minimal size and the resize-steps of a widget, this function is called to allow further refinement, typically by computing the real maximal size of the content. Afterwards, size is taken to be the minimal size of the widget and resize is taken to contain the resize steps. For the convenience of the callee, padding contains the amount of padding between the content and the edge of the widget. This should be added to the returned size.

Parameters:

  | widget | Widget number.
  | size | Size of the widget.
  | padding | Recommended amount of space between the widget content and the widget edge.
  | fill | Fill step of the widget.
  | resize | Resize step of the widget.

Reimplemented from Window.

Definition at line 403 of file genworld_gui.cpp.

References ConvertYMDToDate(), FONT_HEIGHT_NORMAL, GetStringBoundingBox(), GLAND_BORDERS_RANDOM, GLAND_HEIGHTMAP_NAME_SPACER, GLAND_HEIGHTMAP_NAME_TEXT, GLAND_HEIGHTMAP_ROTATION_PULLDOWN, GLAND_HEIGHTMAP_SIZE_TEXT, GLAND_INDUSTRY_PULLDOWN, GLAND_LANDSCAPE_PULLDOWN, GLAND_MAPSIZE_X_PULLDOWN, GLAND_MAPSIZE_Y_PULLDOWN, GLAND_SMOOTHNESS_PULLDOWN, GLAND_SNOW_LEVEL_TEXT, GLAND_START_DATE_TEXT, GLAND_TERRAIN_PULLDOWN, GLAND_TOWN_PULLDOWN, GLAND_TREE_PULLDOWN, GLAND_VARIETY_PULLDOWN, GLAND_WATER_NE, GLAND_WATER_NW, GLAND_WATER_PULLDOWN, GLAND_WATER_SE, GLAND_WATER_SW, INVALID_STRING_ID, MAX_MAP_SIZE, MAX_TILE_HEIGHT, MAX_YEAR, maxdim(), SetDParam(), WD_DROPDOWNTEXT_BOTTOM, and WD_DROPDOWNTEXT_TOP.

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

- src/genworld_gui.cpp