OpenTTD Source: src/settings_gui.h Source File

OpenTTD Source 15.0-RC2

settings_gui.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef SETTING_GUI_H
11#define SETTING_GUI_H
12
13#include "gfx_type.h"
14#include "dropdown_type.h"
15
17#define SETTING_BUTTON_WIDTH ((int)NWidgetScrollbar::GetHorizontalDimension().width * 2)
19#define SETTING_BUTTON_HEIGHT ((int)NWidgetScrollbar::GetHorizontalDimension().height)
20
21void DrawArrowButtons(int x, int y, Colours button_colour, uint8_t state, bool clickable_left, bool clickable_right);
22void DrawUpDownButtons(int x, int y, Colours button_colour, uint8_t state, bool clickable_up, bool clickable_down);
23void DrawDropDownButton(int x, int y, Colours button_colour, bool state, bool clickable);
24void DrawBoolButton(int x, int y, Colours button_colour, Colours background, bool state, bool clickable);
25
26template <class T>
27 DropDownList BuildSetDropDownList(int *selected_index);
28
29/* Actually implemented in music_gui.cpp */
30void ChangeMusicSet(int index);
31
32#endif /* SETTING_GUI_H */
33
dropdown_type.h
Types related to the drop down widget.
DropDownList
std::vector< std::unique_ptr< const DropDownListItem > > DropDownList
A drop down list is a collection of drop down list items.
Definition dropdown_type.h:56
gfx_type.h
Types related to the graphics and/or input devices.
DrawArrowButtons
void DrawArrowButtons(int x, int y, Colours button_colour, uint8_t state, bool clickable_left, bool clickable_right)
Draw [<][>] boxes.
Definition settings_gui.cpp:1866
DrawBoolButton
void DrawBoolButton(int x, int y, Colours button_colour, Colours background, bool state, bool clickable)
Draw a toggle button.
Definition settings_gui.cpp:1947
DrawUpDownButtons
void DrawUpDownButtons(int x, int y, Colours button_colour, uint8_t state, bool clickable_up, bool clickable_down)
Draw [^][v] buttons.
Definition settings_gui.cpp:1898
ChangeMusicSet
void ChangeMusicSet(int index)
Change the configured music set and reset playback.
Definition music_gui.cpp:462
DrawDropDownButton
void DrawDropDownButton(int x, int y, Colours button_colour, bool state, bool clickable)
Draw a dropdown button.
Definition settings_gui.cpp:1924