Public Member Functions | Protected Member Functions | Protected Attributes

WatchCompany Class Reference

Inheritance diagram for WatchCompany:
Window ZeroedMemoryAllocator

Public Member Functions

 WatchCompany (const WindowDesc *desc, int window_number, CompanyID company_to_watch)
 Watch Company Class Constructor.
virtual void SetStringParameters (int widget) const
 Initialize string parameters for a widget.
virtual void DrawWidget (const Rect &r, int widget) const
 Draw the contents of a nested widget.
virtual void OnClick (Point pt, int widget, int click_count)
 A click with the left mouse button has been made on the window.
virtual void OnResize ()
 Called after the window got resized.
virtual void OnScroll (Point delta)
 Handle the request for (viewport) scrolling.
virtual void OnMouseWheel (int wheel)
 The mouse wheel has been turned.
virtual void OnInvalidateData (int data, bool gui_scope)
 Some data on this window has become invalid.
virtual void OnTick ()
 Used to decrement the activity counter.
void OnDoCommand (CompanyByte company, TileIndex tile)
 OnDoCommand function - Called by the DoCommand.

Protected Member Functions

void SetWatchWindowTitle ()
void ScrollToTile (TileIndex tile)

Protected Attributes

CompanyID watched_company
int company_activity [MAX_COMPANIES]
int company_count_client [MAX_COMPANIES]
char company_name [MAX_LENGTH_COMPANY_NAME_CHARS]

Detailed Description

Definition at line 30 of file watch_gui.h.


Constructor & Destructor Documentation

WatchCompany::WatchCompany ( const WindowDesc desc,
int  window_number,
CompanyID  company_to_watch = INVALID_COMPANY 
)

Member Function Documentation

void WatchCompany::DrawWidget ( const Rect r,
int  widget 
) const [virtual]

Draw the contents of a nested widget.

Parameters:
r Rectangle occupied by the widget.
widget Number of the widget to draw.
Note:
This method may not change any state, it may only use drawing functions.

Reimplemented from Window.

Definition at line 209 of file watch_gui.cpp.

References _networking, DrawCompanyIcon(), DrawSprite(), GetSpriteSize(), IsInsideMM(), Company::IsValidAiID(), Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::IsValidID(), and Window::IsWidgetDisabled().

void WatchCompany::OnDoCommand ( CompanyByte  company,
TileIndex  tile 
)

OnDoCommand function - Called by the DoCommand.

Parameters:
company The company ID who's client is building
tile The tile number where action took place

Definition at line 384 of file watch_gui.cpp.

References Window::SetDirty().

Referenced by DoCommandPInternal().

void WatchCompany::OnInvalidateData ( int  data,
bool  gui_scope 
) [virtual]
void WatchCompany::OnMouseWheel ( int  wheel  )  [virtual]

The mouse wheel has been turned.

Parameters:
wheel the amount of movement of the mouse wheel.

Reimplemented from Window.

Definition at line 270 of file watch_gui.cpp.

void WatchCompany::OnResize (  )  [virtual]

Called after the window got resized.

For nested windows with a viewport, call NWidgetViewport::UpdateViewportCoordinates.

Reimplemented from Window.

Definition at line 251 of file watch_gui.cpp.

References NWidgetViewport::UpdateViewportCoordinates(), and Window::viewport.

void WatchCompany::OnScroll ( Point  delta  )  [virtual]

Handle the request for (viewport) scrolling.

Parameters:
delta the amount the viewport must be scrolled.

Reimplemented from Window.

Definition at line 259 of file watch_gui.cpp.

References ViewportData::dest_scrollpos_x, ViewportData::dest_scrollpos_y, IsPtInWindowViewport(), ScaleByZoom(), ViewportData::scrollpos_x, ViewportData::scrollpos_y, Window::viewport, and ViewPort::zoom.

void WatchCompany::OnTick (  )  [virtual]

Used to decrement the activity counter.

Reimplemented from Window.

Definition at line 405 of file watch_gui.cpp.

References COMPANY_FIRST, and Window::SetDirty().

void WatchCompany::SetStringParameters ( int  widget  )  const [virtual]

Initialize string parameters for a widget.

Calls to this function are made during initialization to measure the size (that is as part of InitNested()), during drawing, and while re-initializing the window. Only for widgets that render text initializing is requested.

Parameters:
widget Widget number.

Reimplemented from Window.

Definition at line 193 of file watch_gui.cpp.

References SetDParamStr().


The documentation for this class was generated from the following files: