Functions | Variables

# settings_gui.h File Reference

Functions for setting GUIs. More...

`#include "gfx_type.h"`

Go to the source code of this file.

## Functions
void | DrawArrowButtons (int x, int y, Colours button_colour, byte state, bool clickable_left, bool clickable_right)
| Draw [<][>] boxes.
void | DrawDropDownButton (int x, int y, Colours button_colour, bool state, bool clickable)
| Draw a dropdown button.
void | DrawBoolButton (int x, int y, bool state, bool clickable)
| Draw a toggle button.
## Variables
static const int | SETTING_BUTTON_WIDTH = 20
| Width of setting buttons.
static const int | SETTING_BUTTON_HEIGHT = 10
| Height of setting buttons.

## Detailed Description

Functions for setting GUIs.

Definition in file settings_gui.h.

## Function Documentation

void DrawArrowButtons | ( | int | x,
|  | int | y,
|  | Colours | button_colour,
|  | byte | state,
|  | bool | clickable_left,
|  | bool | clickable_right |
| ) |  |  |

Draw [<][>] boxes.

Parameters:

  | x | the x position to draw
  | y | the y position to draw
  | button_colour | the colour of the button
  | state | 0 = none clicked, 1 = first clicked, 2 = second clicked
  | clickable_left | is the left button clickable?
  | clickable_right | is the right button clickable?

Definition at line 2294 of file settings_gui.cpp.

References _colour_gradient, _current_text_dir, DrawFrameRect(), DrawSprite(), FILLRECT_CHECKER, FR_LOWERED, GfxFillRect(), SETTING_BUTTON_HEIGHT, SETTING_BUTTON_WIDTH, WD_IMGBTN_LEFT, and WD_IMGBTN_TOP.

Referenced by IndustryViewWindow::DrawInfo(), SettingEntry::DrawSetting(), NewGRFParametersWindow::DrawWidget(), CheatWindow::DrawWidget(), and AISettingsWindow::DrawWidget().

void DrawBoolButton | ( | int | x,
|  | int | y,
|  | bool | state,
|  | bool | clickable |
| ) |  |  |

Draw a toggle button.

Parameters:

  | x | the x position to draw
  | y | the y position to draw
  | state | true = lowered
  | clickable | is the button clickable?

Definition at line 2342 of file settings_gui.cpp.

References DrawFrameRect(), FR_LOWERED, SETTING_BUTTON_HEIGHT, and SETTING_BUTTON_WIDTH.

Referenced by SettingEntry::DrawSetting(), NewGRFParametersWindow::DrawWidget(), CheatWindow::DrawWidget(), and AISettingsWindow::DrawWidget().

void DrawDropDownButton | ( | int | x,
|  | int | y,
|  | Colours | button_colour,
|  | bool | state,
|  | bool | clickable |
| ) |  |  |

Draw a dropdown button.

Parameters:

  | x | the x position to draw
  | y | the y position to draw
  | button_colour | the colour of the button
  | state | true = lowered
  | clickable | is the button clickable?

Definition at line 2321 of file settings_gui.cpp.

References _colour_gradient, DOWNARROW, DrawFrameRect(), DrawString(), FILLRECT_CHECKER, FR_LOWERED, GfxFillRect(), SA_HOR_CENTER, SETTING_BUTTON_HEIGHT, and SETTING_BUTTON_WIDTH.

Referenced by SettingEntry::DrawSetting(), NewGRFParametersWindow::DrawWidget(), and AISettingsWindow::DrawWidget().