# network_content_gui.cpp File Reference

Implementation of the Network Content related GUIs. More...

`#include "../stdafx.h"`
`#include "../strings_func.h"`
`#include "../gfx_func.h"`
`#include "../window_func.h"`
`#include "../gui.h"`
`#include "../ai/ai.hpp"`
`#include "../base_media_base.h"`
`#include "../sortlist_type.h"`
`#include "../querystring_gui.h"`
`#include "../core/geometry_func.hpp"`
`#include "network_content.h"`
`#include "table/strings.h"`
`#include "../table/sprites.h"`

Go to the source code of this file.

## Data Structures

struct | NetworkContentDownloadStatusWindow
| Window for showing the download status of content. More...
class | NetworkContentListWindow
| Window that lists the content that's at the content server. More...

## Enumerations

enum | DownloadStatusWindowWidgets { NCDSWW_BACKGROUND, NCDSWW_CANCELOK }
| Widgets used by this window. More...
enum | NetworkContentListWindowWidgets { NCLWW_BACKGROUND, NCLWW_FILTER_CAPT, NCLWW_FILTER, NCLWW_CHECKBOX, NCLWW_TYPE, NCLWW_NAME, NCLWW_MATRIX, NCLWW_SCROLLBAR, NCLWW_DETAILS, NCLWW_SELECT_ALL, NCLWW_SELECT_UPDATE, NCLWW_UNSELECT, NCLWW_CANCEL, NCLWW_DOWNLOAD, NCLWW_SEL_ALL_UPDATE }
| Widgets of the content list window. More...

## Functions

void | ShowNetworkContentListWindow (ContentVector *cv, ContentType type)
| Show the content list window with a given set of content.

## Variables

static const NWidgetPart | _nested_network_content_download_status_window_widgets []
| Nested widgets for the download window.
static const WindowDesc | _network_content_download_status_window_desc (WDP_CENTER, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, _nested_network_content_download_status_window_widgets, lengthof(_nested_network_content_download_status_window_widgets))
| Window description for the download window.
static const NWidgetPart | _nested_network_content_list_widgets []
static const WindowDesc | _network_content_list_desc (WDP_CENTER, 630, 460, WC_NETWORK_WINDOW, WC_NONE, WDF_UNCLICK_BUTTONS, _nested_network_content_list_widgets, lengthof(_nested_network_content_list_widgets))
| Window description of the content list.

## Detailed Description

Implementation of the Network Content related GUIs.

Definition in file network_content_gui.cpp.

## Enumeration Type Documentation

enum DownloadStatusWindowWidgets

Widgets used by this window.

Enumerator:

  NCDSWW_BACKGROUND | Background.
  NCDSWW_CANCELOK | Cancel/OK button.

Definition at line 29 of file network_content_gui.cpp.

enum NetworkContentListWindowWidgets

Widgets of the content list window.

Enumerator:

  NCLWW_BACKGROUND | Resize button.
  NCLWW_FILTER_CAPT | Caption for the filter editbox.
  NCLWW_FILTER | Filter editbox.
  NCLWW_CHECKBOX | Button above checkboxes.
  NCLWW_TYPE | 'Type' button
  NCLWW_NAME | 'Name' button
  NCLWW_MATRIX | Panel with list of content.
  NCLWW_SCROLLBAR | Scrollbar of matrix.
  NCLWW_DETAILS | Panel with content details.
  NCLWW_SELECT_ALL | 'Select all' button
  NCLWW_SELECT_UPDATE | 'Select updates' button
  NCLWW_UNSELECT | 'Unselect all' button
  NCLWW_CANCEL | 'Cancel' button
  NCLWW_DOWNLOAD | 'Download' button
  NCLWW_SEL_ALL_UPDATE | NWID_SELECTION widget for select all/update buttons.

Definition at line 200 of file network_content_gui.cpp.

## Function Documentation

void ShowNetworkContentListWindow | ( | ContentVector * | cv,
|  | ContentType | type |
| ) |  |  |

Show the content list window with a given set of content.

Parameters:

  | cv | the content to show, or NULL when it has to search for itself
  | type | the type to (only) show

Definition at line 881 of file network_content_gui.cpp.

References _network_content_list_desc, SmallVector< T, S >::Begin(), ClientNetworkContentSocketHandler::Clear(), DeleteWindowById(), SmallVector< T, S >::End(), and ShowErrorMessage().

Referenced by NewGRFWindow::OnClick(), SaveLoadWindow::OnClick(), SelectGameWindow::OnClick(), and AIConfigWindow::OnClick().

## Variable Documentation

const NWidgetPart _nested_network_content_download_status_window_widgets[]`[static]`

Initial value:

     {
      NWidget(WWT_CAPTION, COLOUR_GREY), SetDataTip(STR_CONTENT_DOWNLOAD_TITLE, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS),
      NWidget(WWT_PANEL, COLOUR_GREY, NCDSWW_BACKGROUND),
        NWidget(NWID_SPACER), SetMinimalSize(350, 0), SetMinimalTextLines(3, WD_FRAMERECT_TOP + WD_FRAMERECT_BOTTOM + 30),
        NWidget(NWID_HORIZONTAL),
          NWidget(NWID_SPACER), SetMinimalSize(125, 0),
          NWidget(WWT_PUSHTXTBTN, COLOUR_WHITE, NCDSWW_CANCELOK), SetMinimalSize(101, 12), SetDataTip(STR_BUTTON_CANCEL, STR_NULL),
          NWidget(NWID_SPACER), SetFill(1, 0),
        EndContainer(),
        NWidget(NWID_SPACER), SetMinimalSize(0, 4),
      EndContainer(),
    }

Nested widgets for the download window.

Definition at line 35 of file network_content_gui.cpp.