27308f1df7b860b579b93472aac43077299a78a9
[ctsim.git] / src / dlgezplot.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          dlgezplot.h
5 **   Purpose:       Headers for EZPlot Dialog
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  Jan 2001
8 **
9 **  This is part of the CTSim program
10 **  Copyright (c) 1983-2001 Kevin Rosenberg
11 **
12 **  $Id: dlgezplot.h,v 1.5 2003/01/23 23:35:58 kevin Exp $
13 **
14 **  This program is free software; you can redistribute it and/or modify
15 **  it under the terms of the GNU General Public License (version 2) as
16 **  published by the Free Software Foundation.
17 **
18 **  This program is distributed in the hope that it will be useful,
19 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 **  GNU General Public License for more details.
22 **
23 **  You should have received a copy of the GNU General Public License
24 **  along with this program; if not, write to the Free Software
25 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 ******************************************************************************/
27
28 #ifndef __DLGEZPLOT_H_
29 #define __DLGEZPLOT_H_
30
31 #include "wx/setup.h"
32 #include "wx/dialog.h"
33 #include "wx/dcmemory.h"
34
35 class wxButton;
36 class SGP;
37 class SGPDriver;
38 class EZPlot;
39
40
41 class EZPlotControl : public wxPanel
42 {
43 private:  
44   DECLARE_DYNAMIC_CLASS (EZPlotControl)
45   DECLARE_EVENT_TABLE ()
46   EZPlot* m_pEZPlot;
47    int m_iClientX;   // size of client window
48    int m_iClientY;
49
50    SGPDriver* m_pSGPDriver;
51    SGP* m_pSGP;
52    wxDC* m_pDC;
53
54 public:
55     EZPlotControl (wxWindow *parent, wxWindowID id = -1,
56                const wxPoint& pos = wxDefaultPosition,
57                const wxSize& size = wxDefaultSize,
58                long style = wxSTATIC_BORDER,
59                const wxValidator& validator = wxDefaultValidator,
60                const wxString& name = "EZPlotCtrl");
61
62    virtual ~EZPlotControl();
63
64   virtual wxSize GetBestSize() const;
65
66   EZPlot* getEZPlot() 
67   { return m_pEZPlot; }
68
69   void OnPaint(wxPaintEvent& event);
70 };
71
72
73 class wxEZPlotDialog : public wxDialog
74 {
75 private:
76    wxWindow *m_parentTop;     // parent top level window (may be NULL)
77    EZPlotControl* m_pEZPlotCtrl;
78
79 public:
80   wxEZPlotDialog (wxWindow *parent = NULL, bool bCancelButton = false);
81
82    ~wxEZPlotDialog();
83
84    EZPlot* getEZPlot ()
85    { if (m_pEZPlotCtrl) return m_pEZPlotCtrl->getEZPlot(); else return NULL; }
86 };
87
88 class EZPlotDialog
89 {
90 private:
91   wxEZPlotDialog* m_pDialog;
92
93 public:
94   EZPlotDialog (wxWindow *parent = NULL, bool bCancelButton = false);
95
96   EZPlot* getEZPlot ();
97   int ShowModal();
98 };
99 #endif
100