** Date Started: Jan 2001
**
** This is part of the CTSim program
-** Copyright (C) 1983-2001 Kevin Rosenberg
+** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: dlgezplot.cpp,v 1.2 2001/01/12 21:53:27 kevin Exp $
+** $Id: dlgezplot.cpp,v 1.5 2003/01/23 23:35:58 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
******************************************************************************/
-#ifdef __GNUG__
-#pragma implementation "dlgezplot.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
#endif
+#ifdef HAVE_WXWINDOWS
+
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#ifdef __BORLANDC__
-#pragma hdrstop
-#endif
-
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/frame.h"
#endif
#include "ct.h"
-#include "ctsim.h"
+#include "../src/ctsim.h"
#include "dlgezplot.h"
IMPLEMENT_CLASS(EZPlotControl, wxPanel)
-EZPlotControl::EZPlotControl (wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style,
- const wxValidator& validator, const wxString& name)
+EZPlotControl::EZPlotControl (wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
+ long style, const wxValidator& validator, const wxString& name)
: m_pEZPlot(0), m_pSGPDriver(0), m_pSGP(0), m_pDC(0)
{
Create(parent, id, pos, size, style, name);
m_pSGPDriver = new SGPDriver (&dc, m_iClientX, m_iClientY);
m_pSGP = new SGP (*m_pSGPDriver);
m_pSGP->setTextPointSize(10);
+// m_pSGP->setViewport (0, 0, 1., 0.5); // for debugging testing only
if (m_pEZPlot && m_pSGP) {
m_pSGP->eraseWindow();
m_pEZPlot->plot (m_pSGP);
}
-EZPlotDialog::EZPlotDialog (wxWindow *parent)
+wxEZPlotDialog::wxEZPlotDialog (wxWindow *parent, bool bCancelButton)
: wxDialog((parent ? parent : theApp->getMainFrame()), -1, wxString("EZPlot"), wxDefaultPosition, wxDefaultSize, wxDIALOG_MODAL),
m_parentTop(0)
{
pTopSizer->Add (m_pEZPlotCtrl = new EZPlotControl (this), 0, wxALIGN_CENTER | wxALL, 5);
wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
- wxButton* pButtonOk = new wxButton (this, wxID_OK, "Okay");
- wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ wxButton* pButtonOk = new wxButton (this, wxID_OK, "Ok");
pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
- pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
-
+ if (bCancelButton) {
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, "Cancel");
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ }
pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
SetAutoLayout (true);
-/////////////////////////////////////////////////////
-// destruction
+EZPlotDialog::EZPlotDialog(wxWindow* parent, bool bCancelButton)
+ : m_pDialog(new wxEZPlotDialog(parent, bCancelButton))
+{
+}
+
+EZPlot*
+EZPlotDialog::getEZPlot()
+{ return m_pDialog->getEZPlot(); }
+
+int
+EZPlotDialog::ShowModal()
+{ return m_pDialog->ShowModal(); }
-EZPlotDialog::~EZPlotDialog()
+wxEZPlotDialog::~wxEZPlotDialog()
{
if ( m_parentTop )
m_parentTop->Enable(TRUE);
}
+
+
+#endif // HAVE_WXWINDOWS