MaximumsDialog.cxx

Go to the documentation of this file.
00001 #include "MaximumsDialog.h"
00002 
00003 IMPLEMENT_CLASS(MaximumsDialog, wxDialog)
00004 
00005 MaximumsDialog::MaximumsDialog(wxWindow *parent,wxString title)
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 }
00052 //-----------------------------------------------------------------
00053 float MaximumsDialog::getXValue()
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 }
00063 //----------------------------------------------------------------
00064 float MaximumsDialog::getYValue()
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 }
00074 //----------------------------------------------------------------
00075 
00076 
00077 

Generated on 18 Mar 2010 for creaMaracasVisu_lib by  doxygen 1.6.1