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