1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
9 # This software is governed by the CeCILL-B license under French law and
10 # abiding by the rules of distribution of free software. You can use,
11 # modify and/ or redistribute the software under the terms of the CeCILL-B
12 # license as circulated by CEA, CNRS and INRIA at the following URL
13 # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 # or in the file LICENSE.txt.
16 # As a counterpart to the access to the source code and rights to copy,
17 # modify and redistribute granted by the license, users are provided only
18 # with a limited warranty and the software's author, the holder of the
19 # economic rights, and the successive licensors have only limited
22 # The fact that you are presently reading this means that you have had
23 # knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
26 #include "MaximumsDialog.h"
28 IMPLEMENT_CLASS(MaximumsDialog, wxDialog)
30 MaximumsDialog::MaximumsDialog(wxWindow *parent,wxString title)
31 :wxDialog(parent,-1,title,wxDefaultPosition,wxDefaultSize, wxDEFAULT_DIALOG_STYLE,_T("dialogBox"))
34 where the user can put the values of the maxX and maxY of the axes of the plotter
36 m_maxX = new wxTextCtrl( this, -1, wxT(""));
37 m_maxY = new wxTextCtrl( this, -1, wxT(""));
42 maxX=new wxStaticText(this,-1,_T("Max X:"));
43 maxY=new wxStaticText(this,-1,_T("Max Y:"));
48 okBtn = new wxButton(this,wxID_OK ,_T("OK"));
49 cancelBtn = new wxButton(this,wxID_CANCEL,_T("Cancel"));
53 wxBoxSizer * upper_box = new wxBoxSizer( wxHORIZONTAL );
54 //Including components for plotter control
55 upper_box->Add( maxX, wxSizerFlags().Border(wxALL,6));
56 upper_box->Add( m_maxX, wxSizerFlags().Border(wxALL,6));
57 upper_box->Add( maxY, wxSizerFlags().Border(wxALL,6));
58 upper_box->Add( m_maxY, wxSizerFlags().Border(wxALL,6));
62 wxBoxSizer *bottomBox = new wxBoxSizer( wxHORIZONTAL );
63 bottomBox->Add( okBtn, wxSizerFlags().Center());
64 bottomBox->AddSpacer(40);
65 bottomBox->Add( cancelBtn,wxSizerFlags().Center() );
67 // Adding the components to the sizer
68 wxFlexGridSizer *sizer = new wxFlexGridSizer(1);
69 sizer->Add( upper_box,0,wxALIGN_BOTTOM);
70 //sizer->AddGrowableRow (1,1);
71 sizer->Add( bottomBox,0,wxALIGN_CENTER);
73 SetAutoLayout( TRUE );
75 SetBestSize(wxSize(325,100));
77 //-----------------------------------------------------------------
78 float MaximumsDialog::getXValue()
80 wxString mx=m_maxX->GetValue();
83 return (float)atoi( (const char*)(mx.mb_str()) );
88 //----------------------------------------------------------------
89 float MaximumsDialog::getYValue()
91 wxString my=m_maxY->GetValue();
94 return atof( (const char*) (my.mb_str()) );
99 //----------------------------------------------------------------