AIConfigWindow Struct Reference

Window to configure which AIs will start. More...

Inheritance diagram for AIConfigWindow:

Window ZeroedMemoryAllocator

Public Types

enum  AIConfigWindowWidgets {
  AIC_WIDGET_CLOSEBOX = 0, AIC_WIDGET_CAPTION, AIC_WIDGET_BACKGROUND, AIC_WIDGET_LIST,
  AIC_WIDGET_SCROLLBAR, AIC_WIDGET_CHANGE, AIC_WIDGET_CONFIGURE, AIC_WIDGET_CLOSE,
  AIC_WIDGET_RESIZE
}
 Enum referring to the widgets of the AI config window. More...

Public Member Functions

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 OnDoubleClick (Point pt, int widget)
 A double click with the left mouse button has been made on the window.
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 selected_slot
bool clicked_button
bool clicked_increase
int timeout

Detailed Description

Window to configure which AIs will start.

Definition at line 423 of file ai_gui.cpp.


Member Enumeration Documentation

Enum referring to the widgets of the AI config window.

Enumerator:
AIC_WIDGET_CLOSEBOX  Close window button.
AIC_WIDGET_CAPTION  Window caption.
AIC_WIDGET_BACKGROUND  Window background.
AIC_WIDGET_LIST  List with currently selected AIs.
AIC_WIDGET_SCROLLBAR  Scrollbar to scroll through the selected AIs.
AIC_WIDGET_CHANGE  Select another AI button.
AIC_WIDGET_CONFIGURE  Change AI settings button.
AIC_WIDGET_CLOSE  Close window button.
AIC_WIDGET_RESIZE  Resize button.

Definition at line 425 of file ai_gui.cpp.


Member Function Documentation

virtual void AIConfigWindow::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 488 of file ai_gui.cpp.

References _settings_newgame, AIC_WIDGET_BACKGROUND, AIC_WIDGET_CHANGE, AIC_WIDGET_CLOSE, AIC_WIDGET_CONFIGURE, AIC_WIDGET_LIST, GameSettings::difficulty, INVALID_COMPANY, IsInsideBS(), max(), MAX_COMPANIES, DifficultySettings::max_no_competitors, min(), Scrollbar::pos, Window::SetDirty(), Window::vscroll, Point::x, and Point::y.

Referenced by OnDoubleClick().

virtual void AIConfigWindow::OnDoubleClick ( Point  pt,
int  widget 
) [inline, virtual]

A double 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 529 of file ai_gui.cpp.

References AIC_WIDGET_LIST, INVALID_COMPANY, and OnClick().

virtual void AIConfigWindow::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 539 of file ai_gui.cpp.

References AIC_WIDGET_LIST, Scrollbar::cap, Widget::data, Window::vscroll, Window::widget, and Point::y.


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

Generated on Wed Jun 3 19:05:32 2009 for OpenTTD by  doxygen 1.5.6