OpenTTD Source: src/company_gui.h File Reference

OpenTTD Source 14.0-beta1

Functions
company_gui.h File Reference
`#include "company_type.h"`
`#include "group.h"`
`#include "gfx_type.h"`

Go to the source code of this file.

## Functions
TextColour | GetDrawStringCompanyColour (CompanyID company)
| Get the colour for DrawString-subroutines which matches the colour of the company. More...
void | DrawCompanyIcon (CompanyID c, int x, int y)
| Draw the icon of a company. More...
void | ShowCompanyLiveryWindow (CompanyID company, GroupID group)
void | ShowCompanyStations (CompanyID company)
| Opens window with list of company's stations. More...
void | ShowCompanyFinances (CompanyID company)
| Open the finances window of a company. More...
void | ShowCompany (CompanyID company)
| Show the window with the overview of the company. More...
void | InvalidateCompanyWindows (const Company *c)
| Refresh all windows owned by a company. More...
void | CloseCompanyWindows (CompanyID company)
| Close all windows of a company. More...
void | DirtyCompanyInfrastructureWindows (CompanyID company)
| Redraw all windows with company infrastructure counts. More...

## Detailed Description

GUI Functions related to companies.

Definition in file company_gui.h.

## Function Documentation

## ◆ CloseCompanyWindows()

void CloseCompanyWindows | ( | CompanyID | id | ) |

Close all windows of a company.

We identify windows of a company by looking at the caption colour. If it is equal to the company ID then we say the window belongs to the company and should be closed

Parameters

  id | company identifier

Definition at line 1169 of file window.cpp.

References CloseWindowById(), and WC_BUY_COMPANY.

Referenced by Company::~Company().

## ◆ DirtyCompanyInfrastructureWindows()

void DirtyCompanyInfrastructureWindows | ( | CompanyID | company | ) |

Redraw all windows with company infrastructure counts.

Parameters

  company | The company to redraw the windows of.

Definition at line 2651 of file company_gui.cpp.

References SetWindowDirty(), WC_COMPANY, and WC_COMPANY_INFRASTRUCTURE.

Referenced by Station::AfterStationTileSetChange(), CmdConvertRail(), RemoveLock(), and UpdateCompanyRoadInfrastructure().

## ◆ DrawCompanyIcon()

void DrawCompanyIcon | ( | CompanyID | c,
|  | int | x,
|  | int | y
| ) |  |

Draw the icon of a company.

Parameters

  c | Company that needs its icon drawn.
  x | Horizontal coordinate of the icon.
  y | Vertical coordinate of the icon.

Definition at line 158 of file company_cmd.cpp.

## ◆ GetDrawStringCompanyColour()

TextColour GetDrawStringCompanyColour | ( | CompanyID | company | ) |

Get the colour for DrawString-subroutines which matches the colour of the company.

Parameters

  company | Company to get the colour of.

Returns
  Colour of company.

Definition at line 146 of file company_cmd.cpp.

References _colour_gradient, and Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID().

## ◆ InvalidateCompanyWindows()

void InvalidateCompanyWindows | ( | const Company * | company | ) |

Refresh all windows owned by a company.

Parameters

  company | Company that changed, and needs its windows refreshed.

Definition at line 198 of file company_cmd.cpp.

References _local_company, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem< Tpool >::index, SetWindowDirty(), SetWindowWidgetDirty(), WC_FINANCES, WC_STATUS_BAR, and WID_S_RIGHT.

Referenced by SubtractMoneyFromAnyCompany().

## ◆ ShowCompany()

void ShowCompany | ( | CompanyID | company | ) |

Show the window with the overview of the company.

Parameters

  company | The company to show the window for.

Definition at line 2640 of file company_gui.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID().

Referenced by GoalListWindow::HandleClick().

## ◆ ShowCompanyFinances()

void ShowCompanyFinances | ( | CompanyID | company | ) |

Open the finances window of a company.

Parameters

  company | Company to show finances of.

Precondition
  is company a valid company.

Definition at line 544 of file company_gui.cpp.

References BringWindowToFrontById(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), and WC_FINANCES.

Referenced by MenuClickFinances().

## ◆ ShowCompanyStations()

void ShowCompanyStations | ( | CompanyID | company | ) |

Opens window with list of company's stations.

Parameters

  company | whose stations' list show

Definition at line 782 of file station_gui.cpp.

References Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID().

Referenced by MenuClickStations().