GenerateLandscapeWindow Struct Reference

Inheritance diagram for GenerateLandscapeWindow:
QueryStringBaseWindow Window QueryString ZeroedMemoryAllocator

Public Member Functions

 GenerateLandscapeWindow (const WindowDesc *desc, WindowNumber number=0)
virtual void SetStringParameters (int widget) const
 Initialize string parameters for a widget.
virtual void OnInvalidateData (int data=0, bool gui_scope=true)
 Some data on this window has become invalid.
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 344 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 551 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 572 of file genworld_gui.cpp.

References _left_button_clicked, _settings_newgame, Clamp(), CS_NUMERAL, CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY, GameSettings::difficulty, QueryStringBaseWindow::edit_str_buf, 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, DifficultySettings::industry_density, Window::InvalidateData(), GameCreationSettings::land_generator, GameCreationSettings::map_x, GameCreationSettings::map_y, MAX_SNOWLINE_HEIGHT, MAX_YEAR, MIN_SNOWLINE_HEIGHT, MIN_YEAR, DifficultySettings::number_towns, QSF_ENABLE_DEFAULT, DifficultySettings::quantity_sea_lakes, SetBit(), 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]
virtual void GenerateLandscapeWindow::OnInvalidateData ( int  data = 0,
bool  gui_scope = true 
) [inline, virtual]
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 735 of file genworld_gui.cpp.

References _settings_newgame, QueryStringBaseWindow::edit_str_buf, ES_NOT_HANDLED, 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 566 of file genworld_gui.cpp.

References Window::DrawWidgets(), and GLAND_RANDOM_EDITBOX.

virtual void GenerateLandscapeWindow::OnQueryTextFinished ( char *  str  )  [inline, virtual]
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 374 of file genworld_gui.cpp.

References _settings_newgame, ConvertYMDToDate(), GameCreationSettings::custom_sea_level, CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY, GameCreationSettings::custom_town_number, CUSTOM_TOWN_NUMBER_DIFFICULTY, 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, DifficultySettings::industry_density, GameCreationSettings::land_generator, GameCreationSettings::map_x, GameCreationSettings::map_y, 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 478 of file genworld_gui.cpp.

References ConvertYMDToDate(), CUSTOM_SEA_LEVEL_MAX_PERCENTAGE, CUSTOM_TOWN_MAX_NUMBER, 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:

Generated on Thu Apr 14 00:49:05 2011 for OpenTTD by  doxygen 1.6.1