PLplot  5.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
wxPLplotwindow.h
Go to the documentation of this file.
1 // $Id: wxPLplotwindow.h 11760 2011-06-01 19:29:11Z airwin $
2 //
3 // Copyright (C) 2005 Werner Smekal
4 //
5 // This file is part of PLplot.
6 //
7 // PLplot is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU Library General Public License as published
9 // by the Free Software Foundation; either version 2 of the License, or
10 // (at your option) any later version.
11 //
12 // PLplot is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public License
18 // along with PLplot; if not, write to the Free Software
19 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 //
21 
22 #if !defined ( WXPLPLOTWINDOW_H__INCLUDED_ )
23 #define WXPLPLOTWINDOW_H__INCLUDED_
24 
25 #include <wx/window.h>
26 #include <wx/dcmemory.h>
27 
28 #include "wxPLplotstream.h"
29 
30 
32 // provide an own plot API. You have to get a pointer to wxPLplotstream via the
33 // GetStream() method to gain access to the PLplot API.
34 //
35 class PLDLLIMPEXP_WX wxPLplotwindow : public wxWindow
36 {
37 public:
38  wxPLplotwindow( wxWindow * parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
39  const wxSize& size = wxDefaultSize, long style = 0,
40  int pl_style = wxPLPLOT_NONE );
41  ~wxPLplotwindow( void );
42 
43  void RenewPlot( void );
44  bool SavePlot( const wxString& driver, const wxString& filename );
45  wxPLplotstream* GetStream() { return m_stream; }
46  int getBackend() { return m_backend; }
47 
48 protected:
49  virtual void OnPaint( wxPaintEvent& event );
50  virtual void OnErase( wxEraseEvent & WXUNUSED( event ) );
51  virtual void OnSize( wxSizeEvent & WXUNUSED( event ) );
52 
53 private:
54  // variables regarding double buffering
55  wxMemoryDC* MemPlotDC;
56  int m_width;
57  int m_height;
60  wxBitmap * MemPlotDCBitmap;
61  int m_backend;
62 
63 protected:
65 
66  DECLARE_EVENT_TABLE()
67 };
68 
69 
70 #endif // !defined( WXPLPLOTWINDOW_H__INCLUDED_ )
#define PLDLLIMPEXP_WX
Definition: pldll.h:98
int m_width
Saved width of plot, to find out if size changed.
int bitmapWidth
Width of bitmap, only changed if plot gets bigger.
wxPLplotstream is inherited from plstream, which is the C++ interface
wxMemoryDC * MemPlotDC
Pointer to wxMemoryDC, used for double buffering.
wxBitmap * MemPlotDCBitmap
Pointer to bitmap, used for double buffering.
A plot widget which takes care of double buffering and other stuff, but does not. ...
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.
wxPLplotstream * GetStream()
Get pointer to wxPLplotstream of this widget.
int bitmapHeight
Height of bitmap, only changed if plot gets bigger.