projects
/
ctsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 6.0.2 - new release
[ctsim.git]
/
src
/
dlgezplot.cpp
diff --git
a/src/dlgezplot.cpp
b/src/dlgezplot.cpp
index bdb8cb7af9674318e522782f18a47a34a14f5739..17fe68f7101765619b2f8647f619d38867b9d574 100644
(file)
--- a/
src/dlgezplot.cpp
+++ b/
src/dlgezplot.cpp
@@
-7,9
+7,7
@@
** Date Started: Jan 2001
**
** This is part of the CTSim program
** Date Started: Jan 2001
**
** This is part of the CTSim program
-** Copyright (C) 1983-2001 Kevin Rosenberg
-**
-** $Id: dlgezplot.cpp,v 1.2 2001/01/12 21:53:27 kevin Exp $
+** Copyright (c) 1983-2009 Kevin Rosenberg
**
** 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
**
** 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
@@
-25,17
+23,15
@@
** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
******************************************************************************/
** 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
#endif
+#ifdef HAVE_WXWINDOWS
+
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// 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"
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/frame.h"
@@
-50,7
+46,7
@@
#endif
#include "ct.h"
#endif
#include "ct.h"
-#include "ctsim.h"
+#include "
../src/
ctsim.h"
#include "dlgezplot.h"
#include "dlgezplot.h"
@@
-64,8
+60,8
@@
END_EVENT_TABLE()
IMPLEMENT_CLASS(EZPlotControl, wxPanel)
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_pEZPlot(0), m_pSGPDriver(0), m_pSGP(0), m_pDC(0)
{
Create(parent, id, pos, size, style, name);
@@
-82,7
+78,7
@@
EZPlotControl::GetBestSize () const
}
EZPlotControl::~EZPlotControl()
}
EZPlotControl::~EZPlotControl()
-{
+{
delete m_pEZPlot;
delete m_pSGP;
delete m_pSGPDriver;
delete m_pEZPlot;
delete m_pSGP;
delete m_pSGPDriver;
@@
-97,6
+93,7
@@
EZPlotControl::OnPaint (wxPaintEvent& event)
m_pSGPDriver = new SGPDriver (&dc, m_iClientX, m_iClientY);
m_pSGP = new SGP (*m_pSGPDriver);
m_pSGP->setTextPointSize(10);
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);
if (m_pEZPlot && m_pSGP) {
m_pSGP->eraseWindow();
m_pEZPlot->plot (m_pSGP);
@@
-104,9
+101,9
@@
EZPlotControl::OnPaint (wxPaintEvent& event)
}
}
-
EZPlotDialog::EZPlotDialog (wxWindow *parent
)
-
: wxDialog((parent ? parent : theApp->getMainFrame()), -1, wxString("EZPlot"), wxDefaultPosition, wxDefaultSize, wxDIALOG_MODAL
),
- m_parentTop(0)
+
wxEZPlotDialog::wxEZPlotDialog (wxWindow *parent, bool bCancelButton
)
+
: wxDialog((parent ? parent : theApp->getMainFrame()), -1, _T("EZPlot")
),
+
m_parentTop(0)
{
if (! parent)
parent = theApp->getMainFrame();
{
if (! parent)
parent = theApp->getMainFrame();
@@
-114,19
+111,20
@@
EZPlotDialog::EZPlotDialog (wxWindow *parent)
m_parentTop = parent;
while ( m_parentTop && m_parentTop->GetParent() )
m_parentTop = m_parentTop->GetParent();
m_parentTop = parent;
while ( m_parentTop && m_parentTop->GetParent() )
m_parentTop = m_parentTop->GetParent();
-
+
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
pTopSizer->Add (m_pEZPlotCtrl = new EZPlotControl (this), 0, wxALIGN_CENTER | wxALL, 5);
wxBoxSizer* pTopSizer = new wxBoxSizer (wxVERTICAL);
pTopSizer->Add (m_pEZPlotCtrl = new EZPlotControl (this), 0, wxALIGN_CENTER | wxALL, 5);
-
+
wxBoxSizer* pButtonSizer = new wxBoxSizer (wxHORIZONTAL);
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, _T("Ok"));
pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
pButtonSizer->Add (pButtonOk, 0, wxEXPAND | wxALL, 10);
- pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
-
+ if (bCancelButton) {
+ wxButton* pButtonCancel = new wxButton (this, wxID_CANCEL, _T("Cancel"));
+ pButtonSizer->Add (pButtonCancel, 0, wxEXPAND | wxALL, 10);
+ }
pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
pTopSizer->Add (pButtonSizer, 0, wxALIGN_CENTER);
-
+
SetAutoLayout (true);
SetSizer (pTopSizer);
pTopSizer->Fit (this);
SetAutoLayout (true);
SetSizer (pTopSizer);
pTopSizer->Fit (this);
@@
-135,12
+133,25
@@
EZPlotDialog::EZPlotDialog (wxWindow *parent)
-/////////////////////////////////////////////////////
-// destruction
+EZPlotDialog::EZPlotDialog(wxWindow* parent, bool bCancelButton)
+ : m_pDialog(new wxEZPlotDialog(parent, bCancelButton))
+{
+}
+
+EZPlot*
+EZPlotDialog::getEZPlot()
+{ return m_pDialog->getEZPlot(); }
-EZPlotDialog::~EZPlotDialog()
+int
+EZPlotDialog::ShowModal()
+{ return m_pDialog->ShowModal(); }
+
+wxEZPlotDialog::~wxEZPlotDialog()
{
if ( m_parentTop )
m_parentTop->Enable(TRUE);
}
{
if ( m_parentTop )
m_parentTop->Enable(TRUE);
}
+
+
+#endif // HAVE_WXWINDOWS