OpenTTD Source: src/group_gui.h File Reference

OpenTTD Source 15.0-RC2

Data Structures | Typedefs | Functions
group_gui.h File Reference

Functions/definitions that have something to do with groups. More...

`#include "company_type.h"`
`#include "group_type.h"`
`#include "sortlist_type.h"`
`#include "vehicle_type.h"`

Go to the source code of this file.

## Data Structures
struct | GUIGroupListItem

## Typedefs
using | GUIGroupList = GUIList< GUIGroupListItem >

## Functions
void | ShowCompanyGroup (CompanyID company, VehicleType veh, GroupID group=GroupID::Invalid())
| Show the group window for the given company and vehicle type.
void | ShowCompanyGroupForVehicle (const Vehicle *v)
| Show the group window for the given vehicle.
void | DeleteGroupHighlightOfVehicle (const Vehicle *v)
| Removes the highlight of a vehicle in a group window.
void | BuildGuiGroupList (GUIGroupList &dst, bool fold, Owner owner, VehicleType veh_type)
| Build GUI group list, a sorted hierarchical list of groups for owner and vehicle type.

## Detailed Description

Functions/definitions that have something to do with groups.

Definition in file group_gui.h.

## Typedef Documentation

## ◆ GUIGroupList

using GUIGroupList = GUIList<GUIGroupListItem>

Definition at line 30 of file group_gui.h.

## Function Documentation

## ◆ BuildGuiGroupList()

void BuildGuiGroupList | ( | GUIGroupList & | list,
|  | bool | fold,
|  | Owner | owner,
|  | VehicleType | veh_type
| ) |  |

Build GUI group list, a sorted hierarchical list of groups for owner and vehicle type.

Parameters

  dst | Destination list, owned by the caller.
  fold | Whether to handle group folding/hiding.
  owner | Owner of groups.
  veh_type | Vehicle type of groups.

Definition at line 167 of file group_gui.cpp.

References AssignBit(), GuiGroupListAddChildren(), and Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_group_pool >::Iterate().

Referenced by VehicleGroupWindow::BuildGroupList().

## ◆ DeleteGroupHighlightOfVehicle()

void DeleteGroupHighlightOfVehicle | ( | const Vehicle * | v | ) |

Removes the highlight of a vehicle in a group window.

Parameters

  *v | Vehicle to remove all highlights from

Definition at line 1307 of file group_gui.cpp.

References _special_mouse_mode, FindVehicleGroupWindow(), Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem< Tpool >::index, Vehicle::owner, BaseVehicle::type, VehicleGroupWindow::UnselectVehicle(), and WSM_DRAGDROP.

Referenced by Vehicle::PreDestructor().

## ◆ ShowCompanyGroup()

void ShowCompanyGroup | ( | CompanyID | company,
|  | VehicleType | vehicle_type,
|  | GroupID | group
| ) |  |

Show the group window for the given company and vehicle type.

Parameters

  company | The company to show the window for.
  vehicle_type | The type of vehicle to show it for.
  group | The group to be selected. Defaults to GroupID::Invalid().

Definition at line 1240 of file group_gui.cpp.

## ◆ ShowCompanyGroupForVehicle()

void ShowCompanyGroupForVehicle | ( | const Vehicle * | v | ) |

Show the group window for the given vehicle.

Parameters

  v | The vehicle to show the window for.

Definition at line 1249 of file group_gui.cpp.

References Vehicle::group_id, Vehicle::owner, and BaseVehicle::type.

Referenced by NewsWindow::OnClick(), VehicleListWindow::OnClick(), and VehicleViewWindow::OnClick().