22 #include <wx/window.h>
23 #include <wx/dcclient.h>
40 const wxSize& size,
long style,
int pl_style ) :
41 wxWindow( parent,
id, pos, size, style | wxFULL_REPAINT_ON_RESIZE )
45 MemPlotDC =
new wxMemoryDC;
46 if ( size.GetWidth() < 0 || size.GetHeight() < 0 )
53 m_width = size.GetWidth();
54 m_height = size.GetHeight();
56 bitmapWidth = m_width;
57 bitmapHeight = m_height;
59 MemPlotDCBitmap =
new wxBitmap( bitmapWidth, bitmapHeight, -1 );
60 MemPlotDC->SelectObject( *MemPlotDCBitmap );
62 m_stream =
new wxPLplotstream( (wxDC *) MemPlotDC, m_width, m_height, pl_style );
65 m_backend = 1 << ( m_backend + 2 );
68 SetBackgroundStyle( wxBG_STYLE_CUSTOM );
103 GetClientSize( &width, &height );
161 if ( ( sfile = fopen( filename.mb_str(),
"wb+" ) ) == NULL )
173 plsdev( devname.mb_str() );
176 plspage( 0., 0., 800, 600, 0, 0 );
int m_width
Saved width of plot, to find out if size changed.
int bitmapWidth
Width of bitmap, only changed if plot gets bigger.
void RenewPlot(void)
Redo plot.
void RenewPlot()
Redo plot and update memory dc.
virtual void OnErase(wxEraseEvent &WXUNUSED(event))
Erase event.
wxPLplotstream is inherited from plstream, which is the C++ interface
~wxPLplotwindow(void)
Deconstructor.
void Update()
Update memory dc, but don't redo plot.
wxMemoryDC * MemPlotDC
Pointer to wxMemoryDC, used for double buffering.
virtual void OnPaint(wxPaintEvent &event)
Paint event.
wxBitmap * MemPlotDCBitmap
Pointer to bitmap, used for double buffering.
A plot widget which takes care of double buffering and other stuff, but does not. ...
void SetSize(int width, int height)
Set new size of plot area.
wxPLplotstream * m_stream
Pointer to the wxPLplotstream which belongs to this plot widget.
int m_height
Saved height of plot, to find out if size changed.
bool SavePlot(const wxString &driver, const wxString &filename)
Save plot using a different driver.
virtual void OnSize(wxSizeEvent &WXUNUSED(event))
Size event.
int bitmapHeight
Height of bitmap, only changed if plot gets bigger.