Popup selection window to chose an action to perform. More...
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. |
Popup selection window to chose an action to perform.
Definition at line 1745 of file network_gui.cpp.
void NetworkClientListPopupWindow::AddAction | ( | StringID | name, | |
ClientList_Action_Proc * | proc | |||
) | [inline] |
Add an action to the list of actions to execute.
name | the name of the action | |
proc | the procedure to execute for the action |
Definition at line 1762 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.
r | Rectangle occupied by the widget. | |
widget | Number of the widget to draw. |
Reimplemented from Window.
Definition at line 1822 of file network_gui.cpp.
References actions, SmallVector< T, S >::Begin(), DrawString(), SmallVector< T, S >::End(), FONT_HEIGHT_NORMAL, GfxFillRect(), WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and WD_FRAMERECT_TOP.
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.
*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. |
Reimplemented from Window.
Definition at line 1804 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.
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 1809 of file network_gui.cpp.
References actions, SmallVector< T, S >::Begin(), SmallVector< T, S >::End(), GetStringBoundingBox(), SmallVector< T, S >::Length(), maxdim(), WD_FRAMERECT_BOTTOM, WD_FRAMERECT_LEFT, WD_FRAMERECT_RIGHT, and WD_FRAMERECT_TOP.