mpInfoLayer Class Reference

Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rectangular info box in transparent overlay over plot layers. It is used to implement objects like legends. More...

#include <mathplot.h>

Inheritance diagram for mpInfoLayer:
mpLayer mpInfoCoords mpInfoLegend

List of all members.

Public Member Functions

 mpInfoLayer ()
 mpInfoLayer (wxRect rect, const wxBrush *brush=wxTRANSPARENT_BRUSH)
virtual ~mpInfoLayer ()
virtual void UpdateInfo (mpWindow &w, wxEvent &event)
virtual bool HasBBox ()
virtual void Plot (wxDC &dc, mpWindow &w)
virtual bool IsInfo ()
virtual bool Inside (wxPoint &point)
virtual void Move (wxPoint delta)
virtual void UpdateReference ()
wxPoint GetPosition ()
wxSize GetSize ()
const wxRect & GetRectangle ()

Protected Attributes

wxRect m_dim
 The bounding rectangle of the box. It may be resized dynamically by the Plot method.
wxPoint m_reference
 Holds the reference point for movements.
wxBrush m_brush
 The brush to be used for the background.
int m_winX
int m_winY
 Holds the mpWindow size. Used to rescale position when window is resized.

Detailed Description

Base class to create small rectangular info boxes mpInfoLayer is the base class to create a small rectangular info box in transparent overlay over plot layers. It is used to implement objects like legends.


Constructor & Destructor Documentation

mpInfoLayer::mpInfoLayer (  ) 

Default constructor.

References mpLAYER_INFO.

mpInfoLayer::mpInfoLayer ( wxRect  rect,
const wxBrush *  brush = wxTRANSPARENT_BRUSH 
)

Complete constructor.

Parameters:
rect Sets the initial size rectangle of the layer.
brush pointer to a fill brush. Default is transparent

References m_brush, m_reference, mpLayer::m_type, m_winX, m_winY, and mpLAYER_INFO.

mpInfoLayer::~mpInfoLayer (  )  [virtual]

Destructor


Member Function Documentation

wxPoint mpInfoLayer::GetPosition (  ) 

Returns the position of the upper left corner of the box (in pixels)

Returns:
The rectangle position

References m_dim.

const wxRect& mpInfoLayer::GetRectangle (  )  [inline]

Returns the current rectangle coordinates.

Returns:
The info layer rectangle

Referenced by mpWindow::OnMouseMove().

wxSize mpInfoLayer::GetSize (  ) 

Returns the size of the box (in pixels)

Returns:
The rectangle size

References m_dim.

virtual bool mpInfoLayer::HasBBox (  )  [inline, virtual]

mpInfoLayer has not bounding box.

See also:
mpLayer::HasBBox
Returns:
always FALSE

Reimplemented from mpLayer.

bool mpInfoLayer::Inside ( wxPoint &  point  )  [virtual]

Checks whether a point is inside the info box rectangle.

Parameters:
point The point to be checked
Returns:
true if the point is inside the bounding box

References m_dim.

Referenced by mpWindow::IsInsideInfoLayer().

virtual bool mpInfoLayer::IsInfo (  )  [inline, virtual]

Specifies that this is an Info box layer.

Returns:
always TRUE
See also:
mpLayer::IsInfo

Reimplemented from mpLayer.

void mpInfoLayer::Move ( wxPoint  delta  )  [virtual]

Moves the layer rectangle of given pixel deltas.

Parameters:
delta The wxPoint container for delta coordinates along x and y. Units are in pixels.

References m_dim, and m_reference.

Referenced by mpWindow::OnMouseMove().

void mpInfoLayer::Plot ( wxDC &  dc,
mpWindow w 
) [virtual]

Plot method. Can be overidden by derived classes.

Parameters:
dc the device content where to plot
w the window to plot
See also:
mpLayer::Plot

Implements mpLayer.

Reimplemented in mpInfoCoords, and mpInfoLegend.

References mpWindow::GetScrX(), mpWindow::GetScrY(), m_brush, m_dim, mpLayer::m_pen, mpLayer::m_visible, m_winX, m_winY, and UpdateReference().

void mpInfoLayer::UpdateInfo ( mpWindow w,
wxEvent &  event 
) [virtual]

Updates the content of the info box. Should be overidden by derived classes. Update may behave in different ways according to the type of event which called it.

Parameters:
w parent mpWindow from which to obtain informations
event The event which called the update.

Reimplemented in mpInfoCoords, and mpInfoLegend.

Referenced by mpWindow::OnMouseMove().

void mpInfoLayer::UpdateReference (  )  [virtual]

Updates the rectangle reference point. Used by internal methods of mpWindow to correctly move mpInfoLayers.

References m_dim, and m_reference.

Referenced by mpWindow::OnMouseLeftRelease(), mpInfoLegend::Plot(), mpInfoCoords::Plot(), and Plot().


Member Data Documentation

wxBrush mpInfoLayer::m_brush [protected]

The brush to be used for the background.

Reimplemented from mpLayer.

Referenced by mpInfoLayer(), mpInfoLegend::Plot(), mpInfoCoords::Plot(), and Plot().

wxRect mpInfoLayer::m_dim [protected]

The bounding rectangle of the box. It may be resized dynamically by the Plot method.

Referenced by GetPosition(), GetSize(), Inside(), Move(), mpInfoLegend::Plot(), mpInfoCoords::Plot(), Plot(), and UpdateReference().

wxPoint mpInfoLayer::m_reference [protected]

Holds the reference point for movements.

Referenced by Move(), mpInfoLayer(), and UpdateReference().

int mpInfoLayer::m_winX [protected]
int mpInfoLayer::m_winY [protected]

Holds the mpWindow size. Used to rescale position when window is resized.

Referenced by mpInfoLayer(), mpInfoLegend::Plot(), mpInfoCoords::Plot(), and Plot().


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

© 2003 David Schalig, 2007-2008 Davide Rondini. Generated on Sun Dec 13 12:39:25 2009 for wxMathPlot with Doxygen. Hosted on SourceForge.net Logo