Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

GraphWidget Class Reference

Inheritance diagram for GraphWidget:

Inheritance graph
[legend]
List of all members.

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)
 overridable eventhandler to blit the widget contents to the screen

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)
 Overridable Eventhandler for a SDL_MouseMotionEvent message.
bool eventMouseButtonDown (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.
int mapColor (int col)

Protected Attributes

int xrange
int yrange

Constructor & Destructor Documentation

GraphWidget::GraphWidget PG_Widget parent,
const PG_Rect rect
[inline]
 

Definition at line 1354 of file cargodialog.cpp.


Member Function Documentation

int GraphWidget::addBar int  pos,
int  color
[inline]
 

Definition at line 1367 of file cargodialog.cpp.

Referenced by MiningGraph::MiningGraph().

int GraphWidget::addCurve int  color  )  [inline]
 

Definition at line 1361 of file cargodialog.cpp.

Referenced by ResearchGraph::ResearchGraph().

void GraphWidget::addVerticalLine int  x,
int  color
[inline]
 

Definition at line 1374 of file cargodialog.cpp.

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

void GraphWidget::clearVerticalLines  )  [inline]
 

Definition at line 1379 of file cargodialog.cpp.

Referenced by ResearchGraph::recalc().

virtual void GraphWidget::click int  x,
int  button
[inline, protected, virtual]
 

Reimplemented in ResearchGraph.

Definition at line 1321 of file cargodialog.cpp.

Referenced by eventMouseButtonDown(), and eventMouseMotion().

void GraphWidget::eventBlit SDL_Surface *  surface,
const PG_Rect src,
const PG_Rect dst
[inline, virtual]
 

overridable eventhandler to blit the widget contents to the screen

Parameters:
surface pointer to SDL_Surface to be blitted
src source rectangle (client coordinates)
dst destination rectangle (screen coordinates) Override this eventhandler to perform custom blitting behaviour (without drawing onto the widget surface).

Reimplemented from PG_Widget.

Definition at line 1384 of file cargodialog.cpp.

References PG_Widget::ClientToScreen(), getBarHeight(), getPoint(), PG_Application::GetScreen(), PG_Rect::Height(), mapColor(), PG_Rect::Width(), Surface::Wrap(), PG_Point::x, xrange, PG_Point::y, and yrange.

bool GraphWidget::eventMouseButtonDown const SDL_MouseButtonEvent *  button  )  [inline, protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

Definition at line 1335 of file cargodialog.cpp.

References click(), PG_Widget::ScreenToClient(), and PG_Point::x.

bool GraphWidget::eventMouseMotion const SDL_MouseMotionEvent *  motion  )  [inline, protected, virtual]
 

Overridable Eventhandler for a SDL_MouseMotionEvent message.

This handler is called when mouse movement is detected. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
motion SDL_MouseMotionEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

Definition at line 1323 of file cargodialog.cpp.

References click(), PG_Widget::ScreenToClient(), and PG_Point::x.

virtual int GraphWidget::getBarHeight int  bar  )  [inline, protected, virtual]
 

Reimplemented in MiningGraph.

Definition at line 1320 of file cargodialog.cpp.

Referenced by eventBlit().

virtual int GraphWidget::getPoint int  curve,
int  x
[inline, protected, virtual]
 

Reimplemented in ResearchGraph.

Definition at line 1319 of file cargodialog.cpp.

Referenced by eventBlit().

int GraphWidget::mapColor int  col  )  [inline, protected]
 

Definition at line 1347 of file cargodialog.cpp.

References PG_Application::GetScreen(), PG_Widget::GetTransparency(), and PG_Color::MapRGBA().

Referenced by eventBlit().

void GraphWidget::setRange int  x,
int  y
[inline]
 

Definition at line 1355 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 1317 of file cargodialog.cpp.

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

int GraphWidget::yrange [protected]
 

Definition at line 1318 of file cargodialog.cpp.

Referenced by eventBlit(), and setRange().


The documentation for this class was generated from the following file:
Generated on Tue Jun 24 02:17:36 2008 for Advanced Strategic Command by  doxygen 1.4.2