PLplot: wxPLplotwindow< WXWINDOW > Class Template Reference

PLplot 5.15.0

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
wxPLplotwindow< WXWINDOW > Class Template Reference

`#include "wxPLplotwindow.h"`

Inheritance diagram for wxPLplotwindow< WXWINDOW >:

## Public Member Functions
| wxPLplotwindow (bool useGraphicsContext=true, wxSize clientSize=wxDefaultSize, int resizeRenderDelay_ms=0)
| Constructor. More...
virtual | ~wxPLplotwindow (void)
| Destructor. More...
void | RenewPlot (void)
| Redo plot. More...
bool | SavePlot (const wxString &driver, const wxString &filename)
| Save plot using a different driver. More...
wxPLplotstream * | GetStream ()
| Get pointer to wxPLplotstream of this widget. More...
void | setUseGraphicsContext (bool useGraphicsContext)
void | setCanvasColour (const wxColour &colour)
bool | IsReady ()

## Protected Member Functions
virtual void | OnPaint (wxPaintEvent &event)
| Paint event. More...
virtual void | OnSize (wxSizeEvent &event)
| Size event. More...
virtual void | OnErase (wxEraseEvent &event)
| Background erase event. More...
virtual void | OnCreate (wxWindowCreateEvent &event)
| Window created event. More...
void | OnRenderTimer (wxTimerEvent &event)
| Timer used in delayed rendering after resize. More...
void | OnMouse (wxMouseEvent &event)
| Mouse events. More...

## Protected Attributes
wxPLplotstream | m_stream
| The wxPLplotstream which belongs to this plot widget. More...
bool | m_created
| Flag to indicate the window has been Created. More...

## Private Member Functions
virtual void | OnLocate (const PLGraphicsIn &graphicsIn)

## Private Attributes
bool | m_useGraphicsContext
| Flag to indicate whether we should use a wxGCDC. More...
wxBitmap | m_bitmap
wxMemoryDC * | m_memoryDc
wxSize | m_initialSize
wxColour | m_canvasColour
bool | m_resizing
bool | m_completedFirstRender
size_t | m_resizeRenderDelay
wxTimer | m_renderTimer

## Static Private Attributes
static const int | ID_RENDERTIMER = ::wxNewId()

## Detailed Description

### template<class WXWINDOW>
class wxPLplotwindow< WXWINDOW >

Definition at line 37 of file wxPLplotwindow.h.

## Constructor & Destructor Documentation

## ◆ wxPLplotwindow()

template<class WXWINDOW >

wxPLplotwindow< WXWINDOW >::wxPLplotwindow | ( | bool | useGraphicsContext = `true`,
|  | wxSize | clientSize = `wxDefaultSize`,
|  | int | resizeRenderDelay_ms = `0`
| ) |  |

Constructor.

Constructor initialises variables, creates the wxStream and connects methods with events. The WXWINDOW default constructor is used.

Definition at line 94 of file wxPLplotwindow.h.

## ◆ ~wxPLplotwindow()

template<class WXWINDOW >

wxPLplotwindow< WXWINDOW >::~wxPLplotwindow | ( | void |  | ) |
| virtual

Destructor.

Destructor - delete the dc and gcdc if needed.

Definition at line 127 of file wxPLplotwindow.h.

## Member Function Documentation

## ◆ GetStream()

template<class WXWINDOW >

wxPLplotstream* wxPLplotwindow< WXWINDOW >::GetStream | ( |  | ) |
| inline

Get pointer to wxPLplotstream of this widget.

Definition at line 46 of file wxPLplotwindow.h.

## ◆ IsReady()

template<class WXWINDOW >

bool wxPLplotwindow< WXWINDOW >::IsReady | ( |  | ) |
| inline

Definition at line 49 of file wxPLplotwindow.h.

## ◆ OnCreate()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::OnCreate | ( | wxWindowCreateEvent & | event | ) |
| protectedvirtual

Window created event.

This is called when the window is created, i.e., after WXWINDOW::Create has been called. We note that this has been called to avoid attempting to redraw a plot on a window that hasn't been created yet.

Definition at line 265 of file wxPLplotwindow.h.

## ◆ OnErase()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::OnErase | ( | wxEraseEvent & | event | ) |
| protectedvirtual

Background erase event.

This is called before each paint event

Definition at line 253 of file wxPLplotwindow.h.

## ◆ OnLocate()

template<class WXWINDOW >

virtual void wxPLplotwindow< WXWINDOW >::OnLocate | ( | const PLGraphicsIn & | graphicsIn | ) |
| inlineprivatevirtual

Definition at line 74 of file wxPLplotwindow.h.

## ◆ OnMouse()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::OnMouse | ( | wxMouseEvent & | event | ) |
| protected

Mouse events.

Definition at line 315 of file wxPLplotwindow.h.

## ◆ OnPaint()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::OnPaint | ( | wxPaintEvent & | event | ) |
| protectedvirtual

Paint event.

In the OnPaint Method we check if the Windows was resized (will be moved to OnSize() sometimes later), we also implement our own double buffering here (since the PLplot wxWidgets driver draws into a wxMemoryDC).

Definition at line 142 of file wxPLplotwindow.h.

## ◆ OnRenderTimer()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::OnRenderTimer | ( | wxTimerEvent & | event | ) |
| protected

Timer used in delayed rendering after resize.

Definition at line 304 of file wxPLplotwindow.h.

## ◆ OnSize()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::OnSize | ( | wxSizeEvent & | event | ) |
| protectedvirtual

Size event.

This is called when the plot is resized

Definition at line 211 of file wxPLplotwindow.h.

## ◆ RenewPlot()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::RenewPlot | ( | void |  | ) |

Redo plot.

Redo the whole plot, only if the window has been Created

Definition at line 389 of file wxPLplotwindow.h.

## ◆ SavePlot()

template<class WXWINDOW >

bool wxPLplotwindow< WXWINDOW >::SavePlot | ( | const wxString & | devname,
|  | const wxString & | filename
| ) |  |

Save plot using a different driver.

Save plot.

Definition at line 402 of file wxPLplotwindow.h.

## ◆ setCanvasColour()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::setCanvasColour | ( | const wxColour & | colour | ) |

Definition at line 454 of file wxPLplotwindow.h.

## ◆ setUseGraphicsContext()

template<class WXWINDOW >

void wxPLplotwindow< WXWINDOW >::setUseGraphicsContext | ( | bool | useGraphicsContext | ) |

Set whether we wish to use wxGCDC instead of a wxDC.

Definition at line 436 of file wxPLplotwindow.h.

## Member Data Documentation

## ◆ ID_RENDERTIMER

template<class WXWINDOW >

const int wxPLplotwindow< WXWINDOW >::ID_RENDERTIMER = ::wxNewId()
| staticprivate

Definition at line 82 of file wxPLplotwindow.h.

## ◆ m_bitmap

template<class WXWINDOW >

wxBitmap wxPLplotwindow< WXWINDOW >::m_bitmap
| private

Definition at line 63 of file wxPLplotwindow.h.

## ◆ m_canvasColour

template<class WXWINDOW >

wxColour wxPLplotwindow< WXWINDOW >::m_canvasColour
| private

Definition at line 73 of file wxPLplotwindow.h.

## ◆ m_completedFirstRender

template<class WXWINDOW >

bool wxPLplotwindow< WXWINDOW >::m_completedFirstRender
| private

Definition at line 79 of file wxPLplotwindow.h.

## ◆ m_created

template<class WXWINDOW >

bool wxPLplotwindow< WXWINDOW >::m_created
| protected

Flag to indicate the window has been Created.

Definition at line 59 of file wxPLplotwindow.h.

## ◆ m_initialSize

template<class WXWINDOW >

wxSize wxPLplotwindow< WXWINDOW >::m_initialSize
| private

Definition at line 69 of file wxPLplotwindow.h.

## ◆ m_memoryDc

template<class WXWINDOW >

wxMemoryDC* wxPLplotwindow< WXWINDOW >::m_memoryDc
| private

Definition at line 68 of file wxPLplotwindow.h.

## ◆ m_renderTimer

template<class WXWINDOW >

wxTimer wxPLplotwindow< WXWINDOW >::m_renderTimer
| private

Definition at line 81 of file wxPLplotwindow.h.

## ◆ m_resizeRenderDelay

template<class WXWINDOW >

size_t wxPLplotwindow< WXWINDOW >::m_resizeRenderDelay
| private

Definition at line 80 of file wxPLplotwindow.h.

## ◆ m_resizing

template<class WXWINDOW >

bool wxPLplotwindow< WXWINDOW >::m_resizing
| private

Definition at line 78 of file wxPLplotwindow.h.

## ◆ m_stream

template<class WXWINDOW >

wxPLplotstream wxPLplotwindow< WXWINDOW >::m_stream
| protected

The wxPLplotstream which belongs to this plot widget.

Definition at line 58 of file wxPLplotwindow.h.

## ◆ m_useGraphicsContext

template<class WXWINDOW >

bool wxPLplotwindow< WXWINDOW >::m_useGraphicsContext
| private

Flag to indicate whether we should use a wxGCDC.

Definition at line 62 of file wxPLplotwindow.h.

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

- wxPLplotwindow.h