Data Structures | Public Member Functions | Data Fields

# NetworkClientListPopupWindow Struct Reference

Popup selection window to chose an action to perform. More...

Inheritance diagram for NetworkClientListPopupWindow:

## Data Structures
struct | ClientListAction
| Container for actions that can be executed. More...
## Public Member Functions
void | AddAction (StringID name, ClientList_Action_Proc *proc)
| Add an action to the list of actions to execute.
| NetworkClientListPopupWindow (const WindowDesc *desc, int x, int y, ClientID client_id)
virtual Point | OnInitialPosition (const WindowDesc *desc, int16 sm_width, int16 sm_height, int window_number)
| Compute the initial position of the window.
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 | OnMouseLoop ()
| Called for every mouse loop run, which is at least once per (game) tick.
## Data Fields
uint | sel_index
ClientID | client_id
Point | desired_location
SmallVector< ClientListAction, 2 > | actions
| Actions to execute.

## Detailed Description

Popup selection window to chose an action to perform.

Definition at line 1703 of file network_gui.cpp.

## Member Function Documentation

void NetworkClientListPopupWindow::AddAction | ( | StringID | name,
|  | ClientList_Action_Proc * | proc |
| ) |  |  | `[inline]`

Add an action to the list of actions to execute.

Parameters:

  | name | the name of the action
  | proc | the procedure to execute for the action

Definition at line 1720 of file network_gui.cpp.

References actions, SmallVector< T, S >::Append(), NetworkClientListPopupWindow::ClientListAction::name, and NetworkClientListPopupWindow::ClientListAction::proc.

virtual void NetworkClientListPopupWindow::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 1780 of file network_gui.cpp.

References actions, SmallVector< T, S >::Begin(), DrawString(), SmallVector< T, S >::End(), FONT_HEIGHT_NORMAL, GfxFillRect(), PC_BLACK, WD_FRAMERECT_LEFT, and WD_FRAMERECT_RIGHT.

virtual Point NetworkClientListPopupWindow::OnInitialPosition | ( | const WindowDesc * | desc,
|  | int16 | sm_width,
|  | int16 | sm_height,
|  | int | window_number |
| ) |  |  | `[inline, virtual]`

Compute the initial position of the window.

Parameters:

  | *desc | The pointer to the WindowDesc of the window to create.
  | sm_width | Smallest width of the window.
  | sm_height | Smallest height of the window.
  | window_number | The window number of the new window.

Returns:
  Initial position of the top-left corner of the window.

Reimplemented from Window.

Definition at line 1762 of file network_gui.cpp.

virtual void NetworkClientListPopupWindow::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 1767 of file network_gui.cpp.

References actions, SmallVector< T, S >::Begin(), SmallVector< T, S >::End(), GetStringBoundingBox(), SmallVector< T, S >::Length(), maxdim(), WD_FRAMERECT_LEFT, and WD_FRAMERECT_TOP.

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

- src/network/network_gui.cpp