AISettingsWindow Struct Reference

Window for settings the parameters of an AI. More...

Inheritance diagram for AISettingsWindow:

Window ZeroedMemoryAllocator

Public Types

enum  AISettingsWindowWidgest {
  AIS_WIDGET_CLOSEBOX = 0, AIS_WIDGET_CAPTION, AIS_WIDGET_BACKGROUND, AIS_WIDGET_SCROLLBAR,
  AIS_WIDGET_ACCEPT, AIS_WIDGET_RESET, AIS_WIDGET_RESIZE
}
 Enum referring to the widgets of the AI settings window. More...

Public Member Functions

 AISettingsWindow (const WindowDesc *desc, CompanyID slot)
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 OnQueryTextFinished (char *str)
 The query window opened from this window has closed.
virtual void OnResize (Point new_size, Point delta)
 Called when the window got resized.
virtual void OnTick ()
 Called once per (game) tick.

Data Fields

CompanyID slot
AIConfig * ai_config
int clicked_button
bool clicked_increase
int timeout
int clicked_row

Detailed Description

Window for settings the parameters of an AI.

Definition at line 219 of file ai_gui.cpp.


Member Enumeration Documentation

Enum referring to the widgets of the AI settings window.

Enumerator:
AIS_WIDGET_CLOSEBOX  Close window button.
AIS_WIDGET_CAPTION  Window caption.
AIS_WIDGET_BACKGROUND  Panel to draw the settings on.
AIS_WIDGET_SCROLLBAR  Scrollbar to scroll through all settings.
AIS_WIDGET_ACCEPT  Accept button.
AIS_WIDGET_RESET  Reset button.
AIS_WIDGET_RESIZE  Resize button.

Definition at line 221 of file ai_gui.cpp.


Member Function Documentation

virtual void AISettingsWindow::OnClick ( Point  pt,
int  widget 
) [inline, virtual]

A click with the left mouse button has been made on the window.

Parameters:
pt the point inside the window that has been clicked.
widget the clicked widget.

Reimplemented from Window.

Definition at line 283 of file ai_gui.cpp.

References _settings_newgame, AICONFIG_BOOLEAN, AIS_WIDGET_ACCEPT, AIS_WIDGET_BACKGROUND, AIS_WIDGET_RESET, CS_NUMERAL, DifficultySettings::diff_level, GameSettings::difficulty, INVALID_STRING_ID, IsInsideMM(), Scrollbar::pos, Window::SetDirty(), ShowQueryString(), Window::vscroll, Point::x, and Point::y.

virtual void AISettingsWindow::OnQueryTextFinished ( char *  str  )  [inline, virtual]

The query window opened from this window has closed.

Parameters:
str the new value of the string or NULL if the window was cancelled.

Reimplemented from Window.

Definition at line 343 of file ai_gui.cpp.

References Window::SetDirty(), and StrEmpty().

virtual void AISettingsWindow::OnResize ( Point  new_size,
Point  delta 
) [inline, virtual]

Called when the window got resized.

Parameters:
new_size the new size of the window.
delta the amount of which the window size changed.

Reimplemented from Window.

Definition at line 353 of file ai_gui.cpp.

References AIS_WIDGET_ACCEPT, AIS_WIDGET_BACKGROUND, AIS_WIDGET_RESET, Scrollbar::cap, Widget::data, ResizeButtons(), Window::vscroll, Window::widget, Point::x, and Point::y.


The documentation for this struct was generated from the following file:

Generated on Mon May 11 15:48:25 2009 for OpenTTD by  doxygen 1.5.6