diff options
author | alberth <alberth@openttd.org> | 2009-03-28 16:35:33 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2009-03-28 16:35:33 +0000 |
commit | 7284ae3f77ccf07a71d55d35fb3edfd3a41bf9c9 (patch) | |
tree | ffacbfa1dd57d99fa956218ce0240e8420967c39 | |
parent | 50a6e589eda43618a53a1ad29d17209863cd52aa (diff) | |
download | openttd-7284ae3f77ccf07a71d55d35fb3edfd3a41bf9c9.tar.xz |
(svn r15882) -Codechange: New widgets for generation progress window.
-rw-r--r-- | src/genworld_gui.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 4ac50677f..1fabe8dbe 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -895,6 +895,11 @@ void ShowCreateScenario() new CreateScenarioWindow(&_create_scenario_desc, GLWP_SCENARIO); } +enum GenerationProgressWindowWidgets { + GPWW_CAPTION, + GPWW_BACKGROUND, + GPWW_ABORT, +}; static const Widget _generate_progress_widgets[] = { { WWT_CAPTION, RESIZE_NONE, COLOUR_GREY, 0, 180, 0, 13, STR_GENERATION_WORLD, STR_018C_WINDOW_TITLE_DRAG_THIS}, // GPWW_CAPTION @@ -903,11 +908,23 @@ static const Widget _generate_progress_widgets[] = { { WIDGETS_END}, }; +static const NWidgetPart _nested_generate_progress_widgets[] = { + NWidget(WWT_CAPTION, COLOUR_GREY, GPWW_CAPTION), SetDataTip(STR_GENERATION_WORLD, STR_018C_WINDOW_TITLE_DRAG_THIS), + NWidget(WWT_PANEL, COLOUR_GREY, GPWW_BACKGROUND), + NWidget(NWID_SPACER), SetMinimalSize(0, 60), + NWidget(NWID_HORIZONTAL), SetPIP(20, 0, 19), + NWidget(WWT_TEXTBTN, COLOUR_WHITE, GPWW_ABORT), SetMinimalSize(142, 12), SetDataTip(STR_GENERATION_ABORT, STR_NULL), + EndContainer(), + NWidget(NWID_SPACER), SetMinimalSize(0, 11), + EndContainer(), +}; + + static const WindowDesc _generate_progress_desc( WDP_CENTER, WDP_CENTER, 181, 97, 181, 97, WC_GENERATE_PROGRESS_WINDOW, WC_NONE, WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS, - _generate_progress_widgets + _generate_progress_widgets, _nested_generate_progress_widgets, lengthof(_nested_generate_progress_widgets) ); struct tp_info { @@ -930,14 +947,7 @@ static void AbortGeneratingWorldCallback(Window *w, bool confirmed) } struct GenerateProgressWindow : public Window { -private: - enum GenerationProgressWindowWidgets { - GPWW_CAPTION, - GPWW_BACKGROUND, - GPWW_ABORT, - }; -public: GenerateProgressWindow() : Window(&_generate_progress_desc) { this->FindWindowPlacementAndResize(&_generate_progress_desc); |