BaseGraphWindow Struct Reference

Inheritance diagram for BaseGraphWindow:

Window ZeroedMemoryAllocator CompanyValueGraphWindow DeliveredCargoGraphWindow IncomeGraphWindow OperatingProfitGraphWindow PaymentRatesGraphWindow PerformanceHistoryGraphWindow

Public Member Functions

virtual void OnPaint ()
 This window is currently being repainted.
virtual OverflowSafeInt64 GetGraphData (const Player *p, int j)
virtual void OnClick (Point pt, int widget)
 A click with the left mouse button has been made on the window.

Protected Types

 GRAPH_MAX_DATASETS = 32
 GRAPH_AXIS_LINE_COLOUR = 215
 GRAPH_X_POSITION_BEGINNING = 44
 Start the graph 44 pixels from gd_left.
 GRAPH_X_POSITION_SEPARATION = 22
 There are 22 pixels between each X value.
 GRAPH_NUM_LINES_Y = 9
 How many horizontal lines to draw.
enum  {
  GRAPH_MAX_DATASETS = 32, GRAPH_AXIS_LINE_COLOUR = 215, GRAPH_X_POSITION_BEGINNING = 44, GRAPH_X_POSITION_SEPARATION = 22,
  GRAPH_NUM_LINES_Y = 9
}

Protected Member Functions

void DrawGraph () const
 BaseGraphWindow (const WindowDesc *desc, WindowNumber window_number, int left, int top, int height, bool has_negative_values, StringID format_str_y_axis)

Protected Attributes

uint excluded_data
 bitmask of the datasets that shouldn't be displayed.
byte num_dataset
byte num_on_x_axis
bool has_negative_values
byte num_vert_lines
byte month
Year year
uint16 x_values_start
uint16 x_values_increment
int gd_left
int gd_top
 Where to start drawing the graph, in pixels.
uint gd_height
 The height of the graph in pixels.
StringID format_str_y_axis
byte colors [GRAPH_MAX_DATASETS]
OverflowSafeInt64 cost [GRAPH_MAX_DATASETS][24]
 last 2 years

Static Protected Attributes

static const TextColour graph_axis_label_colour = TC_BLACK
 colour of the graph axis label.

Detailed Description

Definition at line 113 of file graph_gui.cpp.


Member Enumeration Documentation

anonymous enum [protected]

Enumerator:
GRAPH_X_POSITION_BEGINNING  Start the graph 44 pixels from gd_left.
GRAPH_X_POSITION_SEPARATION  There are 22 pixels between each X value.
GRAPH_NUM_LINES_Y  How many horizontal lines to draw.

Definition at line 115 of file graph_gui.cpp.


Member Function Documentation

void BaseGraphWindow::DrawGraph (  )  const [inline, protected]

Definition at line 151 of file graph_gui.cpp.

References _colour_gradient, abs(), assert, gd_height, gd_left, gd_top, GfxFillRect(), GRAPH_NUM_LINES_Y, GRAPH_X_POSITION_BEGINNING, GRAPH_X_POSITION_SEPARATION, HasBit(), max, MAX_PLAYERS, num_dataset, num_on_x_axis, num_vert_lines, x, and y.

Referenced by PaymentRatesGraphWindow::OnPaint().

virtual void BaseGraphWindow::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.

Reimplemented in PerformanceHistoryGraphWindow, and PaymentRatesGraphWindow.

Definition at line 406 of file graph_gui.cpp.

References ShowGraphLegend().

Referenced by PerformanceHistoryGraphWindow::OnClick().


The documentation for this struct was generated from the following file:
Generated on Sat Sep 6 20:15:59 2008 for openttd by  doxygen 1.4.7