PLplot  5.10.0
 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:
64  wxPLplotstream* m_stream;
65 
66  DECLARE_EVENT_TABLE()
67 };
68 
69 
70 #endif // !defined( WXPLPLOTWINDOW_H__INCLUDED_ )