PLplot  5.10.0
wxPLplotwindow.h
Go to the documentation of this file.
00001 // Copyright (C) 2005  Werner Smekal
00002 //
00003 // This file is part of PLplot.
00004 //
00005 // PLplot is free software; you can redistribute it and/or modify
00006 // it under the terms of the GNU Library General Public License as published
00007 // by the Free Software Foundation; either version 2 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // PLplot is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU Library General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Library General Public License
00016 // along with PLplot; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00018 //
00019 
00020 #if !defined ( WXPLPLOTWINDOW_H__INCLUDED_ )
00021 #define WXPLPLOTWINDOW_H__INCLUDED_
00022 
00023 #include <wx/window.h>
00024 #include <wx/dcmemory.h>
00025 
00026 #include "wxPLplotstream.h"
00027 
00028 
00030 //  provide an own plot API. You have to get a pointer to wxPLplotstream via the
00031 //  GetStream() method to gain access to the PLplot API.
00032 //
00033 class PLDLLIMPEXP_WX wxPLplotwindow : public wxWindow
00034 {
00035 public:
00036     wxPLplotwindow( wxWindow * parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
00037                     const wxSize& size = wxDefaultSize, long style = 0,
00038                     int pl_style = wxPLPLOT_NONE );                         
00039     ~wxPLplotwindow( void );                                                
00040 
00041     void RenewPlot( void );                                                 
00042     bool SavePlot( const wxString& driver, const wxString& filename );      
00043     wxPLplotstream* GetStream()  { return m_stream; }                       
00044     int getBackend()  { return m_backend; }
00045 
00046 protected:
00047     virtual void OnPaint( wxPaintEvent& event );                
00048     virtual void OnErase( wxEraseEvent & WXUNUSED( event ) );   
00049     virtual void OnSize( wxSizeEvent & WXUNUSED( event ) );     
00050 
00051 private:
00052     // variables regarding double buffering
00053     wxMemoryDC* MemPlotDC;        
00054     int       m_width;            
00055     int       m_height;           
00056     int       bitmapWidth;        
00057     int       bitmapHeight;       
00058     wxBitmap  * MemPlotDCBitmap;  
00059     int       m_backend;
00060 
00061 protected:
00062     wxPLplotstream* m_stream;           
00063 
00064     DECLARE_EVENT_TABLE()
00065 };
00066 
00067 
00068 #endif // !defined( WXPLPLOTWINDOW_H__INCLUDED_ )
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines