AIListWindow Struct Reference

Window that let you choose an available AI. More...

Inheritance diagram for AIListWindow:

Window ZeroedMemoryAllocator

Public Types

enum  AIListWindowWidgets {
  AIL_WIDGET_CLOSEBOX = 0, AIL_WIDGET_CAPTION, AIL_WIDGET_LIST, AIL_WIDGET_SCROLLBAR,
  AIL_WIDGET_INFO_BG, AIL_WIDGET_ACCEPT, AIL_WIDGET_CANCEL, AIL_WIDGET_CONTENT_DOWNLOAD,
  AIL_WIDGET_RESIZE
}
 Enum referring to the widgets of the AI list window. More...

Public Member Functions

 AIListWindow (const WindowDesc *desc, CompanyID slot)
virtual void OnPaint ()
 This window is currently being repainted.
void ChangeAI ()
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.

Data Fields

const AIInfoList * ai_info_list
int selected
CompanyID slot

Detailed Description

Window that let you choose an available AI.

Definition at line 31 of file ai_gui.cpp.


Member Enumeration Documentation

Enum referring to the widgets of the AI list window.

Enumerator:
AIL_WIDGET_CLOSEBOX  Close window button.
AIL_WIDGET_CAPTION  Window caption.
AIL_WIDGET_LIST  The matrix with all available AIs.
AIL_WIDGET_SCROLLBAR  Scrollbar next to the AI list.
AIL_WIDGET_INFO_BG  Panel to draw some AI information on.
AIL_WIDGET_ACCEPT  Accept button.
AIL_WIDGET_CANCEL  Cancel button.
AIL_WIDGET_CONTENT_DOWNLOAD  Download content button.
AIL_WIDGET_RESIZE  Resize button.

Definition at line 33 of file ai_gui.cpp.


Member Function Documentation

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

References AIL_WIDGET_ACCEPT, AIL_WIDGET_CANCEL, AIL_WIDGET_CONTENT_DOWNLOAD, AIL_WIDGET_LIST, INVALID_STRING_ID, Scrollbar::pos, Window::SetDirty(), Window::vscroll, and Point::y.

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

References AIL_WIDGET_LIST, Scrollbar::pos, Window::vscroll, and Point::y.

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

References AIL_WIDGET_ACCEPT, AIL_WIDGET_CANCEL, AIL_WIDGET_LIST, 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 Sun Mar 15 22:50:12 2009 for openttd by  doxygen 1.5.6