Public Member Functions | |
IndustryDirectoryWindow (const WindowDesc *desc, WindowNumber number) | |
virtual void | OnPaint () |
This window is currently being repainted. | |
virtual void | OnClick (Point pt, int widget) |
A click with the left mouse button has been made on the window. | |
virtual void | OnDropdownSelect (int widget, int index) |
A dropdown option associated to this window has been selected. | |
virtual void | OnResize (Point new_size, Point delta) |
Called when the window got resized. | |
virtual void | OnInvalidateData (int data) |
Some data on this window has become invalid. | |
Protected Member Functions | |
void | BuildIndustriesList () |
(Re)Build industries list | |
void | SortIndustriesList () |
Sort the industries list. | |
Static Protected Member Functions | |
static int | GetCargoTransportedPercentsIfValid (const Industry *i, uint id) |
Returns percents of cargo transported if industry produces this cargo, else -1. | |
static int | GetCargoTransportedSortValue (const Industry *i) |
Returns value representing industry's transported cargo percentage for industry sorting. | |
static int CDECL | IndustryNameSorter (const Industry *const *a, const Industry *const *b) |
Sort industries by name. | |
static int CDECL | IndustryTypeSorter (const Industry *const *a, const Industry *const *b) |
Sort industries by type and name. | |
static int CDECL | IndustryProductionSorter (const Industry *const *a, const Industry *const *b) |
Sort industries by production and name. | |
static int CDECL | IndustryTransportedCargoSorter (const Industry *const *a, const Industry *const *b) |
Sort industries by transported cargo and name. | |
Protected Attributes | |
GUIIndustryList | industries |
Static Protected Attributes | |
static Listing | last_sorting = {false, 0} |
static const Industry * | last_industry = NULL |
static const StringID | sorter_names [] |
static GUIIndustryList::SortFunction *const | sorter_funcs [] |
Definition at line 723 of file industry_gui.cpp.
static int IndustryDirectoryWindow::GetCargoTransportedPercentsIfValid | ( | const Industry * | i, | |
uint | id | |||
) | [inline, static, protected] |
Returns percents of cargo transported if industry produces this cargo, else -1.
i | industry to check | |
id | cargo slot |
Definition at line 760 of file industry_gui.cpp.
References Industry::last_month_pct_transported, lengthof, and Industry::produced_cargo.
Referenced by GetCargoTransportedSortValue().
static int IndustryDirectoryWindow::GetCargoTransportedSortValue | ( | const Industry * | i | ) | [inline, static, protected] |
Returns value representing industry's transported cargo percentage for industry sorting.
i | industry to check |
Definition at line 775 of file industry_gui.cpp.
References GetCargoTransportedPercentsIfValid(), and Swap().
Referenced by IndustryTransportedCargoSorter().
virtual void IndustryDirectoryWindow::OnClick | ( | Point | pt, | |
int | widget | |||
) | [inline, virtual] |
A click with the left mouse button has been made on the window.
pt | the point inside the window that has been clicked. | |
widget | the clicked widget. |
Reimplemented from Window.
Definition at line 912 of file industry_gui.cpp.
References _ctrl_pressed, Scrollbar::cap, IsInsideMM(), Scrollbar::pos, Window::SetDirty(), Window::vscroll, and Point::y.
virtual void IndustryDirectoryWindow::OnDropdownSelect | ( | int | widget, | |
int | index | |||
) | [inline, virtual] |
A dropdown option associated to this window has been selected.
widget | the widget (button) that the dropdown is associated with. | |
index | the element in the dropdown that is selected. |
Reimplemented from Window.
Definition at line 941 of file industry_gui.cpp.
References Window::SetDirty().
Called when the window got resized.
new_size | the new size of the window. | |
delta | the amount of which the window size changed. |
Reimplemented from Window.
Definition at line 950 of file industry_gui.cpp.
References Scrollbar::cap, Window::vscroll, and Point::y.
virtual void IndustryDirectoryWindow::OnInvalidateData | ( | int | data | ) | [inline, virtual] |
Some data on this window has become invalid.
data | information about the changed data. |
Reimplemented from Window.
Definition at line 955 of file industry_gui.cpp.
References Window::InvalidateWidget().
const StringID IndustryDirectoryWindow::sorter_names [static, protected] |
Initial value:
{ STR_SORT_BY_DROPDOWN_NAME, STR_SORT_BY_TYPE, STR_SORT_BY_PRODUCTION, STR_SORT_BY_TRANSPORTED, INVALID_STRING_ID }
Definition at line 730 of file industry_gui.cpp.
GUIIndustryList::SortFunction *const IndustryDirectoryWindow::sorter_funcs [static, protected] |
Initial value:
{ &IndustryNameSorter, &IndustryTypeSorter, &IndustryProductionSorter, &IndustryTransportedCargoSorter }
Definition at line 731 of file industry_gui.cpp.