Advanced Strategic Command
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GraphWidget Class Reference
Inheritance diagram for GraphWidget:
Inheritance graph
[legend]

Public Member Functions

 GraphWidget (PG_Widget *parent, const PG_Rect &rect)
 
void setRange (int x, int y)
 
int addCurve (int color)
 
int addBar (int pos, int color)
 
void addVerticalLine (int x, int color)
 
void clearVerticalLines ()
 
void eventBlit (SDL_Surface *surface, const PG_Rect &src, const PG_Rect &dst)
 

Protected Member Functions

virtual int getPoint (int curve, int x)
 
virtual int getBarHeight (int bar)
 
virtual void click (int x, int button)
 
bool eventMouseMotion (const SDL_MouseMotionEvent *motion)
 
bool eventMouseButtonDown (const SDL_MouseButtonEvent *button)
 
int mapColor (int col)
 

Protected Attributes

int xrange
 
int yrange
 

Detailed Description

Definition at line 1187 of file cargodialog.cpp.

Constructor & Destructor Documentation

GraphWidget::GraphWidget ( PG_Widget *  parent,
const PG_Rect &  rect 
)
inline

Definition at line 1232 of file cargodialog.cpp.

Member Function Documentation

int GraphWidget::addBar ( int  pos,
int  color 
)
inline

Definition at line 1243 of file cargodialog.cpp.

Referenced by MiningGraph::MiningGraph().

int GraphWidget::addCurve ( int  color)
inline

Definition at line 1238 of file cargodialog.cpp.

Referenced by ResearchGraph::ResearchGraph().

void GraphWidget::addVerticalLine ( int  x,
int  color 
)
inline

Definition at line 1249 of file cargodialog.cpp.

Referenced by ResearchGraph::addSecondaryLab(), and ResearchGraph::recalc().

void GraphWidget::clearVerticalLines ( )
inline

Definition at line 1253 of file cargodialog.cpp.

Referenced by ResearchGraph::recalc().

virtual void GraphWidget::click ( int  x,
int  button 
)
inlineprotectedvirtual

Reimplemented in ResearchGraph.

Definition at line 1202 of file cargodialog.cpp.

Referenced by eventMouseButtonDown(), and eventMouseMotion().

void GraphWidget::eventBlit ( SDL_Surface *  surface,
const PG_Rect &  src,
const PG_Rect &  dst 
)
inline

Definition at line 1257 of file cargodialog.cpp.

References getBarHeight(), getPoint(), mapColor(), Surface::Wrap(), xrange, and yrange.

bool GraphWidget::eventMouseButtonDown ( const SDL_MouseButtonEvent *  button)
inlineprotected

Definition at line 1215 of file cargodialog.cpp.

References click().

bool GraphWidget::eventMouseMotion ( const SDL_MouseMotionEvent *  motion)
inlineprotected

Definition at line 1204 of file cargodialog.cpp.

References click().

virtual int GraphWidget::getBarHeight ( int  bar)
inlineprotectedvirtual

Reimplemented in MiningGraph.

Definition at line 1199 of file cargodialog.cpp.

Referenced by eventBlit().

virtual int GraphWidget::getPoint ( int  curve,
int  x 
)
inlineprotectedvirtual

Reimplemented in ResearchGraph.

Definition at line 1196 of file cargodialog.cpp.

Referenced by eventBlit().

int GraphWidget::mapColor ( int  col)
inlineprotected

Definition at line 1226 of file cargodialog.cpp.

Referenced by eventBlit().

void GraphWidget::setRange ( int  x,
int  y 
)
inline

Definition at line 1233 of file cargodialog.cpp.

References max(), xrange, and yrange.

Referenced by MiningGraph::MiningGraph(), and ResearchGraph::ResearchGraph().

Member Data Documentation

int GraphWidget::xrange
protected

Definition at line 1194 of file cargodialog.cpp.

Referenced by eventBlit(), setRange(), and ResearchGraph::setResearch().

int GraphWidget::yrange
protected

Definition at line 1195 of file cargodialog.cpp.

Referenced by eventBlit(), and setRange().


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