1 #include "MaximumsDialog.h"
3 IMPLEMENT_CLASS(MaximumsDialog, wxDialog)
5 MaximumsDialog::MaximumsDialog(wxWindow *parent,wxString title)
6 :wxDialog(parent,-1,title,wxDefaultPosition,wxDefaultSize, wxDEFAULT_DIALOG_STYLE,_T("dialogBox"))
9 where the user can put the values of the maxX and maxY of the axes of the plotter
11 m_maxX = new wxTextCtrl( this, -1, wxT(""));
12 m_maxY = new wxTextCtrl( this, -1, wxT(""));
17 maxX=new wxStaticText(this,-1,_T("Max X:"));
18 maxY=new wxStaticText(this,-1,_T("Max Y:"));
23 okBtn = new wxButton(this,wxID_OK ,_T("OK"));
24 cancelBtn = new wxButton(this,wxID_CANCEL,_T("Cancel"));
28 wxBoxSizer * upper_box = new wxBoxSizer( wxHORIZONTAL );
29 //Including components for plotter control
30 upper_box->Add( maxX, wxSizerFlags().Border(wxALL,6));
31 upper_box->Add( m_maxX, wxSizerFlags().Border(wxALL,6));
32 upper_box->Add( maxY, wxSizerFlags().Border(wxALL,6));
33 upper_box->Add( m_maxY, wxSizerFlags().Border(wxALL,6));
37 wxBoxSizer *bottomBox = new wxBoxSizer( wxHORIZONTAL );
38 bottomBox->Add( okBtn, wxSizerFlags().Center());
39 bottomBox->AddSpacer(40);
40 bottomBox->Add( cancelBtn,wxSizerFlags().Center() );
42 // Adding the components to the sizer
43 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
44 sizer->Add( upper_box,0,wxALIGN_BOTTOM);
45 //sizer->AddGrowableRow (1,1);
46 sizer->Add( bottomBox,0,wxALIGN_CENTER);
48 SetAutoLayout( TRUE );
50 SetBestSize(wxSize(325,100));
52 //-----------------------------------------------------------------
53 float MaximumsDialog::getXValue()
55 wxString mx=m_maxX->GetValue();
58 return (float)atoi( (const char*)(mx.mb_str()) );
63 //----------------------------------------------------------------
64 float MaximumsDialog::getYValue()
66 wxString my=m_maxY->GetValue();
69 return atof( (const char*) (my.mb_str()) );
74 //----------------------------------------------------------------