#include <MaximumsDialog.h>
Public Member Functions | |
MaximumsDialog (wxWindow *parent, wxString title) | |
float | getXValue () |
float | getYValue () |
Private Member Functions | |
DECLARE_CLASS (MaximumsDialog) | |
Private Attributes | |
wxTextCtrl * | m_maxX |
wxTextCtrl * | m_maxY |
wxStaticText * | maxX |
wxStaticText * | maxY |
wxButton * | okBtn |
wxButton * | cancelBtn |
Definition at line 42 of file MaximumsDialog.h.
MaximumsDialog::MaximumsDialog | ( | wxWindow * | parent, | |
wxString | title | |||
) |
Definition at line 5 of file MaximumsDialog.cxx.
00006 :wxDialog(parent,-1,title,wxDefaultPosition,wxDefaultSize, wxDEFAULT_DIALOG_STYLE,_T("dialogBox")) 00007 { 00008 /* 00009 where the user can put the values of the maxX and maxY of the axes of the plotter 00010 */ 00011 m_maxX = new wxTextCtrl( this, -1, wxT("")); 00012 m_maxY = new wxTextCtrl( this, -1, wxT("")); 00013 00014 /* 00015 * just labels 00016 */ 00017 maxX=new wxStaticText(this,-1,_T("Max X:")); 00018 maxY=new wxStaticText(this,-1,_T("Max Y:")); 00019 00020 /* 00021 Buttons 00022 */ 00023 okBtn = new wxButton(this,wxID_OK ,_T("OK")); 00024 cancelBtn = new wxButton(this,wxID_CANCEL,_T("Cancel")); 00025 00026 //BOXES 00027 //Upper Box 00028 wxBoxSizer * upper_box = new wxBoxSizer( wxHORIZONTAL ); 00029 //Including components for plotter control 00030 upper_box->Add( maxX, wxSizerFlags().Border(wxALL,6)); 00031 upper_box->Add( m_maxX, wxSizerFlags().Border(wxALL,6)); 00032 upper_box->Add( maxY, wxSizerFlags().Border(wxALL,6)); 00033 upper_box->Add( m_maxY, wxSizerFlags().Border(wxALL,6)); 00034 00035 00036 //bottom Sizer 00037 wxBoxSizer *bottomBox = new wxBoxSizer( wxHORIZONTAL ); 00038 bottomBox->Add( okBtn, wxSizerFlags().Center()); 00039 bottomBox->AddSpacer(40); 00040 bottomBox->Add( cancelBtn,wxSizerFlags().Center() ); 00041 00042 // Adding the components to the sizer 00043 wxFlexGridSizer *sizer = new wxFlexGridSizer(1); 00044 sizer->Add( upper_box,0,wxALIGN_BOTTOM); 00045 //sizer->AddGrowableRow (1,1); 00046 sizer->Add( bottomBox,0,wxALIGN_CENTER); 00047 00048 SetAutoLayout( TRUE ); 00049 SetSizer( sizer ); 00050 SetBestSize(wxSize(325,100)); 00051 }
MaximumsDialog::DECLARE_CLASS | ( | MaximumsDialog | ) | [private] |
float MaximumsDialog::getXValue | ( | ) |
Definition at line 53 of file MaximumsDialog.cxx.
References m_maxX.
Referenced by pPlotterWindow::onStartDrawing().
00054 { 00055 wxString mx=m_maxX->GetValue(); 00056 if(mx.IsNumber()) 00057 { 00058 return (float)atoi( (const char*)(mx.mb_str()) ); 00059 } 00060 else 00061 return -1; 00062 }
float MaximumsDialog::getYValue | ( | ) |
Definition at line 64 of file MaximumsDialog.cxx.
References m_maxY.
Referenced by pPlotterWindow::onStartDrawing().
00065 { 00066 wxString my=m_maxY->GetValue(); 00067 if(my.IsNumber()) 00068 { 00069 return atof( (const char*) (my.mb_str()) ); 00070 } 00071 else 00072 return -1; 00073 }
wxButton* MaximumsDialog::cancelBtn [private] |
Definition at line 84 of file MaximumsDialog.h.
wxTextCtrl* MaximumsDialog::m_maxX [private] |
Definition at line 66 of file MaximumsDialog.h.
Referenced by getXValue().
wxTextCtrl* MaximumsDialog::m_maxY [private] |
Definition at line 70 of file MaximumsDialog.h.
Referenced by getYValue().
wxStaticText* MaximumsDialog::maxX [private] |
Definition at line 74 of file MaximumsDialog.h.
wxStaticText* MaximumsDialog::maxY [private] |
Definition at line 75 of file MaximumsDialog.h.
wxButton* MaximumsDialog::okBtn [private] |
Definition at line 80 of file MaximumsDialog.h.