wxChartDir  2.0.1
wxViewPortControl Class Reference

Class representing a ChartDirector viewport control. More...

#include <wxchartviewer.h>

Inheritance diagram for wxViewPortControl:

Public Member Functions

 wxViewPortControl (wxWindow *parent=0, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxPanelNameStr)
 Constructor for a ChartDirector viewport. More...
 
 ~wxViewPortControl ()
 Destructor for a ChartDirector viewport.
 
virtual void setChart (BaseChart *chart)
 Sets a BaseChart object for displaying in the control. More...
 
virtual BaseChart * getChart ()
 Gets the BaseChart object associated with the wxViewPortControl. More...
 
virtual void setViewer (wxChartViewer *viewer)
 Associates a wxChartViewer object with this wxViewPortControl object. More...
 
virtual wxChartViewergetViewer ()
 Gets the wxChartViewer object associated with this viewport control. More...
 
virtual void updateDisplay ()
 Requests the viewport control to update its contents. More...
 

Protected Member Functions

void OnPaint (wxPaintEvent &evt)
 Handles the OnPaint event. More...
 
void PaintNow (BaseChart *chart)
 Paints a chart immediately on screen. More...
 
void Render (wxDC &dc, BaseChart *chart)
 Renders the chart on the device context. More...
 
virtual void OnMouseMoveEvent (wxMouseEvent &evt)
 Handles mouse move events. More...
 
virtual void OnMousePressEvent (wxMouseEvent &evt)
 Handles left mouse button down events. More...
 
virtual void OnMouseReleaseEvent (wxMouseEvent &evt)
 Handles left mouse button up events. More...
 
virtual void OnMouseWheelEvent (wxMouseEvent &evt)
 Handles mouse wheel events. More...
 
virtual void OnMouseCaptureLost (wxMouseCaptureLostEvent &evt)
 Handles mouse capture lost events. More...
 

Detailed Description

Class representing a ChartDirector viewport control.

wxViewPortControl is a wxWidgets control that inherits from wxPanel and from ViewPortControlBase. It is used in wxWidgets applications for displaying charts images and to handle mouse interactions.

Constructor & Destructor Documentation

◆ wxViewPortControl()

wxViewPortControl::wxViewPortControl ( wxWindow *  parent = 0,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxPanelNameStr 
)

Constructor for a ChartDirector viewport.

Parameters
parentThe parent window.
idAn identifier for the panel. wxID_ANY is taken to mean a default.
posThe panel position. The value wxDefaultPosition indicates a default position, chosen by either the windowing system or wxWidgets, depending on platform.
sizeThe panel size. The value wxDefaultSize indicates a default size, chosen by either the windowing system or wxWidgets, depending on platform.
styleThe window style.
nameWindow name.

Member Function Documentation

◆ getChart()

BaseChart * wxViewPortControl::getChart ( )
virtual

Gets the BaseChart object associated with the wxViewPortControl.

Returns
The BaseChart pointer.

◆ getViewer()

wxChartViewer * wxViewPortControl::getViewer ( )
virtual

Gets the wxChartViewer object associated with this viewport control.

Returns
The wxChartViewer pointer associated with this wxViewPortControl.

◆ OnMouseCaptureLost()

void wxViewPortControl::OnMouseCaptureLost ( wxMouseCaptureLostEvent &  evt)
protectedvirtual

Handles mouse capture lost events.

Parameters
evtMouse capture lost event

◆ OnMouseMoveEvent()

void wxViewPortControl::OnMouseMoveEvent ( wxMouseEvent &  evt)
protectedvirtual

Handles mouse move events.

Parameters
evtMouse event

◆ OnMousePressEvent()

void wxViewPortControl::OnMousePressEvent ( wxMouseEvent &  evt)
protectedvirtual

Handles left mouse button down events.

Parameters
evtMouse event

◆ OnMouseReleaseEvent()

void wxViewPortControl::OnMouseReleaseEvent ( wxMouseEvent &  evt)
protectedvirtual

Handles left mouse button up events.

Parameters
evtMouse event

◆ OnMouseWheelEvent()

void wxViewPortControl::OnMouseWheelEvent ( wxMouseEvent &  evt)
protectedvirtual

Handles mouse wheel events.

Parameters
evtMouse wheel event

◆ OnPaint()

void wxViewPortControl::OnPaint ( wxPaintEvent &  evt)
protected

Handles the OnPaint event.

Parameters
evtPaint event

◆ PaintNow()

void wxViewPortControl::PaintNow ( BaseChart *  chart)
protected

Paints a chart immediately on screen.

Parameters
chartchart object to be painted on screen

◆ Render()

void wxViewPortControl::Render ( wxDC &  dc,
BaseChart *  chart 
)
protected

Renders the chart on the device context.

Parameters
dcscreen device context
chartchart object to be rendered on screen

◆ setChart()

void wxViewPortControl::setChart ( BaseChart *  chart)
virtual

Sets a BaseChart object for displaying in the control.

The chart usually is an overall chart that includes the full data range.

Parameters
chartThe BaseChart object to be displayed.

◆ setViewer()

void wxViewPortControl::setViewer ( wxChartViewer viewer)
virtual

Associates a wxChartViewer object with this wxViewPortControl object.

Parameters
viewerThe wxChartViewer object to be associated with this wxViewPortControl object.

◆ updateDisplay()

void wxViewPortControl::updateDisplay ( )
virtual

Requests the viewport control to update its contents.

Normally, the wxViewPortControl display will automatically update if the viewport of the associated wxChartViewer object is changed. So calling updateDisplay is not necessary. However, if the display needs to be updated for other reasons, such as if the viewport border color has been modified, this method can be used to notify the wxViewPortControl that the modification has been completed so that it can update the display.