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 | 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 | OnEditboxChanged (int wid) |
The text in an editbox has been edited. | |
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 |
QueryString | seed_editbox |
Definition at line 306 of file genworld_gui.cpp.
virtual void GenerateLandscapeWindow::DrawWidget | ( | const Rect & | r, | |
int | widget | |||
) | const [inline, virtual] |
Draw the contents of a nested widget.
r | Rectangle occupied by the widget. | |
widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 514 of file genworld_gui.cpp.
References DrawString(), and WID_GL_HEIGHTMAP_NAME_TEXT.
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.
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 524 of file genworld_gui.cpp.
References _left_button_clicked, _settings_newgame, GameCreationSettings::amount_of_rivers, Clamp(), CS_NUMERAL, CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY, GameSettings::difficulty, Window::flags, GameSettings::game_creation, GameCreationSettings::generation_seed, GLWM_HEIGHTMAP, Window::HandleButtonClick(), GameCreationSettings::heightmap_rotation, HM_CLOCKWISE, 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, Textbuf::Print(), 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, Window::timeout_timer, ToggleBit(), GameCreationSettings::tree_placer, GameCreationSettings::variety, GameCreationSettings::water_borders, WF_TIMEOUT, WID_GL_ARCTIC, WID_GL_BORDERS_RANDOM, WID_GL_GENERATE_BUTTON, WID_GL_HEIGHTMAP_ROTATION_PULLDOWN, WID_GL_INDUSTRY_PULLDOWN, WID_GL_LANDSCAPE_PULLDOWN, WID_GL_MAPSIZE_X_PULLDOWN, WID_GL_MAPSIZE_Y_PULLDOWN, WID_GL_RANDOM_BUTTON, WID_GL_RIVER_PULLDOWN, WID_GL_SMOOTHNESS_PULLDOWN, WID_GL_SNOW_LEVEL_DOWN, WID_GL_SNOW_LEVEL_TEXT, WID_GL_SNOW_LEVEL_UP, WID_GL_START_DATE_DOWN, WID_GL_START_DATE_TEXT, WID_GL_START_DATE_UP, WID_GL_TEMPERATE, WID_GL_TERRAIN_PULLDOWN, WID_GL_TOWN_PULLDOWN, WID_GL_TOYLAND, WID_GL_TREE_PULLDOWN, WID_GL_TROPICAL, WID_GL_VARIETY_PULLDOWN, WID_GL_WATER_NE, WID_GL_WATER_NW, WID_GL_WATER_PULLDOWN, WID_GL_WATER_SE, and WID_GL_WATER_SW.
virtual void GenerateLandscapeWindow::OnDropdownSelect | ( | int | widget, | |
int | index | |||
) | [inline, virtual] |
A dropdown option associated to this window has been selected.
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 707 of file genworld_gui.cpp.
References _settings_newgame, GameCreationSettings::amount_of_rivers, CS_NUMERAL, GameCreationSettings::custom_sea_level, CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY, GameCreationSettings::custom_town_number, CUSTOM_TOWN_NUMBER_DIFFICULTY, GameSettings::game_creation, GameCreationSettings::heightmap_rotation, Window::InvalidateData(), GameCreationSettings::land_generator, GameCreationSettings::map_x, GameCreationSettings::map_y, SetDParam(), ShowQueryString(), GameCreationSettings::tgen_smoothness, GameCreationSettings::tree_placer, GameCreationSettings::variety, WID_GL_HEIGHTMAP_ROTATION_PULLDOWN, WID_GL_INDUSTRY_PULLDOWN, WID_GL_LANDSCAPE_PULLDOWN, WID_GL_MAPSIZE_X_PULLDOWN, WID_GL_MAPSIZE_Y_PULLDOWN, WID_GL_RIVER_PULLDOWN, WID_GL_SMOOTHNESS_PULLDOWN, WID_GL_TERRAIN_PULLDOWN, WID_GL_TOWN_PULLDOWN, WID_GL_TREE_PULLDOWN, WID_GL_VARIETY_PULLDOWN, and WID_GL_WATER_PULLDOWN.
virtual void GenerateLandscapeWindow::OnEditboxChanged | ( | int | widget | ) | [inline, virtual] |
The text in an editbox has been edited.
widget | The widget of the editbox. |
Reimplemented from Window.
Definition at line 696 of file genworld_gui.cpp.
References _settings_newgame, Textbuf::buf, GameSettings::game_creation, GameCreationSettings::generation_seed, minu(), and WID_GL_RANDOM_EDITBOX.
virtual void GenerateLandscapeWindow::OnInvalidateData | ( | int | data = 0 , |
|
bool | gui_scope = true | |||
) | [inline, virtual] |
Some data on this window has become invalid.
data | Information about the changed data. | |
gui_scope | Whether the call is done from GUI scope. You may not do everything when not in GUI scope. See InvalidateWindowData() for details. |
Reimplemented from Window.
Definition at line 396 of file genworld_gui.cpp.
References _settings_newgame, GameSettings::construction, CUSTOM_SEA_LEVEL_MIN_PERCENTAGE, CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY, GameSettings::difficulty, ConstructionSettings::freeform_edges, GameSettings::game_creation, GLWM_GENERATE, HasBit(), GameCreationSettings::land_generator, GameCreationSettings::landscape, MAX_SNOWLINE_HEIGHT, MAX_YEAR, MIN_SNOWLINE_HEIGHT, MIN_YEAR, DifficultySettings::quantity_sea_lakes, Window::SetWidgetDisabledState(), Window::SetWidgetLoweredState(), Window::SetWidgetsDisabledState(), GameCreationSettings::snow_line_height, GameCreationSettings::starting_year, GameCreationSettings::water_borders, WID_GL_ARCTIC, WID_GL_BORDERS_RANDOM, WID_GL_SMOOTHNESS_PULLDOWN, WID_GL_SNOW_LEVEL_DOWN, WID_GL_SNOW_LEVEL_TEXT, WID_GL_SNOW_LEVEL_UP, WID_GL_START_DATE_DOWN, WID_GL_START_DATE_UP, WID_GL_TEMPERATE, WID_GL_TERRAIN_PULLDOWN, WID_GL_TOYLAND, WID_GL_TROPICAL, WID_GL_VARIETY_PULLDOWN, WID_GL_WATER_NE, WID_GL_WATER_NW, WID_GL_WATER_PULLDOWN, WID_GL_WATER_SE, WID_GL_WATER_SW, and WIDGET_LIST_END.
virtual void GenerateLandscapeWindow::OnQueryTextFinished | ( | char * | str | ) | [inline, virtual] |
The query window opened from this window has closed.
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 756 of file genworld_gui.cpp.
References _settings_newgame, Clamp(), GameCreationSettings::custom_sea_level, CUSTOM_SEA_LEVEL_MAX_PERCENTAGE, CUSTOM_SEA_LEVEL_MIN_PERCENTAGE, CUSTOM_TOWN_MAX_NUMBER, GameCreationSettings::custom_town_number, DEF_SNOWLINE_HEIGHT, DEF_START_YEAR, GameSettings::game_creation, Window::InvalidateData(), MAX_SNOWLINE_HEIGHT, MAX_YEAR, MIN_SNOWLINE_HEIGHT, MIN_YEAR, Window::SetWidgetDirty(), GameCreationSettings::snow_line_height, GameCreationSettings::starting_year, StrEmpty(), WID_GL_SNOW_LEVEL_TEXT, WID_GL_START_DATE_TEXT, WID_GL_TOWN_PULLDOWN, and WID_GL_WATER_PULLDOWN.
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.
widget | Widget number. |
Reimplemented from Window.
Definition at line 336 of file genworld_gui.cpp.
References _settings_newgame, GameCreationSettings::amount_of_rivers, ConvertYMDToDate(), GameCreationSettings::custom_sea_level, CUSTOM_SEA_LEVEL_NUMBER_DIFFICULTY, GameCreationSettings::custom_town_number, CUSTOM_TOWN_NUMBER_DIFFICULTY, GameSettings::difficulty, GameSettings::game_creation, 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, GameCreationSettings::water_borders, WID_GL_BORDERS_RANDOM, WID_GL_HEIGHTMAP_ROTATION_PULLDOWN, WID_GL_HEIGHTMAP_SIZE_TEXT, WID_GL_INDUSTRY_PULLDOWN, WID_GL_LANDSCAPE_PULLDOWN, WID_GL_MAPSIZE_X_PULLDOWN, WID_GL_MAPSIZE_Y_PULLDOWN, WID_GL_RIVER_PULLDOWN, WID_GL_SMOOTHNESS_PULLDOWN, WID_GL_SNOW_LEVEL_TEXT, WID_GL_START_DATE_TEXT, WID_GL_TERRAIN_PULLDOWN, WID_GL_TOWN_PULLDOWN, WID_GL_TREE_PULLDOWN, WID_GL_VARIETY_PULLDOWN, WID_GL_WATER_NE, WID_GL_WATER_NW, WID_GL_WATER_PULLDOWN, WID_GL_WATER_SE, and WID_GL_WATER_SW.
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.
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 441 of file genworld_gui.cpp.
References ConvertYMDToDate(), CUSTOM_SEA_LEVEL_MAX_PERCENTAGE, CUSTOM_TOWN_MAX_NUMBER, FONT_HEIGHT_NORMAL, GetStringBoundingBox(), INVALID_STRING_ID, MAX_MAP_SIZE, MAX_TILE_HEIGHT, MAX_YEAR, maxdim(), SetDParam(), WD_DROPDOWNTEXT_TOP, WID_GL_BORDERS_RANDOM, WID_GL_HEIGHTMAP_NAME_TEXT, WID_GL_HEIGHTMAP_ROTATION_PULLDOWN, WID_GL_HEIGHTMAP_SIZE_TEXT, WID_GL_INDUSTRY_PULLDOWN, WID_GL_LANDSCAPE_PULLDOWN, WID_GL_MAPSIZE_X_PULLDOWN, WID_GL_MAPSIZE_Y_PULLDOWN, WID_GL_RIVER_PULLDOWN, WID_GL_SMOOTHNESS_PULLDOWN, WID_GL_SNOW_LEVEL_TEXT, WID_GL_START_DATE_TEXT, WID_GL_TERRAIN_PULLDOWN, WID_GL_TOWN_PULLDOWN, WID_GL_TREE_PULLDOWN, WID_GL_VARIETY_PULLDOWN, WID_GL_WATER_NE, WID_GL_WATER_NW, WID_GL_WATER_PULLDOWN, WID_GL_WATER_SE, and WID_GL_WATER_SW.